Annotation of src/share/mk/bsd.dep.mk, Revision 1.72
1.72 ! joerg 1: # $NetBSD: bsd.dep.mk,v 1.71 2011/02/06 00:52:49 joerg Exp $
1.13 gwr 2:
1.33 tv 3: ##### Basic targets
1.32 tv 4: cleandir: cleandepend
1.33 tv 5: realdepend: beforedepend .depend afterdepend
6: .ORDER: beforedepend .depend afterdepend
1.14 mycroft 7:
1.33 tv 8: beforedepend .depend afterdepend: # ensure existence
9:
10: ##### Default values
1.63 dsl 11: MKDEP?= mkdep
12: MKDEP_SUFFIXES?= .o
1.1 mycroft 13:
1.33 tv 14: ##### Build rules
1.1 mycroft 15: # some of the rules involve .h sources, so remove them from mkdep line
1.33 tv 16:
1.53 lukem 17: .if defined(SRCS) # {
1.70 joerg 18: __acpp_flags= ${_ASM_TRADITIONAL_CPP}
1.48 lukem 19:
1.55 lukem 20: __DPSRCS.all= ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
21: ${DPSRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
22: __DPSRCS.d= ${__DPSRCS.all:O:u:M*.d}
23: __DPSRCS.notd= ${__DPSRCS.all:O:u:N*.d}
1.48 lukem 24:
1.55 lukem 25: .NOPATH: .depend ${__DPSRCS.d}
1.53 lukem 26:
1.56 martin 27: .if !empty(__DPSRCS.d) # {
1.55 lukem 28: ${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
1.56 martin 29: .endif # }
1.55 lukem 30:
31: .depend: ${__DPSRCS.d}
1.60 lukem 32: ${_MKTARGET_CREATE}
1.58 lukem 33: rm -f .depend
1.63 dsl 34: ${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
1.39 christos 35:
1.57 lukem 36: .SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
1.49 lukem 37:
1.51 lukem 38: .c.d:
1.60 lukem 39: ${_MKTARGET_CREATE}
1.65 lukem 40: ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
41: ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
42: ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.39 christos 43:
1.51 lukem 44: .m.d:
1.60 lukem 45: ${_MKTARGET_CREATE}
1.65 lukem 46: ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
47: ${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
1.49 lukem 48: ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.39 christos 49:
1.51 lukem 50: .s.d .S.d:
1.60 lukem 51: ${_MKTARGET_CREATE}
1.65 lukem 52: ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
53: ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
1.67 lukem 54: ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
1.39 christos 55:
1.51 lukem 56: .C.d .cc.d .cpp.d .cxx.d:
1.60 lukem 57: ${_MKTARGET_CREATE}
1.65 lukem 58: ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
59: ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
1.49 lukem 60: ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.39 christos 61:
1.53 lukem 62: .endif # defined(SRCS) # }
1.33 tv 63:
64: ##### Clean rules
1.66 lukem 65: cleandepend: .PHONY
1.33 tv 66: .if defined(SRCS)
1.55 lukem 67: rm -f .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
1.3 mycroft 68: .endif
1.2 mycroft 69:
1.33 tv 70: ##### Custom rules
1.2 mycroft 71: .if !target(tags)
1.33 tv 72: tags: ${SRCS}
1.4 mycroft 73: .if defined(SRCS)
1.69 christos 74: -cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
1.68 apb 75: ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
1.4 mycroft 76: .endif
77: .endif
CVSweb <webmaster@jp.NetBSD.org>