help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Choosing where to build depending on the target(s)


From: Mason
Subject: Re: Choosing where to build depending on the target(s)
Date: Thu, 12 Dec 2013 16:56:04 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22.1

Mark Galeck wrote:

> The target-specific variables are only in effect in recipes, not in
> prerequisites and other targets, so the above won't work.
> 
> You have to hack your own "target-specific" variable name, depending on the
> target, like this:
> 
> mwb_DDI_SUFFIX := _mwb
> 
> $(foreach goal, owb mwb, $(eval $(goal):
> ../../rootfs$($(goal)_DDI_SUFFIX)/partition/APP_HBBTV))
> 
> %/decrypt: decrypt.c

I ended up giving up begin able to build the two targets in a single
invocation of make. So I went with:

CC  = mips-linux-gnu-gcc

ifeq "$(MAKECMDGOALS)" "mwb"
  DDI_SUFFIX = _mwb
endif
APP = ../../rootfs$(DDI_SUFFIX)/partition/APP_HBBTV

.SUFFIXES:

help:
        @echo VALID TARGETS: owb mwb

owb: $(APP)/decrypt
mwb: $(APP)/decrypt

$(APP)/decrypt: decrypt.c
        $(LINK.c) $^ $(LDLIBS) -o $@
        mips-linux-gnu-strip $@



While I was looking for a better solution, I came across several
of Paul's articles, which I'll post here, for my reference.

http://mad-scientist.net/make/rules.html
http://mad-scientist.net/make/vpath.html
http://mad-scientist.net/make/multi-arch.html

-- 
Regards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]