fogus/potion — pull request #16 by catseye (2011-12-03 02:36:06+00:00)
Title: Use $(shell ...) instead of backquotes in Makefile

I'm running Ubuntu (10.04 LTS and 11.10), with GNU make 3.81, and had trouble building Potion because the Makefile kept thinking I was using `mingw`. Upon diagnosis, it turns out that, for GNU make at least, backquotes in a variable's value are expanded at an extremely late point in Makefile processing -- too late to make a difference in the `ifeq` statement, which compares the literal backquoted string to the string 0 and always fails.

The solution, at least for GNU make, is to use `$(shell ...)` instead of backquotes. I tested this by modifying `./tools/config.sh` temporarily, and confirmed that it is being detected correctly in the `ifeq` test. Not sure how well supported this construct is outside of GNU make, or how much this project wants to be dependent on GNU make, but I offer this fix on the grounds that it works for me.