From a93ea220fcb3e34cdfdcd4d7a5d391e0b2b4f2ba Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 1 Aug 2003 17:03:41 +0000 Subject: Rework how dependency generation is performed: * DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES. This is a change of behaviour. If a Makefile wants the clean semantics it must specifically append to CLEANFILES. Resolves PR toolchain/5204. * To recap: .d (depend) files are generated for all files in SRCS and DPSRCS that have a suffix of: .c .m .s .S .C .cc .cpp .cxx * If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES * Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS} * Deprecate the (short lived) DEPENDSRCS Update the various Makefiles to these new semantics; generally either adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing specific .o dependencies with DPSRCS entries. Tested with "make -j 8 distribution" and "make distribution". --- gnu/lib/libgcc3/Makefile | 5 ++--- gnu/lib/libobjc/Makefile | 4 ++-- gnu/lib/libobjc3/Makefile | 4 ++-- gnu/usr.bin/binutils/ld/Makefile | 4 ++-- gnu/usr.bin/gcc/backend/Makefile | 5 +++-- gnu/usr.bin/gcc/f771/Makefile | 4 ++-- gnu/usr.bin/gcc3/backend/Makefile | 4 ++-- gnu/usr.bin/gcc3/f771/Makefile | 8 +++++--- gnu/usr.bin/gcc3/frontend/Makefile | 6 +++--- 9 files changed, 23 insertions(+), 21 deletions(-) (limited to 'gnu') diff --git a/gnu/lib/libgcc3/Makefile b/gnu/lib/libgcc3/Makefile index cd3457b2646..206d184e27e 100644 --- a/gnu/lib/libgcc3/Makefile +++ b/gnu/lib/libgcc3/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2003/08/01 13:55:37 mrg Exp $ +# $NetBSD: Makefile,v 1.8 2003/08/01 17:03:43 lukem Exp $ REQUIRETOOLS= yes NOLINT= # defined @@ -28,6 +28,7 @@ LIB2_EH= ${G_LIB2ADDEH:M*.c:T} SRCS+= ${LIB2FUNCS} ${LIB2DIVMOD} ${LIB2_EH} ${G_LIB2ADD:M*.c:T} +DPSRCS+= ${.CURDIR}/${MACHINE_ARCH}.mk tconfig.h CLEANFILES+= ${LIB2FUNCS} tconfig.h ${LIB2FUNCS}: ${.CURDIR}/Makefile @@ -55,8 +56,6 @@ dp-bit.c: ${.CURDIR}/Makefile .include -${OBJS} ${SOBJS} ${POBJS} ${DEPENDSRCS}: ${.CURDIR}/${MACHINE_ARCH}.mk tconfig.h - # XXX /bin/sh tconfig.h: TM_DEFINES="$(G_tm_defines)" \ diff --git a/gnu/lib/libobjc/Makefile b/gnu/lib/libobjc/Makefile index 717abeef2bf..8f06ba1e258 100644 --- a/gnu/lib/libobjc/Makefile +++ b/gnu/lib/libobjc/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.22 2003/06/01 02:08:08 thorpej Exp $ +# $NetBSD: Makefile,v 1.23 2003/08/01 17:03:43 lukem Exp $ REQUIRETOOLS= yes NOLINT= # defined @@ -27,7 +27,7 @@ INCS= ${G_OBJC_H} INCSDIR= /usr/include/objc DPSRCS+= runtime-info.h -CLEANFILES+= rtscratch rtscratch.s +CLEANFILES+= rtscratch rtscratch.s runtime-info.h runtime-info.h: @touch rtscratch `${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@ diff --git a/gnu/lib/libobjc3/Makefile b/gnu/lib/libobjc3/Makefile index ee4640e08a7..5dc3e07cc12 100644 --- a/gnu/lib/libobjc3/Makefile +++ b/gnu/lib/libobjc3/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2003/08/01 13:55:38 mrg Exp $ +# $NetBSD: Makefile,v 1.6 2003/08/01 17:03:43 lukem Exp $ REQUIRETOOLS= yes NOLINT= # defined @@ -41,7 +41,7 @@ INCS= ${G_OBJC_H} INCSDIR= /usr/include/objc DPSRCS+= runtime-info.h -CLEANFILES+= rtscratch rtscratch.s +CLEANFILES+= rtscratch rtscratch.s runtime-info.h runtime-info.h: @touch rtscratch `${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@ diff --git a/gnu/usr.bin/binutils/ld/Makefile b/gnu/usr.bin/binutils/ld/Makefile index 08c552704a7..41ec69fe914 100644 --- a/gnu/usr.bin/binutils/ld/Makefile +++ b/gnu/usr.bin/binutils/ld/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2003/07/28 15:25:04 lukem Exp $ +# $NetBSD: Makefile,v 1.13 2003/08/01 17:03:44 lukem Exp $ .include @@ -46,7 +46,6 @@ stringify.sed: ${G_STRINGIFY} .include ".depend.${f}" .endif -${DEPENDSRCS}: .depend.${f} .depend.${f}: ${f}.sh (srcdir=${DIST}/ld . ${>:M*.sh} && \ if [ x"$$TEMPLATE_NAME" != x ]; then \ @@ -62,6 +61,7 @@ ${DEPENDSRCS}: .depend.${f} echo "e${f}.c: $$temp_name $$script" \ ) >$@ +DPSRCS+= .depend.${f} e${f}.c CLEANFILES+= .depend.${f} e${f}.c e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed diff --git a/gnu/usr.bin/gcc/backend/Makefile b/gnu/usr.bin/gcc/backend/Makefile index b6652821b2a..a9119ae5395 100644 --- a/gnu/usr.bin/gcc/backend/Makefile +++ b/gnu/usr.bin/gcc/backend/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2003/07/28 15:25:04 lukem Exp $ +# $NetBSD: Makefile,v 1.11 2003/08/01 17:03:44 lukem Exp $ NOLINKLIB= # defined NOLINT= # defined @@ -13,6 +13,8 @@ CPPFLAGS+= -I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} \ -DTARGET_NAME=\"${MACHINE_GNU_PLATFORM}\" HOST_CPPFLAGS+= -I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} +DPSRCS+= insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h + .include # Independent generation programs. @@ -41,6 +43,5 @@ insn-${f}: genrtl.h gen${f:R}.c obstack.c ${G_md_file} \ insn-attrtab.c: ${G_HOST_RTLANAL:S/^l-//:.o=.c} insn-attrtab.c insn-extract.c: insn-config.h -${OBJS} ${DEPENDSRCS}: insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h .PATH: ${DIST}/gcc ${DIST}/libiberty ${G_out_file:H} diff --git a/gnu/usr.bin/gcc/f771/Makefile b/gnu/usr.bin/gcc/f771/Makefile index c2e622db185..46c73b3f8b5 100644 --- a/gnu/usr.bin/gcc/f771/Makefile +++ b/gnu/usr.bin/gcc/f771/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2003/07/28 15:25:04 lukem Exp $ +# $NetBSD: Makefile,v 1.6 2003/08/01 17:03:44 lukem Exp $ PROG= f771 SRCS= ${G_F77_OBJS:.o=.c} @@ -8,6 +8,7 @@ HOST_CPPFLAGS+= -I${GCCARCH} -DUSE_HCONFIG= \ ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} .for f in 1t 2t fo io nq op ot +DPSRCS+= str-${f}.h CLEANFILES+= str-${f}.h str-${f}.j .endfor @@ -21,7 +22,6 @@ CLEANFILES+= fini str-${f}.h str-${f}.j: str-${f}.fin fini ./fini ${>:M*.fin} str-${f}.j str-${f}.h -${OBJS} ${DEPENDSRCS}: str-${f}.h .endfor .PATH: ${DIST}/gcc/f diff --git a/gnu/usr.bin/gcc3/backend/Makefile b/gnu/usr.bin/gcc3/backend/Makefile index bb02f36154e..dbe0c0786f2 100644 --- a/gnu/usr.bin/gcc3/backend/Makefile +++ b/gnu/usr.bin/gcc3/backend/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2003/07/29 00:16:46 uwe Exp $ +# $NetBSD: Makefile,v 1.5 2003/08/01 17:03:45 lukem Exp $ NOLINKLIB= # defined NOLINT= # defined @@ -12,6 +12,7 @@ SRCS= ${G_OBJS:.o=.c} ${G_out_file:T} CPPFLAGS+= -I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} \ -DTARGET_NAME=\"${MACHINE_GNU_PLATFORM}\" HOST_CPPFLAGS+= -I. -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} +DPSRCS+= insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h .include @@ -210,6 +211,5 @@ insn-attrtab.c: ${G_HOST_RTLANAL:.o=.c} insn-attrtab.c insn-extract.c: insn-config.h insn-conditions.c: insn-constants.h tm_p.h tm-preds.h toplev.c: options.h -${OBJS} ${DEPENDSRCS}: insn-attr.h insn-codes.h insn-config.h insn-flags.h tree-check.h .PATH: ${DIST}/gcc ${DIST}/libiberty ${G_out_file:H} diff --git a/gnu/usr.bin/gcc3/f771/Makefile b/gnu/usr.bin/gcc3/f771/Makefile index 943d7c619a7..1ad6c36f054 100644 --- a/gnu/usr.bin/gcc3/f771/Makefile +++ b/gnu/usr.bin/gcc3/f771/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2003/07/29 23:35:25 uwe Exp $ +# $NetBSD: Makefile,v 1.4 2003/08/01 17:03:45 lukem Exp $ PROG= f771 SRCS= ${G_F77_OBJS:.o=.c} main.c @@ -7,6 +7,10 @@ CPPFLAGS+= -I${DIST}/gcc/f -I. HOST_CPPFLAGS+= -I${GCCARCH} -DUSE_HCONFIG= \ ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} +.for f in 1t 2t fo io nq op ot +DPSRCS+= str-${f}.h +.endfor + .include "../Makefile.backend" fini: fini.c @@ -18,8 +22,6 @@ CLEANFILES+= str-${f}.h str-${f}.j str-${f}.h str-${f}.j: str-${f}.fin fini ./fini ${>:M*.fin} str-${f}.j str-${f}.h - -${OBJS} ${DEPENDSRCS}: str-${f}.h .endfor CLEANFILES+= main.c diff --git a/gnu/usr.bin/gcc3/frontend/Makefile b/gnu/usr.bin/gcc3/frontend/Makefile index 4489a4ec8b1..584a6cc8ae8 100644 --- a/gnu/usr.bin/gcc3/frontend/Makefile +++ b/gnu/usr.bin/gcc3/frontend/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2003/07/29 23:31:46 uwe Exp $ +# $NetBSD: Makefile,v 1.4 2003/08/01 17:03:46 lukem Exp $ NOLINKLIB= # defined NOLINT= # defined @@ -16,9 +16,9 @@ CPPFLAGS+= -I${.CURDIR} -I${GCCARCH} -I${BACKENDOBJ} -I. \ -DDEFAULT_TARGET_MACHINE=\"${MACHINE_GNU_PLATFORM}\" HOST_CPPFLAGS+= -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} -.include +DPSRCS+= multilib.h specs.h -${OBJS} ${DEPENDSRCS}: multilib.h specs.h +.include .PATH: ${DIST}/gcc -- cgit