[TUHS] remaking make (Re: Another "craft" discussion topic - mindless tool proliferation

Bakul Shah bakul at bitblocks.com
Sat Sep 23 06:09:50 AEST 2017


On Thu, 21 Sep 2017 18:08:05 -0700 Larry McVoy <lm at mcvoy.com> wrote:
> 
> 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.

Google's bazel seems to have a good model and abstraction
facility.  For example, to build a C++ binary from
{foo,main}.cc you can use

cc_binary(
	name = "foo",
	srcs = ["foo.cc", "main.cc"],
	hdrs = ["foo.h"],
)

The cc_binary macro encapsulates the common pattern for
building c++ binaries, and allows you to specify just the
essential (and optional) parameters.  You can also define your
own rules (and this is how they are adding go support).

Its implementation seems to rather heavy weight (its binary
installer (without jdk8) for Macs is 111MB) and there are a
number of other isses so I wouldn't want to use it but it is
good for mining ideas.  Building something much simpler that
serves the needs of most projects should be possible.  May
even be worth experimenting using an s-expression syntax.
Then the above example becomes

(cc-binary 'foo
  (srcs '(foo.cc main.cc))
  (hdrs '(foo.h)))

Shorter and much less clutter!  Ideally the program should
have just have meta rule built-in and everything else can be
bootstrapped but it may be advantageous to "precompile" some
rules....




More information about the TUHS mailing list