MAKEFILE(1)

📦
version 11.0 · 5 versions
, in nixpkgs unstable

🎀 MAKEFILE(1) 🎀

okay so bestie, real talk: this page is filed as a manual page but it's literally a BSD make fragment 💀 like, no .Sh NAME, no flags, no exit statuses — just vibes and a build recipe. It lives in the NetBSD source tree, revision 1.1, dated 2013/02/19, timestamped 06:04:44, checked in by jmmv. Keep that energy in mind for the whole read. 🫶

It's the makefile that handles the kyua-tester.1 man page for the kyua-testers package — generating it from a .in template and then cleaning it up afterwards. Short file, big main character energy. 👑


✨ THE WHOLE FILE, NO EDITS ✨

here it is, absolutely untouched, every character where it belongs — including the fancy ones (more on those below, iykyk) 🙈

SRCDIR=         ${NETBSDSRCDIR}/external/bsd/kyua‐testers/dist

MAN=            kyua‐tester.1

CLEANFILES+=    kyua‐tester.1    kyua‐tester.1:  kyua‐tester.1.in
        sed  ‐e  ’s,__PACKAGE__,kyua‐testers,g’                ‐e
’s,__TMPDIR__,/tmp,g’                <${.ALLSRC}  >${.TARGET}.tmp
        mv ${.TARGET}.tmp ${.TARGET}

that's it. that's the whole page. four-ish lines and a recipe. iconic behaviour honestly 🌸


💅 LINE BY LINE, BESTIE 💅

  • SRCDIR= ${NETBSDSRCDIR}/external/bsd/kyua‐testers/dist — sets SRCDIR to the dist directory of kyua-testers, built out of ${NETBSDSRCDIR} plus /external/bsd/kyua‐testers/dist. the spaces after the = are just there to make the assignments line up pretty. we respect a well-aligned block ✨
  • MAN= kyua‐tester.1 — declares kyua-tester.1 in the MAN variable. that's the man page this whole file is about. starring role, no notes 💖
  • CLEANFILES+= kyua‐tester.1 — appends kyua-tester.1 to CLEANFILES (note the +=, not =, bestie — that's the append, don't come for me). in the source it sits right next to the dependency line below it, so I'm keeping them together exactly like the original does 🎀
  • kyua‐tester.1: kyua‐tester.1.in — the target kyua-tester.1, and it depends on kyua-tester.1.in. template in, real man page out. that's the whole plot 🌈
  • sed ‐e ’s,__PACKAGE__,kyua‐testers,g’ ‐e — first sed pass: swaps __PACKAGE__ for kyua-testers, with the g flag so every match gets it, and -e so we're stacking script expressions. note the curly quote ’ where you'd expect a straight ' — it's styled, ok? 🦋
  • ’s,__TMPDIR__,/tmp,g’ <${.ALLSRC} >${.TARGET}.tmp — second -e expression: swaps __TMPDIR__ for /tmp. input comes from ${.ALLSRC}, output goes to ${.TARGET}.tmp. always a temp file first, we're not animals 🔥
  • mv ${.TARGET}.tmp ${.TARGET} — then mv the temp file onto the real ${.TARGET}. rename it into place, done. slay 💅
⚠️ tiny but real heads-up: the hyphens in kyua‐tester / kyua‐testers and the quotes around those sed expressions are not plain ASCII — they're U+2010 hyphens and ’ curly quotes. if you retype this by hand with regular - and ', you're not reproducing the file. copy, don't retype. 🙈

🌸 THE RECIPE, IN ORDER 🌸

if you're the type who needs the steps spelled out (same info, just sequenced):

  1. run sed on ${.ALLSRC} with two -e expressions — __PACKAGE__ → kyua-testers and __TMPDIR__ → /tmp — writing to ${.TARGET}.tmp
  2. mv ${.TARGET}.tmp ${.TARGET} — move the temp file into place

no more, no less. that's the tea. 🍓


🧚 A LITTLE NOTE ON THE SHAPE 🧚

lowkey the source as given has the CLEANFILES+= bit and the kyua‐tester.1: dependency sitting on the same line, and the sed invocation spilling across a line break that starts mid-quote. I'm not "fixing" any of that — that's exactly how it's written here, and that's how you're getting it. my job is vibes + zero data loss, not reformatting your makefiles 🫶


so yeah bestie — this is the entire MAKEFILE(1) page: a dist dir, a MAN entry, a CLEANFILES append, a dependency on the .in template, two sed substitutions, and an mv. small file, fully committed. periodt. 👑

and that's the wrap 🎀 straight out of the NetBSD tree, revision 1.1, dated 2013/02/19, timestamp 06:04:44, courtesy of jmmv — go give that makefile a little kiss for me, mwah 💖✨

📦 where this page comes from