diff options
author | wosch <wosch@FreeBSD.org> | 1996-04-01 18:58:28 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1996-04-01 18:58:28 +0000 |
commit | 56f847b9be0d7632f95d67a6edac957fe3b09090 (patch) | |
tree | cf68c8f43e9c3d50765ff1108da7857492c4ffc0 /share/mk/bsd.dep.mk | |
parent | 1f5b975f613bfbc0cc1cac3902605a3701cda948 (diff) | |
download | FreeBSD-src-56f847b9be0d7632f95d67a6edac957fe3b09090.zip FreeBSD-src-56f847b9be0d7632f95d67a6edac957fe3b09090.tar.gz |
add MKDEPCMD?= and DEPENDFILE?=
replace sh(1) commands with make(1) builtins
Diffstat (limited to 'share/mk/bsd.dep.mk')
-rw-r--r-- | share/mk/bsd.dep.mk | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 9c7afab..9cdc00f 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -1,25 +1,36 @@ -# $Id: bsd.dep.mk,v 1.1 1994/08/04 21:10:07 wollman Exp $ +# $Id: bsd.dep.mk,v 1.5 1996/03/31 20:04:08 wosch Exp $ + +MKDEPCMD?= mkdep +DEPENDFILE?= .depend # some of the rules involve .h sources, so remove them from mkdep line .if !target(depend) -depend: beforedepend .depend afterdepend ${_DEPSUBDIR} +depend: beforedepend ${DEPENDFILE} afterdepend ${_DEPSUBDIR} .if defined(SRCS) -.depend: ${SRCS} - rm -f .depend - files="${.ALLSRC:M*.[sS]}"; \ - if [ "$$files" != "" ]; then \ - mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} $$files; \ - fi - files="${.ALLSRC:M*.c}"; \ - if [ "$$files" != "" ]; then \ - mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \ - fi - files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \ - if [ "$$files" != " " ]; then \ - mkdep -a ${MKDEP} ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} $$files; \ - fi + +# .if defined ${SRCS:M*.[sS]} does not work +__depend_s= ${SRCS:M*.[sS]} +__depend_c= ${SRCS:M*.c} +__depend_cc= ${SRCS:M*.cc} ${SRCS:M*.C} ${SRCS:M*.cxx} + +${DEPENDFILE}: ${SRCS} + rm -f ${DEPENDFILE} +.if defined(__depend_s) && !empty(__depend_s) + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[ID]*} ${AINC} \ + ${.ALLSRC:M*.[sS]} +.endif +.if defined(__depend_c) && !empty(__depend_c) + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} ${CFLAGS:M-[ID]*} \ + ${.ALLSRC:M*.c} +.endif +.if defined(__depend_cc) && !empty(__depend_cc) + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${CXXFLAGS:M-nostd*} ${CXXFLAGS:M-[ID]*} \ + ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx} +.endif + .else -.depend: ${_DEPSUBDIR} +${DEPENDFILE}: ${_DEPSUBDIR} .endif .if !target(beforedepend) beforedepend: @@ -43,5 +54,5 @@ tags: clean: cleandir: cleandepend cleandepend: - rm -f .depend ${.CURDIR}/tags + rm -f ${DEPENDFILE} ${.CURDIR}/tags .endif |