blob: ef7a24f8a0ee4f7a600bb604c57944b432f142a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# Copyright (c) 2010 by Aleksey Cheusov
# Copyright (c) 1994-2009 The NetBSD Foundation, Inc.
CLEANFILES += .depend ${__DPSRCS.d} ${CLEANDEPEND}
##### Basic targets
depend: .depend
.depend:
##### Default values
MKDEP ?= mkdep
MKDEP_SUFFIXES ?= .o
##### Build rules
# some of the rules involve .h sources, so remove them from mkdep line
.if defined(SRCS)
__DPSRCS.all = ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
${DPSRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
__DPSRCS.d = ${__DPSRCS.all:O:u:M*.d}
__DPSRCS.notd = ${__DPSRCS.all:O:u:N*.d}
.NOPATH: .depend ${__DPSRCS.d}
.if !empty(__DPSRCS.d)
${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
.endif # __DPSRCS.d
.depend: ${__DPSRCS.d}
rm -f .depend
${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
.SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
.c.d:
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${.IMPSRC}
.m.d:
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${.IMPSRC}
.s.d .S.d:
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${.IMPSRC}
.C.d .cc.d .cpp.d .cxx.d:
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
${CPPFLAGS} ${.IMPSRC}
.endif # defined(SRCS)
|