Pelles C forum

Pelles C => Bug reports => Topic started by: skeeto on June 17, 2016, 11:27:45 PM

Title: pomake rejects macros in lvalue names
Post by: skeeto on June 17, 2016, 11:27:45 PM
This isn't exactly a bug since there's no promised behavior, but it departs from both POSIX and Microsoft's nmake. The following Makefile lines:

BAR = FOO
$(BAR) = 1


Cause pomake to report "warning: The name '$(BAR)' contains one or more inappropriate characters." I expect FOO to be assigned to 1. Instead, the assignment doesn't take place (FOO remains empty). A POSIX-compliant make is required to expand the left-hand side before assignment, and nmake follows suit.

Why use such a weird construction? It's a portable poor man's conditional assignment (http://nullprogram.com/blog/2016/04/30/).