Skip to content

Comment on Public domain POSIX makeparent

Comments

To answer my own question, if this[1] StackExchange to be believed, you need to join the mailing list of something called “The Austin Group”. Although some fairly informative meeting minutes are available publicly here[2].

[1]: https://unix.stackexchange.com/q/607333/105635

[2]: https://www.opengroup.org/austin/docreg.html

And from the most recent minutes:

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.

To be fair, if you need conditionals in target bodies, you're probably better off putting the body into a separate file as a shell script. And if you need conditionals in macros, there's the old macro-in-macro approach:

  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.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.