NetBSD/share/mk/bsd.dep.mk

60 lines
1.4 KiB
Makefile
Raw Normal View History

1997-05-07 00:54:31 +04:00
# $NetBSD: bsd.dep.mk,v 1.14 1997/05/06 20:54:31 mycroft Exp $
1997-05-07 00:54:31 +04:00
.PHONY: beforedepend afterdepend cleandepend
MKDEP?= mkdep
# some of the rules involve .h sources, so remove them from mkdep line
.if !target(depend)
1994-06-30 09:21:28 +04:00
depend: beforedepend .depend _SUBDIRUSE afterdepend
.if defined(SRCS)
.depend: ${SRCS}
@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} \
${CFLAGS:M-[ID]*} ${CPPFLAGS} ${AINC} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${CFLAGS: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]*} ${CPPFLAGS} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${CFLAGS: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]*} ${CPPFLAGS} $$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
fi
.else
.depend:
.endif
.if !target(beforedepend)
beforedepend:
.endif
.if !target(afterdepend)
afterdepend:
.endif
.endif
.if !target(tags)
.if defined(SRCS)
1994-06-30 09:21:28 +04:00
tags: ${SRCS} _SUBDIRUSE
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
sed "s;\${.CURDIR}/;;" > tags
.else
tags:
.endif
.endif
.if defined(SRCS)
cleandir: cleandepend
cleandepend:
rm -f .depend ${.CURDIR}/tags
.endif