NLnetLabs / nsd

The NLnet Labs Name Server Daemon (NSD) is an authoritative, RFC compliant DNS nameserver.

Home Page:https://nlnetlabs.nl/nsd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minor recursive Makefile issue

k0ekk0ek opened this issue · comments

A minor issue was kindly reported for the Makefile.

Invoking make clean all cutest install in nsd fails in the clean target, because all the targets are passed to simdzone which lacks a cutest target.

The patch suggests avoiding the problem by using more specific make invocations for just the targets that need it, i.e. clean and distclean. Use $(MAKE) instead of bare make for recursion.

Makefile.in | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 0c5ca678..8d8e185a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -30,9 +30,6 @@ user = @user@
 DNSTAP_SRC=@DNSTAP_SRC@
 DNSTAP_OBJ=@DNSTAP_OBJ@

-# GNU Make provides MAKECMDGOALS, BSD Make provides .TARGETS
-MAKECMDGOALS ?= $(.TARGETS)
-
 # override $U variable which is used by autotools for deansification (for
 # K&R C compilers), but causes problems if $U is defined in the env).
 U=
@@ -208,10 +205,11 @@ audit: nsd nsd-checkconf nsd-checkzone nsd-control nsd-mem checksec

 clean:
 	rm -f *.o $(TARGETS) $(MANUALS) cutest popen3_echo xfr-inspect nsd-mem
-	make -C simdzone $(MAKECMDGOALS)
+	$(MAKE) -C simdzone clean

 distclean: clean
 	rm -f Makefile config.h config.log config.status dnstap/dnstap_config.h
+	$(MAKE) -C simdzone distclean

 realclean: distclean
 	rm -rf autom4te*

The solution won't quite work because distclean removes the Makefile and so it'll be gone for the realclean target. The problem can be fixed at a later time.