diff options
| author | lukem <lukem@NetBSD.org> | 2003-08-01 17:03:41 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 2003-08-01 17:03:41 +0000 |
| commit | a93ea220fcb3e34cdfdcd4d7a5d391e0b2b4f2ba (patch) | |
| tree | c9adfc000f1b3f310cf2f812f02823dbff7766ca /share/mk/bsd.hostlib.mk | |
| parent | 5aa077f5cfe13c86bb3596f0e709337147ffc49c (diff) | |
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".
Diffstat (limited to 'share/mk/bsd.hostlib.mk')
| -rw-r--r-- | share/mk/bsd.hostlib.mk | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/share/mk/bsd.hostlib.mk b/share/mk/bsd.hostlib.mk index e2136c1eaaa..d9a856159ff 100644 --- a/share/mk/bsd.hostlib.mk +++ b/share/mk/bsd.hostlib.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.hostlib.mk,v 1.6 2003/07/31 13:47:32 lukem Exp $ +# $NetBSD: bsd.hostlib.mk,v 1.7 2003/08/01 17:04:01 lukem Exp $ .include <bsd.init.mk> .include <bsd.sys.mk> @@ -21,7 +21,8 @@ OBJHOSTMACHINE= # set ##### Build rules .if defined(HOSTLIB) DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c} -CLEANFILES+= ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}} +CLEANFILES+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c} +CLEANFILES+= ${YHEADER:D${SRCS:M*.y:.y=.h}} .endif # defined(HOSTLIB) .if !empty(SRCS:N*.h:N*.sh) @@ -31,7 +32,9 @@ OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g} .if defined(OBJS) && !empty(OBJS) .NOPATH: ${OBJS} ${HOSTPROG} ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}} -lib${HOSTLIB}.a: ${DPSRCS} ${OBJS} ${DPADD} +${OBJS}: ${DPSRCS} + +lib${HOSTLIB}.a: ${OBJS} ${DPADD} -rm -f ${.TARGET} ${HOST_AR} cq ${.TARGET} ${OBJS} @${HOST_RANLIB} ${.TARGET} |
