mkfs: drop support for zone != block
[minix.git] / share / mk / bsd.dep.mk
blob1a78be680e80ca81a20ee1b64def7044a80ac0f4
1 # $NetBSD: bsd.dep.mk,v 1.68 2008/10/25 22:27:36 apb Exp $
3 ##### Basic targets
4 cleandir: cleandepend
5 realdepend: beforedepend .depend afterdepend
6 .ORDER: beforedepend .depend afterdepend
8 beforedepend .depend afterdepend: # ensure existence
10 ##### Default values
11 MKDEP?= mkdep
12 MKDEP_SUFFIXES?= .o
14 ##### Build rules
15 # some of the rules involve .h sources, so remove them from mkdep line
17 .if defined(SRCS) # {
18 __acpp_flags= ${_TRADITIONAL_CPP}
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}
25 .NOPATH: .depend ${__DPSRCS.d}
27 .if !empty(__DPSRCS.d) # {
28 ${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
29 .endif # }
31 .depend: ${__DPSRCS.d}
32 ${_MKTARGET_CREATE}
33 rm -f .depend
34 ${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
36 .SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
38 .c.d:
39 ${_MKTARGET_CREATE}
40 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
41 ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
42 ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
44 .m.d:
45 ${_MKTARGET_CREATE}
46 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
47 ${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
48 ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
50 .s.d .S.d:
51 ${_MKTARGET_CREATE}
52 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
53 ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
54 ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
56 .C.d .cc.d .cpp.d .cxx.d:
57 ${_MKTARGET_CREATE}
58 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
59 ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
60 ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
61 ${DESTDIR}/usr/include/g++} \
62 ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
64 .endif # defined(SRCS) # }
66 ##### Clean rules
67 cleandepend: .PHONY
68 .if defined(SRCS)
69 rm -f .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
70 .endif
72 ##### Custom rules
73 .if !target(tags)
74 tags: ${SRCS}
75 .if defined(SRCS)
76 -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
77 ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
78 .endif
79 .endif