make

Leo de Wit leo at philmds.UUCP
Fri Jun 17 21:16:31 AEST 1988


In article <16104 at brl-adm.ARPA> PAAAAAR%CALSTATE.BITNET at cunyvm.cuny.edu writes:
>I have been having a long battle with the 'make' on our 2.9BSD PDP Unix
>The documentation is dated August 1978 and most of the files haven't changed
>since 1982. The Makefile is full of commands look as if the predate UNIX as
>we know it today...
>
>Qn 1.  Can anyone describe the later versions of 'make'

See the man pages. Too much to insert here. If you want copies please mail.

>Qn 2.  Has anyone come up with a better way to do it?

The Sys5 make is more elaborate; the Sun make also knows of header dependencies
but still I think the standard make is quite adequate.

>Qn 3.  What I need to do is keep between 10 and 20 nrofd'ed files uptodate.
   [stuff deleted...]

   I think your problem isn't that hard, but you shouldn't try to solve it
using make only. You have hinted to use sed yourself. What about this one:

1) Call your nroff files something like xxxxx.nrf, i.e. give them an extension.
And also for the formatted files, e.g. xxxxx.txt.
Now put in your makefile the following lines:

.SUFFIXES: .txt .nrf

.nrf.txt:
	nroff -ms $< >$@; chmod 664 $@
	rm -f /usr/class/$@; ln $@ /usr/class/$@

Now if you say: make week20.txt and it is not up to date, it will be made
(note the somewhat clumsy ln is needed because make expects files to reside
in the same directory for the suffix rules. You could also put the .nrf files
in the /usr/class directory).

But I assume you want to let make decide even what targets to be made?
Even this is possible: Have a first entry all in the makefile:

all:
	$(MAKE) dummy `ls *.nrf|sed 's/\.nrf/.txt/'`

dummy:

The dummy entry is needed to avoid problems when there are no .nrf files
(see for yourself what happens if you omit it!).
Hope this solves your problem - like to hear about it.

>Dick Botting
>PAAAAAR at CCS.CSUSCC.CALSTATE(doc-dick)
>paaaaar at calstate.bitnet
>PAAAAAR%CALSTATE.BITNET@{depends on the phase of the moon}.EDU
>Dept Comp Sci., CSUSB, 5500 State Univ Pkway, San Bernardino CA 92407
>Disclaimer: I am an only an egg

egg: chicken
	lay <$? >$@

chicken: egg
	brood <$? >$@

$ make egg

Make:$! nulled; predecessor circle.

Even make doesn't know which one was older 8-).

	Leo.



More information about the Comp.unix.questions mailing list