[TUHS] Another "make-raking" discussion topic

Norman Wilson norman at oclsc.org
Sun Sep 24 01:53:55 AEST 2017

Lyndon Nerenberg:

  I really like mk.  8ed was where it first rolled out?  I remember
  reading about it in the 10ed books.  It's a joy to use in Plan 9.


Later than that.  I was around when Andrew wrote mk, so it
definitely post-dated the 8/e manual.

mk does a number of things better, but to my mind not quite
enough to justify carrying it around.  Just as I decided long
ago (once I'd come out of the ivory hothouse of Murray Hill)
that I was best off writing programs that hewed to the ISO C
and POSIX interfaces (and later put some work into bringing
my private copy of post-V10 nearer to the standards), because
that way I didn't have to think much about porting; so I
decided eventually that it is better just to use make.

As with any other language, of course, it's best to use it
in as simple a way as possible.  So I don't care much whether
it's gmake or pmake or qmake as long as it implements more
or less the 7/e core subset without breaking anything.

Larry McVoy:

  I do wish that some simple make had stuffed a scripting language in there.
  Anything, tcl, lua, even (horrors, can't believe I'm saying this) a little
  lisp.  Or ideally a built in shell compat language.  All those backslashes
  to make shell scripts work get old.


This is something mk got right, and it's actually very simple to do:
every recipe is a shell script.  Not a collection of lines handed
one by one to the shell, but a block of text.  No backslashes (or
extra semicolons) required for tests.  Each script is run with sh -e,
so by default one failed command will abort the rest, which is
usually what one wants; but if you don't want that you just insert
	set +e

(So it's not that I dislike mk.  Were it available as an easy
add-on package on all modern systems, rather than something I'd
have to carry around and compile, I'd be happy to use it.)

Norman Wilson
Toronto ON

More information about the TUHS mailing list