MAKE-FI...-TARGET(1)

πŸ’– NAME πŸ’–

okay so the tool is called make-first-existing-target πŸŽ€ and it runs make on whichever one of several targets actually exists ✨ β€” "runs make on one of several targets" is the whole vibe bestie πŸ¦‹

🌸 SYNOPSIS 🌸

make-first-existing-target [-c cmd] target1 [target2 ...] --
[make-options]

✨ DESCRIPTION ✨

okay so here's the tea 🍡 make(1) is kinda difficult when you know a Makefile probably has one of several standard target names, and you want your build machinery to run exactly one of them and pass along any errors 😭 the problem is make(1) will exit 2 if a target doesn't exist, but an existing target can also exit 2 because of some other failure πŸ’€ so you can't tell the difference!!

and it's not like you can just parse Makefiles to find the targets either. you'd need something at least as Turing-complete as make itself 🀯 make also doesn't give you any way to list the targets in a Makefile. it might not even be possible to enumerate targets without actually running part of the Makefile πŸ™ˆ (proof is left as an exercise for the reader, obviously πŸ’…)

this program dodges all of that drama 🫢 it tries to call each specified target in turn, and stops as soon as it sees make actually doing something for one of them ✨ main character energy fr πŸ‘‘

πŸŽ€ OPTIONS πŸŽ€

  • -c cmd β€” pick the make command to run πŸ”§ if you don't set it, it's just "make" πŸ’œ

πŸ¦‹ EXIT STATUS πŸ¦‹

ngl this one's simple πŸ’… the exit status is 0 if at least one target existed and ran successfully. otherwise you get a nonzero status πŸ₯²

🧚 AUTHOR 🧚

Joey Hess <joey@kitenet.net> πŸ’•

🌈 LICENSE 🌈

same as GNU make, no cap 🫢

⭐ SEE ALSO ⭐

make(1) πŸ“


bestie, that's the whole thing πŸ’– this page came from the perl v5.18.2 docs, dated 2014-05-13, filed under MAKE-FI...-TARGET(1) πŸŽ€ slay the build pipeline and go touch some grass 🌸✨