rmyorston / pdpmake

Public domain POSIX make
https://frippery.org/make
Other
103 stars 10 forks source link

Invalid "invalid macro assignment"? #31

Closed xparq closed 8 months ago

xparq commented 9 months ago

I can't get enough of these lovely one-liners, but they shouldn't be "almost recognized" as macro assignments:

debug:; @echo "a = $(a)"

or just:

debug:; @echo a = $(a)

They trigger an invalid macro assignment error. They are fine with anything else than a = (and its friends), or on their own line in a normal command block:

debug:
    @echo a = $(a)

(Tried with BusyBox v1.37.0-FRP-5181-g5c1a3b00e.)

rmyorston commented 8 months ago

Macro assignments were being detected before target rules. This didn't matter in the original code because inline commands on target rules weren't supported.

I've changed the order. The test suite still passes, but this is quite an intrusive change so caution is advised.

The busybox-w32 applet has also been updated and new prerelease binaries have been issued.

xparq commented 8 months ago

Thanks! I'm glad it could be resolved with simply flipping the order. (I was kinda secretly worried that it may have hidden tentacles of unexpected internal dependencies. Hopefully none. I've read the (original) code, but nothing stood out. Which means nothing, of course, but feels good to say. :) )

Special thanks for baking it into BB, too.