help-make
[Top][All Lists]
Advanced

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

Setting variables for an included file only


From: Peter Simons
Subject: Setting variables for an included file only
Date: 04 Jun 2003 00:22:57 +0200

Unfortunately, I couldn't find any clues in the (otherwise excellent!)
manual, so I'd really be grateful if somebody could help me with this
question:

I want to include several sub-makefiles from my top-level makefile,
but I need to overwrite some of the variables they define.
Unfortunately, I need to overwrite these variables with different
values for each sub-makefile! Since recursive make is not an option in
my case, I wonder whether GNU Make supports a construct like this:

 | foo/GNUmakefile:        CPPFLAGS=-I/somewhere
 | bar/GNUmakefile:        CPPFLAGS=-I/elsewhere
 |
 | include foo/GNUmakefile bar/GNUmakefile

I know I can specify per-target variables in newer makes, but can I
somehow specify an per-include variable as well?

If not, would it be very difficult to add this feature?

Peter


P. S.: Please pardon me if you see this twice, but I believe my first
       attempt at posting here didn't get through.






reply via email to

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