Bugs in the AT&T Toolchest program 'nmake'

Roland McGrath mcgrath at paris.Berkeley.EDU
Sat May 20 12:04:12 AEST 1989


In article <11562 at ulysses.homer.nj.att.com> ekrell at hector.UUCP (Eduardo Krell) writes:

I will try to make my plugs as blatant and tacky as yours, but I'm not sure
I can do it.  (Burners off folks; I'm really a nice person.  I wrote the
sucker for free even.)

   In article <6561 at ardent.UUCP> mac at mrk.ardent.com (Michael McNamara) writes:

   >	I would strongly suggest that you get your money back from
   >AT&T for nmake, and get gnu-make from the Free Software Foundation.

   Why would you want to do that? nmake is much more powerful than
   gnu-make.

What I know of nmake is only the things you have mentioned.
But it seems to me that nmake is, in fact, LESS powerful than GNU Make.

   Of course it doesn't use standard makefiles: they specify too much
   details. nmake makefiles are smaller by an order of magnitude.

GNU Make allows much smaller makefiles too, but can accept old makefiles as
well.

   >	gnu-make is 1) free, 2) can use standard makefiles 3) has the
   >multiple jobs, load average sensitivity and other featues of nmake.

   But can gnu-make prevent you from running simultaneous yacc jobs
   on the same directory? This wouldn't work as yacc uses a fixed file
   name (y.tab.c) which would be overwritten by the multiple yacc's
   (yes, nmake does know about yacc and other tools which can't be run
   in parallel).

Sure.  Write a rule to do it.  It's not hard:

%.c: %.y
	@while test -f $<.lock; do sleep 1; done
	@echo $$$$ > $<.lock
	$(YACC) $(YFLAGS) $<
	mv y.tab.c $@
	@rm -f $<.lock

This is rather inefficient, it's true.  Version 4 of GNU Make will let you
say instead:

%.c: %.y .NONPARALLEL
	$(YACC) $(YFLAGS) $<
	mv y.tab.c $@

Of course, if you use Bison instead of Yacc, you can use:

%.tab.c: %.y
	bison $<

   >	gnu-make also has non standard makefile extentions, but you
   >do not need to use them to get the power of parallel make, which is
   >what I consider to be the main virtue of nmake & gnu-make.

   The parallel jobs facility is not the main virtue of nmake. The main
   virtue of nmake is that it uses a statefile to record what it does
   and it doesn't just rely on time stamps on the files to determine
   whether they need to be recompiled or not. This guarantees that
   all (and only those) files which need to be recompiled will be.

This is nmake's main *selling point*.  Whether such incredible hairiness is
a `virtue' is highly debatable.

   Other big wins:

   * The implicit dependency on #include'd files (which nmake finds
     out on its own).

   * Automatic generation of -I flags for the compiler for each source
     file to look in the right directories where header files are.

These, like the yacc rule, are examples of why GNU Make is, in my opinion,
more powerful.  It doesn't do these things for you, it's true.  But it
provides powerful mechanisms that let you tell it how to do them.  GNU Make
is very flexible; it is not limited to the applications its authors had in
mind.

   * The use of global makefiles with rules tailored to a particular
     environment/project.

This is not very clear, but if I understand what you're talking about, GNU
Make can do that too.

   Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

   UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell at ulysses.att.com

As stated before, GNU Make is ABSOLUTELY FREE, and is almost completely
compatible with 4.3 BSD and System V `make'.  AT&T itself has produced at
least three (and probably more) `make' programs that are completely
incompatible with one another.  GNU Make is compatible with the most widely
used implementations, and provides the features of AT&Ts experimental
versions.
--
	Roland McGrath
	Free Software Foundation, Inc.
roland at ai.mit.edu, uunet!ai.mit.edu!roland
Copyright 1989 Roland McGrath, under the GNU General Public License, version 1.



More information about the Comp.unix.wizards mailing list