Hi,
This is what I want to do:
1) I have a static makefile. whenever any target is called (e.g. "make
foo"), it first needs to
generate on-the-fly another makefile, e.g. "makefile.env", and
include it,
2) then based on some variables that are present in "makefile.env",
decide what commands
to execute for "make foo".
How can I get this to work?
I tried several things, and this is what I have right now, and I couldn't
get it to work.
when I issue the first "make foo", it can not include the file, because it's
not present.
so it creates it, but I think that happens in parallel with the execution of
target "foo".
so, I get the message "MY_VARIABLE is 0", even though the generated
"makefile.env"
has it set to 1.
* makefile:
ENV_MAKE := $(PWD)/makefile.env
$(ENV_MAKE) :
@(generate_make.pl -o $@)
include $(ENV_MAKE)
foo :
ifeq ($(MY_VARIABLE),1)
@(echo "MY_VARIABLE is 1")
else
@(echo "MY_VARIABLE is 0")
endif
* makefile.env:
MY_VARIABLE := 1
--
View this message in context:
http://old.nabble.com/generate-a-file-and-then-include-it-tp33544801p33544801.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make