Genode build system

Norman Feske norman.feske at genode-labs.com
Mon Mar 18 21:31:22 CET 2019


Hi Valery,

On 18.03.19 00:17, Valery V. Sedletski via users wrote:
> Hi all.
> 
> Does Genode build system only allow to build a binary or library
> with each "target.mk" makefile? Is it possible to have non-binary
> targets in these makefiles, or have more than one target?
> ...
>
> to target.mk. So, the map file should be a dependency of "all" target,
> but this does not work, because "map" then is built before the binary
> specified as
> 
> TARGET = <binary_name>
> 
> Does someone have any ideas, how it's possible to accomplish this?

I'm afraid that your use case is currently not very well covered.

So we should probably add a proper hook for it. In the meantime, could
you give the following idea a try?

-----

ifneq ($(INSTALL_DIR),)
all: map
endif

map: $(TARGET)
	nm $< | sed "s/some/magic" > $@

-----

The check for 'INSTALL_DIR' is needed because the target.mk file is
actually visited twice during the build. First, it is examined to find
out the inter-library dependencies. This dependency stage is followed by
the actual build stage. The custom rule should be executed in the latter
stage only. As INSTALL_DIR is defined only at the build stage, we can
use it as a condition here.

The dependency from $(TARGET) ensures that your binary exists before
'nm' is called on it.

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

https://www.genode-labs.com · https://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth



More information about the users mailing list