On Sat, 11 Jan 2020 10:54:02 +0100 nisse@lysator.liu.se (Niels Möller) wrote:
Hi,
it's been pointed out to me that GNU make documentation of old-fashioned suffix rules say
: Suffix rules cannot have any prerequisites of their own. If they : have any, they are treated as normal files with funny names, not as : suffix rules. Thus, the rule: : : .c.o: foo.h : $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< : : tells how to make the file '.c.o' from the prerequisite file 'foo.h',
OpenBSD make(1) agrees that a suffix rule has "no prerequisites", but doesn't enforce this. The above rule, in OpenBSD make, is a suffix rule:
$ make file.o `file.o' is up to date. $ touch foo.h $ make file.o cc -c -O2 -pipe -o file.o file.c $ make .c.o make: don't know how to make .c.o Stop in /tmp/proj
https://man.openbsd.org/make#INFERENCE_RULES says,
: A complete inference rule is a dependency line with such a target, : the normal dependency operator, no prerequisites and a list of shell : commands.
Over in NetBSD, https://netbsd.gw.com/cgi-bin/man-cgi?make seems not to mention whether a suffix rule can have prerequisites.
...
To change this to a %-pattern rule, I wonder: Should we just drop support for non-GNU make programs?
Requiring GNU make makes a few things easier: We can use %-patterns everywhere. We can use -include unconditionally for dep-files, dropping the @DEP_INCLUDE@ variable and the dummy-dep-files configure step. We can most likely also drop all logic for the testsuite/.test-rules.make file.
I often install GNU make on OpenBSD, because I build software that uses %-patterns, $(shell ...) calls, or GNU-style ifdef/endif in Makefiles. BSD make already has -include.
Current status of make compatibility is that it's supposed to work with Solaris make (but likely not tested for a long time), and it should kind-of work with BSD make, provided one configures with --disable-dependency-tracking.
I don't know if BSD make can build Nettle; I used GNU make.
The BSDs appear to use GNU make to build their Nettle packages. In OpenBSD ports/security/libnettle [1], the line "USE_GMAKE= Yes" uses GNU make. FreeBSD [2] and NetBSD [3] appear to also use gmake. It is as if Nettle already requires GNU make.
I wonder if we can find anyone who doesn't use GNU make for Nettle.
--George
[1] https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/security/libnettle/Makefile?... [2] https://svnweb.freebsd.org/ports/head/security/nettle/Makefile?revision=5122... [3] http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/security/nettle/Makefile?rev=1.22...