Currently I am working with Makefiles that have definitions like
MYLIB=/.../mylib-1.2.34
The problem is that these are different for different developers, and it is a pain having to re-edit the file after every checkout.
So I tried exporting a specific environment variable, and then doing
MYLIBX:=$(MYLIB_ENV)
MYLIBX?=MYLIB
Trouble is that if MYLIB_ENV is not defined, it still creates an empty MYLIBX, so the ?= does not work. Is there a clean way to do this very basic thing?
I am working with a "rich" set of make files developed over many years that do all sorts of things like make and call each other, so changing things deeply is not an option.
SOLUTION
Double shuffle. MYLIB already defined.
MYLIB_ENV?=MYLIB
MYLIB:=MYLIB_ENV
export
for the variables you want to get in yourMakefile
export
ing environment variable is working for you now?