That's pretty neat! But is there a link to the “future POSIX standard”? A few months ago I tried looking for it on https://pubs.opengroup.org/, but couldn't.
> Bug 805: Add Make conditionals Rejected
> https://austingroupbugs.net/view.php?id=805
> As the behavior described in the desired action hasn't actually been implemented, to our knowledge, and there is insufficient consensus amongst the variants that have been implemented to pick one as the de facto standard this request is being rejected. Should the industry come to a consensus a new bug reflecting that should be filed.
TL;DR: no way forward for adding if/else statements to make for now.
DEBUG = 0
DEBUG_FLAG_0 =
DEBUG_FLAG_1 = --debug
# …
main.bin: 1.o 2.o # …
build $(DEBUG_FLAG_$(DEBUG)) -o main.bin # …
I'm not saying that it's a good way, but it is a way.