ndc dependency issues & mkdep -p

Michael Handler handler-bind-workers at sub-rosa.com
Tue Jul 13 22:09:53 UTC 1999


Due to makefile dependency issues, ndc wasn't getting rebuilt correctly
when path entries (DESTRUN was the one in question) here were getting
updated in port/<architecture>/Makefile.set, and the .o files weren't
getting recompiled. The problem turned out to be that:

* bin/ndc/pathnames.h didn't have a dependency on ${TOP}/.settings and
	hence wasn't being rebuilt when necessary, and
* the ndc Makefile was using 'mkdep -p', which doesn't generate per-.o
	include dependency rules, just one big one for the binary. This was
	a problem because the regeneration of pathnames.h then caused ndc
	to be relinked, but not ndc.o to be recompiled from ndc.c.

I've attached a patch for bin/ndc/Makefile that addresses these two
issues. In the same patch, there's a modification to bin/named/Makefile
so that dependencies are generated for pathnames.c, and the pathnames
binary is recompiled when necessary. Nothing really uses pathnames,
but consistency is important. :)

Also, by grepping for '^<TAB>mkdep' in a vanilla 8.2.1-REL source tree,
I note that addr, dig, dnskeygen, dnsquery, host, mkservdb, named-xfer,
ndc, and nsupdate all use 'mkdep -p' in 'make depend', but the rest of
the makefiles in the source tree do not. It seems that this would be an
error (human error due to the closeness to and proximity of 'mkdir -p',
perhaps?), and should be changed to 'mkdep' unless the usage of '-p'
in these utilities is deliberate. Given the way it broke the dependency
checking of ndc, I'd think it wasn't.

-- 
handler at sub-rosa.com (Michael Handler)

the complete lack of evidence...
                          ...is the surest sign that the conspiracy is working


-- Attached file included as plaintext by Listar --

Index: bin/named/Makefile
===================================================================
RCS file: /usr/local/cvsroot/dns/bind/bin/named/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- Makefile	1999/07/11 04:47:09	1.1.1.1
+++ Makefile	1999/07/13 21:55:40
@@ -116,7 +116,7 @@
 	rm -f y.tab.h y.tab.c
 
 depend: ${SRCS} pathnames.h
-	mkdep ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${DEFS} ${SRCS}
+	mkdep ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${DEFS} ${SRCS} pathnames.c
 
 ${DESTDIR}${DESTSBIN}:
 	mkdir -p ${DESTDIR}${DESTSBIN}
Index: bin/ndc/Makefile
===================================================================
RCS file: /usr/local/cvsroot/dns/bind/bin/ndc/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- Makefile	1999/07/11 04:47:11	1.1.1.1
+++ Makefile	1999/07/13 21:55:40
@@ -59,7 +59,7 @@
 .c.${O}:
 	${CC} ${CPPFLAGS} ${CFLAGS} ${BOUNDS} -c $*.c
 
-pathnames.h: Makefile ../named/pathtemplate.h
+pathnames.h: ${TOP}/.settings Makefile ../named/pathtemplate.h
 	rm -f pathnames.h
 	sed -e "s|%DESTSBIN%|${DESTSBIN}|" \
 	    -e "s|%DESTEXEC%|${DESTEXEC}|" \
@@ -75,7 +75,7 @@
 	rm -f pathnames.h
 
 depend: ${SRCS} pathnames.h
-	mkdep -p ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
+	mkdep ${CPPFLAGS} -I${INCL} -I${PORTINCL} ${SRCS}
 
 ${DESTDIR}${DESTSBIN}:
 	mkdir -p ${DESTDIR}${DESTSBIN}




More information about the bind-workers mailing list