1 1.53 lukem # $NetBSD: bsd.dep.mk,v 1.53 2003/07/31 13:47:32 lukem 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.53 lukem .if defined(SRCS) # { 18 1.35 thorpej __acpp_flags= -traditional-cpp 19 1.48 lukem 20 1.49 lukem DEPENDSRCS.src= ${SRCS:M*.c} ${DPSRCS:M*.c} \ 21 1.49 lukem ${SRCS:M*.m} ${DPSRCS:M*.m} \ 22 1.49 lukem ${SRCS:M*.[sS]} ${DPSRCS:M*.[sS]} \ 23 1.49 lukem ${SRCS:M*.C} ${DPSRCS:M*.C} \ 24 1.49 lukem ${SRCS:M*.cc} ${DPSRCS:M*.cc} \ 25 1.49 lukem ${SRCS:M*.cpp} ${DPSRCS:M*.cpp} \ 26 1.49 lukem ${SRCS:M*.cxx} ${DPSRCS:M*.cxx} 27 1.53 lukem DEPENDSRCS.d= ${DEPENDSRCS.src:R:S/$/.d/g} 28 1.53 lukem DEPENDSRCS= .depend ${DEPENDSRCS.d} 29 1.48 lukem 30 1.53 lukem ${DEPENDSRCS.d}: ${SRCS} ${DPSRCS} 31 1.53 lukem 32 1.53 lukem .depend: ${DEPENDSRCS.d} 33 1.39 christos @rm -f .depend 34 1.53 lukem cat ${DEPENDSRCS.d} > .depend 35 1.52 lukem 36 1.52 lukem .NOPATH: ${DEPENDSRCS} 37 1.39 christos 38 1.51 lukem .SUFFIXES: .d .c .m .s .S .C .cc .cpp .cxx 39 1.49 lukem 40 1.51 lukem .c.d: 41 1.51 lukem ${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${CFLAGS:M-[ID]*} ${CPPFLAGS} \ 42 1.49 lukem ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 43 1.39 christos 44 1.51 lukem .m.d: 45 1.51 lukem ${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${OBJCFLAGS:M-[ID]*} \ 46 1.49 lukem ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 47 1.39 christos 48 1.51 lukem .s.d .S.d: 49 1.51 lukem ${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${AFLAGS:M-[ID]*} ${CPPFLAGS} \ 50 1.49 lukem ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${AINC} ${.IMPSRC} 51 1.39 christos 52 1.51 lukem .C.d .cc.d .cpp.d .cxx.d: 53 1.51 lukem ${MKDEP} -f ${.TARGET} ${MKDEPFLAGS} ${CXXFLAGS:M-[ID]*} \ 54 1.47 mrg ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \ 55 1.48 lukem ${DESTDIR}/usr/include/g++} \ 56 1.49 lukem ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 57 1.39 christos 58 1.53 lukem .endif # defined(SRCS) # } 59 1.33 tv 60 1.33 tv ##### Clean rules 61 1.19 mycroft cleandepend: 62 1.33 tv .if defined(SRCS) 63 1.49 lukem rm -f ${DEPENDSRCS} ${.CURDIR}/tags ${CLEANDEPEND} 64 1.3 mycroft .endif 65 1.2 mycroft 66 1.33 tv ##### Custom rules 67 1.2 mycroft .if !target(tags) 68 1.33 tv tags: ${SRCS} 69 1.4 mycroft .if defined(SRCS) 70 1.2 mycroft -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \ 71 1.2 mycroft sed "s;\${.CURDIR}/;;" > tags 72 1.4 mycroft .endif 73 1.4 mycroft .endif 74