Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor recursive Makefile issue #335

Open
k0ekk0ek opened this issue Jun 12, 2024 · 0 comments
Open

Minor recursive Makefile issue #335

k0ekk0ek opened this issue Jun 12, 2024 · 0 comments

Comments

@k0ekk0ek
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant