NetBSD/share/mk/bsd.dep.mk

63 lines
1.6 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.dep.mk,v 1.27 1999/08/11 02:00:15 sommerfeld Exp $
.PHONY: cleandepend
cleandir distclean: cleandepend
1997-05-07 00:54:31 +04:00
MKDEP?= mkdep
# some of the rules involve .h sources, so remove them from mkdep line
depend: beforedepend
.if defined(SRCS)
depend: .depend
@true # hack to prevent "make depend" from using implicit rules
.NOPATH: .depend
.depend: ${SRCS} ${DPSRCS}
@rm -f .depend
@files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
1993-12-05 05:42:42 +03:00
if [ "$$files" != " " ]; then \
echo ${MKDEP} -a ${MKDEPFLAGS} \
${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} ${AINC:Q} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${AFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
1993-09-05 21:46:15 +04:00
fi
@files="${.ALLSRC:M*.c}"; \
if [ "$$files" != "" ]; then \
echo ${MKDEP} -a ${MKDEPFLAGS} \
${CFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi
@files="${.ALLSRC:M*.m}"; \
if [ "$$files" != "" ]; then \
echo ${MKDEP} -a ${MKDEPFLAGS} \
${OBJCFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi
@files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
if [ "$$files" != " " ]; then \
echo ${MKDEP} -a ${MKDEPFLAGS} \
${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi
1997-05-09 11:56:00 +04:00
cleandepend:
rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
1997-05-09 11:56:00 +04:00
.else
cleandepend:
.endif
depend: afterdepend
1997-05-09 11:56:00 +04:00
beforedepend:
afterdepend:
.if !target(tags)
.if defined(SRCS)
tags: ${SRCS}
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
sed "s;\${.CURDIR}/;;" > tags
.else
tags:
.endif
.endif