From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: 'make' woes (won't catch secondary dependancy)
Organization: Computer Science, University of Melbourne, Australia
Date: Wed, 14 Oct 1992 14:04:30 GMT

throopw@sheol.UUCP (Wayne Throop) writes:

>Actually, this discussion is drifting further and further away from
>relevance to C as a language, but I'm not sure I know of a better
>place to put it.  The groups that spring to mind, comp.programming
>and comp.software-eng, both seem not to fit much better.  With that
>meta-comment, on with discussing automated construction, and if
>anybody knows a good newsgroup for this, let me know.
[... lots elided ... ]

>I've been playing with make replacements that can do most of these
>things.  The problem is, I haven't made them syntactically backwards
>compatible with make, because the concepts really don't fit very well.
>That's one reason I don't use dmake or gnumake or other extended
>makes.  I am prejudiced into thinking that they are being extended
>in the "wrong direction" in some vague, fundamental sense.
>
>That is, to paraphrase Ross Perot, we know what the problems with
>make are, and it doesn't need just a little tune-up, it needs
>a major overhaul.
[...]
>People haven't shown too much interest in extending
>make in the directions I've been playing with.  Maybe I've just been
>talking to the wrong people. 

I have in front of me a paper by Zoltan Somogyi (zs@mulga.cs.mu.oz.au)
entitled "Cake: a Fifth Generation Version of make". Here is a rough
summary including quite a few direct quotes from the paper.

| Make has three principal problems. These are:
| 1. It supports only suffix-based rules.
	This is a real pain. Many versions of make have a special hack
	just for SCCS files to get around this problem.
	Attempting to put files in different directories is also
	really painful.

	Cake allows very flexible rules, using '%' (or '%1', '%2', ...)
	as template variables:
		obj/%.o : src/%.c
			cc -o obj/%.o -c src/%.c
	You can also have multiple targets and multiple sources in template
	rules, eg.
		%.c %.h : %.y
			bison -d %.y

		%.test_results : % %.test_data
			% < %.test_data > %.test_results

| 2. It's search algorithm is not flexible enough.
	In particular, it doesn't pick up transitive closure rules
	unless they are explicitly listed; for example, if there is
	a .y.c rule and a .c.o rule, you still need a .y.o rule.

|	Half the standard make's built-in rules are transitive ones.

	The number of rules required expands dramatically if there
	are more stages in the building process, so make is not
	practical for say text processing using nroff/troff, lbl,
	bib, pic, tbl, and eqn, a six-stage process which would
	theoretically require 6! = 720 different rules.

| 3. It has no provisison for the sharing of new make rules.

	Cake uses the C preprocessor and allows #includes.
	A standard Cake file might look like

|	#define MAIN	prog
|	#define FILES	prog aux1 aux2 parser
|	#define HDR	def
|	#include <Yacc>
|	#include <C>
|	#include <Main>

Cake allows dynamic dependencies:
	%.o:	%.c [[ccincl %.c]]
		cc -c %.c
Here cake will run the command "ccincl foo.c", and use the output of
this command as part of the dependancy list.

Cake also allows conditional rules:
	%: archive	if % in [[ar t archive]]
		ar x archive %
This rule will allow files to be stored in an archive and extracted 
if necessary.

Cake was posted to comp.sources.unix in October 1987.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Xref: sparky comp.lang.c:14833 comp.lang.misc:3234 comp.programming:2876