1# $FreeBSD: head/share/mk/bsd.dep.mk 301079 2016-05-31 21:22:19Z bdrewery $
2#
3# The include file <bsd.dep.mk> handles Makefile dependencies.
4#
5#
6# +++ variables +++
7#
8# CLEANDEPENDDIRS Additional directories to remove for the cleandepend
9# target.
--- 77 unchanged lines hidden (view full) ---
87
88.for _S in ${SRCS:N*.[dhly]}
89OBJS_DEPEND_GUESS.${_S:R}.o= ${_S}
90.endfor
91
92# Lexical analyzers
93.for _LSRC in ${SRCS:M*.l:N*/*}
94.for _LC in ${_LSRC:R}.c
95${_LC}: ${_LSRC} ${OP_META}
96 ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC}
97OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC}
98SRCS:= ${SRCS:S/${_LSRC}/${_LC}/}
99CLEANFILES+= ${_LC}
100.endfor
101.endfor
102
103# Yacc grammars
104.for _YSRC in ${SRCS:M*.y:N*/*}
105.for _YC in ${_YSRC:R}.c
106SRCS:= ${SRCS:S/${_YSRC}/${_YC}/}
107CLEANFILES+= ${_YC}
108.if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h)
109.ORDER: ${_YC} y.tab.h
110${_YC}: ${OP_META}
111${_YC} y.tab.h: ${_YSRC}
112 ${YACC} ${YFLAGS} ${.ALLSRC}
113 cp y.tab.c ${_YC}
114CLEANFILES+= y.tab.c y.tab.h
115.elif !empty(YFLAGS:M-d)
116.for _YH in ${_YC:R}.h
117.ORDER: ${_YC} ${_YH}
118${_YC}: ${OP_META}
119${_YC} ${_YH}: ${_YSRC}
120 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
121SRCS+= ${_YH}
122CLEANFILES+= ${_YH}
123.endfor
124.else
125${_YC}: ${_YSRC} ${OP_META}
126 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
127.endif
128OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC}
129.endfor
130.endfor
131
132# DTrace probe definitions
133.if ${SRCS:M*.d}
134CFLAGS+= -I${.OBJDIR}
135.endif
136.for _DSRC in ${SRCS:M*.d:N*/*}
137.for _D in ${_DSRC:R}
138SRCS+= ${_D}.h
139${_D}.h: ${_DSRC} ${OP_META}
140 ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
141SRCS:= ${SRCS:S/^${_DSRC}$//}
142OBJS+= ${_D}.o
143CLEANFILES+= ${_D}.h ${_D}.o
144${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${OP_META}
145 @rm -f ${.TARGET}
146 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
147.if defined(LIB)
148CLEANFILES+= ${_D}.So ${_D}.po
149${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${OP_META}
150 @rm -f ${.TARGET}
151 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
152${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${OP_META}
153 @rm -f ${.TARGET}
154 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
155.endif
156.endfor
157.endfor
158
159
160.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
--- 79 unchanged lines hidden (view full) ---
240
241# Tell bmake not to look for generated files via .PATH
242.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
243
244DPSRCS+= ${SRCS}
245# A .depend file will only be generated if there are commands in
246# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
247# to allow 'make depend' to generate files.
248${DEPENDFILE}: ${DPSRCS} ${OP_META}
249.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
250 rm -f ${DEPENDFILE}
251.endif
252.if target(_EXTRADEPEND)
253_EXTRADEPEND: .USE
254${DEPENDFILE}: _EXTRADEPEND
255.endif
256
--- 47 unchanged lines hidden ---
2#
3# The include file <bsd.dep.mk> handles Makefile dependencies.
4#
5#
6# +++ variables +++
7#
8# CLEANDEPENDDIRS Additional directories to remove for the cleandepend
9# target.
--- 77 unchanged lines hidden (view full) ---
87
88.for _S in ${SRCS:N*.[dhly]}
89OBJS_DEPEND_GUESS.${_S:R}.o= ${_S}
90.endfor
91
92# Lexical analyzers
93.for _LSRC in ${SRCS:M*.l:N*/*}
94.for _LC in ${_LSRC:R}.c
95${_LC}: ${_LSRC} ${OP_META}
96 ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC}
97OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC}
98SRCS:= ${SRCS:S/${_LSRC}/${_LC}/}
99CLEANFILES+= ${_LC}
100.endfor
101.endfor
102
103# Yacc grammars
104.for _YSRC in ${SRCS:M*.y:N*/*}
105.for _YC in ${_YSRC:R}.c
106SRCS:= ${SRCS:S/${_YSRC}/${_YC}/}
107CLEANFILES+= ${_YC}
108.if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h)
109.ORDER: ${_YC} y.tab.h
110${_YC}: ${OP_META}
111${_YC} y.tab.h: ${_YSRC}
112 ${YACC} ${YFLAGS} ${.ALLSRC}
113 cp y.tab.c ${_YC}
114CLEANFILES+= y.tab.c y.tab.h
115.elif !empty(YFLAGS:M-d)
116.for _YH in ${_YC:R}.h
117.ORDER: ${_YC} ${_YH}
118${_YC}: ${OP_META}
119${_YC} ${_YH}: ${_YSRC}
120 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
121SRCS+= ${_YH}
122CLEANFILES+= ${_YH}
123.endfor
124.else
125${_YC}: ${_YSRC} ${OP_META}
126 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
127.endif
128OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC}
129.endfor
130.endfor
131
132# DTrace probe definitions
133.if ${SRCS:M*.d}
134CFLAGS+= -I${.OBJDIR}
135.endif
136.for _DSRC in ${SRCS:M*.d:N*/*}
137.for _D in ${_DSRC:R}
138SRCS+= ${_D}.h
139${_D}.h: ${_DSRC} ${OP_META}
140 ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
141SRCS:= ${SRCS:S/^${_DSRC}$//}
142OBJS+= ${_D}.o
143CLEANFILES+= ${_D}.h ${_D}.o
144${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} ${OP_META}
145 @rm -f ${.TARGET}
146 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
147.if defined(LIB)
148CLEANFILES+= ${_D}.So ${_D}.po
149${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//} ${OP_META}
150 @rm -f ${.TARGET}
151 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
152${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} ${OP_META}
153 @rm -f ${.TARGET}
154 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
155.endif
156.endfor
157.endfor
158
159
160.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
--- 79 unchanged lines hidden (view full) ---
240
241# Tell bmake not to look for generated files via .PATH
242.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
243
244DPSRCS+= ${SRCS}
245# A .depend file will only be generated if there are commands in
246# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
247# to allow 'make depend' to generate files.
248${DEPENDFILE}: ${DPSRCS} ${OP_META}
249.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
250 rm -f ${DEPENDFILE}
251.endif
252.if target(_EXTRADEPEND)
253_EXTRADEPEND: .USE
254${DEPENDFILE}: _EXTRADEPEND
255.endif
256
--- 47 unchanged lines hidden ---