1 1.33 tv # $NetBSD: bsd.dep.mk,v 1.33 2001/11/02 05:21:49 tv Exp $ 2 1.13 gwr 3 1.33 tv ##### Basic targets 4 1.15 mycroft .PHONY: cleandepend 5 1.32 tv cleandir: cleandepend 6 1.33 tv realdepend: beforedepend .depend afterdepend 7 1.33 tv .ORDER: beforedepend .depend afterdepend 8 1.14 mycroft 9 1.33 tv beforedepend .depend afterdepend: # ensure existence 10 1.33 tv 11 1.33 tv ##### Default values 12 1.14 mycroft MKDEP?= mkdep 13 1.1 mycroft 14 1.33 tv ##### Build rules 15 1.1 mycroft # some of the rules involve .h sources, so remove them from mkdep line 16 1.33 tv 17 1.1 mycroft .if defined(SRCS) 18 1.33 tv .NOPATH: .depend 19 1.20 mycroft .depend: ${SRCS} ${DPSRCS} 20 1.12 christos @rm -f .depend 21 1.12 christos @files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \ 22 1.6 cgd if [ "$$files" != " " ]; then \ 23 1.13 gwr echo ${MKDEP} -a ${MKDEPFLAGS} \ 24 1.29 tron ${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} -traditional-cpp ${AINC:Q} \ 25 1.28 minoura $$files; \ 26 1.13 gwr ${MKDEP} -a ${MKDEPFLAGS} \ 27 1.28 minoura ${AFLAGS:M-[ID]*} ${CPPFLAGS} -traditional-cpp ${AINC} $$files; \ 28 1.5 mycroft fi 29 1.12 christos @files="${.ALLSRC:M*.c}"; \ 30 1.1 mycroft if [ "$$files" != "" ]; then \ 31 1.13 gwr echo ${MKDEP} -a ${MKDEPFLAGS} \ 32 1.25 tv ${CFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \ 33 1.13 gwr ${MKDEP} -a ${MKDEPFLAGS} \ 34 1.13 gwr ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ 35 1.22 tv fi 36 1.22 tv @files="${.ALLSRC:M*.m}"; \ 37 1.23 tv if [ "$$files" != "" ]; then \ 38 1.22 tv echo ${MKDEP} -a ${MKDEPFLAGS} \ 39 1.25 tv ${OBJCFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \ 40 1.22 tv ${MKDEP} -a ${MKDEPFLAGS} \ 41 1.22 tv ${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ 42 1.1 mycroft fi 43 1.12 christos @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \ 44 1.1 mycroft if [ "$$files" != " " ]; then \ 45 1.13 gwr echo ${MKDEP} -a ${MKDEPFLAGS} \ 46 1.25 tv ${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \ 47 1.13 gwr ${MKDEP} -a ${MKDEPFLAGS} \ 48 1.13 gwr ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \ 49 1.1 mycroft fi 50 1.33 tv .endif # defined(SRCS) 51 1.33 tv 52 1.33 tv ##### Clean rules 53 1.19 mycroft cleandepend: 54 1.33 tv .if defined(SRCS) 55 1.27 sommerfe rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND} 56 1.3 mycroft .endif 57 1.2 mycroft 58 1.33 tv ##### Custom rules 59 1.2 mycroft .if !target(tags) 60 1.33 tv tags: ${SRCS} 61 1.4 mycroft .if defined(SRCS) 62 1.2 mycroft -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \ 63 1.2 mycroft sed "s;\${.CURDIR}/;;" > tags 64 1.4 mycroft .endif 65 1.4 mycroft .endif 66