NetBSD/share/mk/bsd.dep.mk

71 lines
1.9 KiB
Makefile
Raw Normal View History

# $NetBSD: bsd.dep.mk,v 1.37 2002/11/10 21:26:45 thorpej Exp $
##### Basic targets
.PHONY: cleandepend
cleandir: cleandepend
realdepend: beforedepend .depend afterdepend
.ORDER: beforedepend .depend afterdepend
1997-05-07 00:54:31 +04:00
beforedepend .depend afterdepend: # ensure existence
##### Default values
1997-05-07 00:54:31 +04:00
MKDEP?= mkdep
##### Build rules
# some of the rules involve .h sources, so remove them from mkdep line
.if defined(SRCS)
.if defined(HAVE_GCC3)
__acpp_flags=
.else
__acpp_flags= -traditional-cpp
.endif
.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} ${__acpp_flags} ${AINC:Q} \
$$files; \
${MKDEP} -a ${MKDEPFLAGS} \
${AFLAGS:M-[ID]*} ${CPPFLAGS} ${__acpp_flags} ${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]*} ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include/g++} ${CPPFLAGS} $$files; \
fi
.endif # defined(SRCS)
##### Clean rules
1997-05-09 11:56:00 +04:00
cleandepend:
.if defined(SRCS)
rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
.endif
##### Custom rules
.if !target(tags)
tags: ${SRCS}
.if defined(SRCS)
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
sed "s;\${.CURDIR}/;;" > tags
.endif
.endif