Make:defining macros with filenames that have '$' in them

Guy Harris guy at auspex.auspex.com
Tue Feb 27 06:15:28 AEST 1990


>I might indeed discover, as a result of this note, that
>the sources are primarily free BSD and I can look at that (though I
>likely won't really care).

No, you won't discover that.

1) Sun "make" hasn't been a BSD "make" since SunOS 3.0; it became
   S5-based in 3.0. (Yes, 3.0, not 3.2.  It was not done as part of an
   S5 compatibility push; it was done because the S5 "make" was newer
   and more powerful.)

>I have no idea what Sun changed around from BSD sources.)

2) Sun "make" hasn't been an S5 "make" since SunOS 4.0 - or earlier, if
   you installed the "SunPro 'make'".  The comments on the SCCS ID lines
   say "remotely from S5" - strong emphasis on the "remotely".

3) The old S5-based "make" is in "/usr/old/make" in SunOS 4.x.  When run
   on your Makefile, it reports:

Make:  Don't know how to make whonk..  Stop.

4) If you compile the BSD "make", and run it, under SunOS 4.0.3, it says

	cat whonk.$
	This is a stupid filename.

5) If you compile the S5 "make" (temporarily taking out the code for
   handling archives, which has to change for SunOS and which doesn't
   come into play here), and run it, it does exactly what
   "/usr/old/make" does.

So the answer is that somebody at AT&T changed "make" so that it doesn't
work under the System V "make"; the changes to the Sun "make" also cause
it to fail, although for different reasons.

Now, to add some more amusement, we rename "whonk.$" to "whonk.$x", and
change the Makefile to:

	whonk: whonk.$$x
		cat whonk.$$x

and then try the various flavors of "make" on that:

	auspex% bsdmake/make		# BSD "make"
	cat whonk.$x
	whonk.: No such file or directory
	*** Exit 1
	
	Stop.
	auspex% s5make/make		# S5R3 "make"
	Make:  Don't know how to make whonk..  Stop.
	auspex% /usr/old/make		# Old S5R2-based SunOS "make"
	Make:  Don't know how to make whonk..  Stop.
	auspex% make			# New SunOS 4.x "SunPro 'make'"
	make: Fatal error: Don't know how to make target `whonk.'

Changing it to:

	whonk: whonk.$$x
		cat whonk.\$$x

at least gets the BSD "make" to hand the right command to the shell:

	auspex% bsdmake/make
	cat whonk.\$x
	This is a stupid filename.

but still doesn't change the behavior of the S5 "make".

No, I haven't investigated further; no, I have no plans to.



More information about the Comp.unix.wizards mailing list