I'm sure this isn't the best way to do it, and tools like autoconf and cmake would be better, but I really just want something quick and dirty.
Basically, I have code in a distributed system that's supposed to run on a number of different machines with different hardware. I just want to do something simple by having some targets that set variable values, and then calls a general make that uses those variables.
On each machine, I have to link to a library that's compiled specifically for that machine (it exposes the same interface, so i don't need to change my code).
For example
Code:
titan:
PATH_TO_INCLUDE=/path/to/include/on/titan
PATH_TO_LIBRARY=/path/to/library/on/titan
etc. ect.
make common
cielo:
PATH_TO_INCLUDE=/path/to/include/on/cielo
PATH_TO_LIBRARY=/path/to/library/on/cielo
make common
common
gcc -c something.c -I $(PATH_TO_INCLUDE)
gcc -o something.o -L $(PATH_TO_LIBARY)
however, it seems that the PATH_TO_* variables aren't kept across target invocations.
What am I missing here, or am I just completely off base?
Thanks.