@G.M. Looked it up and looks very promising. Will give it a shot tomorrow. Thanks!
– bob.sacamento
All variables from the environment are imported as make variables. So ifdef works for environment variables as well. You only need origin if you want to behave differently depending on whether the variable was defined in the environment vs. makefile vs. command line etc.
– MadScientist
@MadScientist Don't know what the deal is, but I tried and tried with ifdef. Just would not give me anything. origin gives me what I need. Thanks.
– bob.sacamento
1 Answers
0
votes
I don't know what you're doing (it's always best to include an actual example of what you have tried) but it definitely works:
$ cat Makefile
ifdef FOO
$(info FOO is defined)
endif
all:;@:
$ make
$ FOO=1 make
FOO is defined
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
origin
function? – G.M.ifdef
works for environment variables as well. You only needorigin
if you want to behave differently depending on whether the variable was defined in the environment vs. makefile vs. command line etc. – MadScientistifdef
. Just would not give me anything.origin
gives me what I need. Thanks. – bob.sacamento