On Thu, 5 Dec 2002, guy keren wrote:
>
> Makefiles should not be medled with. if you try to do something
> complicated - most likely you'll fail, cause the language that gmake (and
> the commercial 'make' variants) supports - are very very limited.
A chalange, then, ha?
(reading the gnu-make manual)
Well, the best I could find was: "target-spesific values"
There is one more special feature of target-specific variables: when
you define a target-specific variable, that variable value is also in
effect for all prerequisites of this target (unless those prerequisites
override it with their own target-specific variable value). So, for
example, a statement like this:
prog : CFLAGS = -g
prog : prog.o foo.o bar.o
will set `CFLAGS' to `-g' in the command script for `prog', but it will
also set `CFLAGS' to `-g' in the command scripts that create `prog.o',
`foo.o', and `bar.o', and any command scripts which create their
prerequisites.
So how about:
ppc: ARC=PPC
ppc: release
release:
ifeq ($(ARCH),PPC)
(is that the right syntax?)
The problem is that 'release' has to be a pre-requirement of ppc.
But then-again, recursive makes are not much nicer.
Another minor problem is that this is surely gnu-make specific.
(OTOH, makefiles are indeed confusing and difficult to debug)
--
Tzafrir Cohen
mailto:[EMAIL PROTECTED]
http://www.technion.ac.il/~tzafrir
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]