I have a makefile that works just fine in make 3.81 on RHEL 6.8, but
quickly fails with make 4.1 on Ubuntu 16.04.

It's failing on this line (details changed, but same logic):

$(if $(myvar),myothervar := abc,myothervar := xyz)

with error message:

build.mk:3: *** empty variable name.  Stop.

With some added debug, I can verify that $(myvar) is empty at this point in
the make file.

I searched Google, perused StackOverflow, searched GNU make bugs, and the
GNU make docs -- no luck. I can't even find in the docs where the "$(if
...)" syntax is described.

Has this behavior changed in make 4.1? Or maybe $(if ...) has been
deprecated for a long time, and make 4.1 finally axed it... ? If it did
change, when? And, finally, if you made it this far, what's the recommended
alternative -- ifdef?

Thx in advance for any help!

Best,
--David Drinnan
_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to