1# $FreeBSD: head/share/mk/bsd.dep.mk 301284 2016-06-03 19:25:36Z 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}
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} y.tab.h: ${_YSRC}
111 ${YACC} ${YFLAGS} ${.ALLSRC}
112 cp y.tab.c ${_YC}
113CLEANFILES+= y.tab.c y.tab.h
114.elif !empty(YFLAGS:M-d)
115.for _YH in ${_YC:R}.h
116.ORDER: ${_YC} ${_YH}
117${_YC} ${_YH}: ${_YSRC}
118 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
119SRCS+= ${_YH}
120CLEANFILES+= ${_YH}
121.endfor
122.else
123${_YC}: ${_YSRC}
124 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
125.endif
126OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC}
127.endfor
128.endfor
129
130# DTrace probe definitions
131.if ${SRCS:M*.d}
132CFLAGS+= -I${.OBJDIR}
133.endif
134.for _DSRC in ${SRCS:M*.d:N*/*}
135.for _D in ${_DSRC:R}
136SRCS+= ${_D}.h
137${_D}.h: ${_DSRC}
138 ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
139SRCS:= ${SRCS:S/^${_DSRC}$//}
140OBJS+= ${_D}.o
141CLEANFILES+= ${_D}.h ${_D}.o
142${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
143 @rm -f ${.TARGET}
144 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
145.if defined(LIB)
146CLEANFILES+= ${_D}.So ${_D}.po
147${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
148 @rm -f ${.TARGET}
149 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
150${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
151 @rm -f ${.TARGET}
152 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
153.endif
154.endfor
155.endfor
156
157
158.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
--- 79 unchanged lines hidden (view full) ---
238
239# Tell bmake not to look for generated files via .PATH
240.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
241
242DPSRCS+= ${SRCS}
243# A .depend file will only be generated if there are commands in
244# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
245# to allow 'make depend' to generate files.
246${DEPENDFILE}: ${DPSRCS}
247.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
248 rm -f ${DEPENDFILE}
249.endif
250.if target(_EXTRADEPEND)
251_EXTRADEPEND: .USE
252${DEPENDFILE}: _EXTRADEPEND
253.endif
254
--- 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}
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} y.tab.h: ${_YSRC}
111 ${YACC} ${YFLAGS} ${.ALLSRC}
112 cp y.tab.c ${_YC}
113CLEANFILES+= y.tab.c y.tab.h
114.elif !empty(YFLAGS:M-d)
115.for _YH in ${_YC:R}.h
116.ORDER: ${_YC} ${_YH}
117${_YC} ${_YH}: ${_YSRC}
118 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
119SRCS+= ${_YH}
120CLEANFILES+= ${_YH}
121.endfor
122.else
123${_YC}: ${_YSRC}
124 ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC}
125.endif
126OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC}
127.endfor
128.endfor
129
130# DTrace probe definitions
131.if ${SRCS:M*.d}
132CFLAGS+= -I${.OBJDIR}
133.endif
134.for _DSRC in ${SRCS:M*.d:N*/*}
135.for _D in ${_DSRC:R}
136SRCS+= ${_D}.h
137${_D}.h: ${_DSRC}
138 ${DTRACE} ${DTRACEFLAGS} -h -s ${.ALLSRC}
139SRCS:= ${SRCS:S/^${_DSRC}$//}
140OBJS+= ${_D}.o
141CLEANFILES+= ${_D}.h ${_D}.o
142${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
143 @rm -f ${.TARGET}
144 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
145.if defined(LIB)
146CLEANFILES+= ${_D}.So ${_D}.po
147${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
148 @rm -f ${.TARGET}
149 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
150${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
151 @rm -f ${.TARGET}
152 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
153.endif
154.endfor
155.endfor
156
157
158.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
--- 79 unchanged lines hidden (view full) ---
238
239# Tell bmake not to look for generated files via .PATH
240.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
241
242DPSRCS+= ${SRCS}
243# A .depend file will only be generated if there are commands in
244# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
245# to allow 'make depend' to generate files.
246${DEPENDFILE}: ${DPSRCS}
247.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
248 rm -f ${DEPENDFILE}
249.endif
250.if target(_EXTRADEPEND)
251_EXTRADEPEND: .USE
252${DEPENDFILE}: _EXTRADEPEND
253.endif
254
--- 47 unchanged lines hidden ---