bsd.dep.mk (c155decc4b97029685dc39514f5e0e1aa33bf817) bsd.dep.mk (799483e49ea9412cd4d87a33a024bc3ab3f21e9d)
1# $FreeBSD$
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

--- 58 unchanged lines hidden (view full) ---

67 @cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR}
68.endif
69.else
70 @${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
71 ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
72.endif
73.endif
74
1# $FreeBSD$
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

--- 58 unchanged lines hidden (view full) ---

67 @cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR}
68.endif
69.else
70 @${CTAGS} ${CTAGSFLAGS} -f /dev/stdout \
71 ${.ALLSRC:N*.h} | sed "s;${.CURDIR}/;;" > ${.TARGET}
72.endif
73.endif
74
75.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
76_meta_filemon= 1
77.endif
78
75# Skip reading .depend when not needed to speed up tree-walks
76# and simple lookups.
79# Skip reading .depend when not needed to speed up tree-walks
80# and simple lookups.
81# Also skip generating or including .depend.* files if in meta+filemon mode
82# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used.
77.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
83.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
78 make(install*) || make(analyze)
84 make(install*) || make(analyze) || defined(_meta_filemon)
79_SKIP_READ_DEPEND= 1
80.if ${MK_DIRDEPS_BUILD} == "no"
81.MAKE.DEPENDFILE= /dev/null
82.endif
83.endif
84
85.if defined(SRCS)
86CLEANFILES?=

--- 65 unchanged lines hidden (view full) ---

152${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
153 @rm -f ${.TARGET}
154 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
155.endif
156.endfor
157.endfor
158
159
85_SKIP_READ_DEPEND= 1
86.if ${MK_DIRDEPS_BUILD} == "no"
87.MAKE.DEPENDFILE= /dev/null
88.endif
89.endif
90
91.if defined(SRCS)
92CLEANFILES?=

--- 65 unchanged lines hidden (view full) ---

158${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
159 @rm -f ${.TARGET}
160 ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
161.endif
162.endfor
163.endfor
164
165
160.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
161_meta_filemon= 1
162.endif
163.if ${MAKE_VERSION} < 20160220
164DEPEND_MP?= -MP
165.endif
166# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
167# avoid collisions.
168DEPEND_FILTER= C,/,_,g
169DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
170.if !empty(DEPENDSRCS)
171DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
172.endif
173DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
174DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
175DEPEND_CFLAGS+= -MT${.TARGET}
166.if ${MAKE_VERSION} < 20160220
167DEPEND_MP?= -MP
168.endif
169# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
170# avoid collisions.
171DEPEND_FILTER= C,/,_,g
172DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
173.if !empty(DEPENDSRCS)
174DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
175.endif
176DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
177DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
178DEPEND_CFLAGS+= -MT${.TARGET}
176# Skip generating or including .depend.* files if in meta+filemon mode since
177# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though.
178.if !defined(_meta_filemon)
179.if defined(.PARSEDIR)
180# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
181# as those are the only ones we will include.
182DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}}" != ""
183CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
184.else
185CFLAGS+= ${DEPEND_CFLAGS}

--- 10 unchanged lines hidden (view full) ---

196.endif # !defined(_meta_filemon)
197.endif # defined(SRCS)
198
199.if ${MK_DIRDEPS_BUILD} == "yes"
200# Prevent meta.autodep.mk from tracking "local dependencies".
201.depend:
202.include <meta.autodep.mk>
203# If using filemon then _EXTRADEPEND is skipped since it is not needed.
179.if !defined(_meta_filemon)
180.if defined(.PARSEDIR)
181# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
182# as those are the only ones we will include.
183DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}}" != ""
184CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
185.else
186CFLAGS+= ${DEPEND_CFLAGS}

--- 10 unchanged lines hidden (view full) ---

197.endif # !defined(_meta_filemon)
198.endif # defined(SRCS)
199
200.if ${MK_DIRDEPS_BUILD} == "yes"
201# Prevent meta.autodep.mk from tracking "local dependencies".
202.depend:
203.include <meta.autodep.mk>
204# If using filemon then _EXTRADEPEND is skipped since it is not needed.
204.if empty(.MAKE.MODE:Mnofilemon)
205.if defined(_meta_filemon)
205# this depend: bypasses that below
206# the dependency helps when bootstrapping
207depend: beforedepend ${DPSRCS} ${SRCS} afterdepend
208beforedepend:
209afterdepend: beforedepend
210.endif
211.endif
212

--- 27 unchanged lines hidden (view full) ---

240.if defined(SRCS)
241depend: beforedepend ${DEPENDFILE} afterdepend
242
243# Tell bmake not to look for generated files via .PATH
244.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
245
246DPSRCS+= ${SRCS}
247# A .depend file will only be generated if there are commands in
206# this depend: bypasses that below
207# the dependency helps when bootstrapping
208depend: beforedepend ${DPSRCS} ${SRCS} afterdepend
209beforedepend:
210afterdepend: beforedepend
211.endif
212.endif
213

--- 27 unchanged lines hidden (view full) ---

241.if defined(SRCS)
242depend: beforedepend ${DEPENDFILE} afterdepend
243
244# Tell bmake not to look for generated files via .PATH
245.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS}
246
247DPSRCS+= ${SRCS}
248# A .depend file will only be generated if there are commands in
248# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
249# to allow 'make depend' to generate files.
249# beforedepend/_EXTRADEPEND/afterdepend The _EXTRADEPEND target is
250# ignored if using meta+filemon since it handles all dependencies. The other
251# targets are kept as they be used for generating something. The target is
252# kept to allow 'make depend' to generate files.
250${DEPENDFILE}: ${DPSRCS}
251.if exists(${.OBJDIR}/${DEPENDFILE}) || \
253${DEPENDFILE}: ${DPSRCS}
254.if exists(${.OBJDIR}/${DEPENDFILE}) || \
252 ((commands(beforedepend) || commands(_EXTRADEPEND) || \
255 ((commands(beforedepend) || \
256 (!defined(_meta_filemon) && commands(_EXTRADEPEND)) || \
253 commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta))
254 rm -f ${DEPENDFILE}
255.endif
257 commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta))
258 rm -f ${DEPENDFILE}
259.endif
256.if target(_EXTRADEPEND)
260.if !defined(_meta_filemon) && target(_EXTRADEPEND)
257_EXTRADEPEND: .USE
258${DEPENDFILE}: _EXTRADEPEND
259.endif
260
261.ORDER: ${DEPENDFILE} afterdepend
262.else
263depend: beforedepend afterdepend
264.endif

--- 43 unchanged lines hidden ---
261_EXTRADEPEND: .USE
262${DEPENDFILE}: _EXTRADEPEND
263.endif
264
265.ORDER: ${DEPENDFILE} afterdepend
266.else
267depend: beforedepend afterdepend
268.endif

--- 43 unchanged lines hidden ---