Deleted Added
full compact
gendirdeps.mk (250837) gendirdeps.mk (255253)
1# $Id: gendirdeps.mk,v 1.22 2013/05/11 05:16:26 sjg Exp $
1# $Id: gendirdeps.mk,v 1.23 2013/09/04 17:49:20 sjg Exp $
2
3# Copyright (c) 2010-2013, Juniper Networks, Inc.
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright

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

157 ${META_FILES:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
158 sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,'
159
160.if ${dir_list:M*ERROR\:*} != ""
161.warning ${dir_list:tW:C,.*(ERROR),\1,}
162.warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,}
163# we are not going to update anything
164.else
2
3# Copyright (c) 2010-2013, Juniper Networks, Inc.
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright

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

157 ${META_FILES:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
158 sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,'
159
160.if ${dir_list:M*ERROR\:*} != ""
161.warning ${dir_list:tW:C,.*(ERROR),\1,}
162.warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,}
163# we are not going to update anything
164.else
165
165dpadd_dir_list=
166.if !empty(DPADD)
167_nonlibs := ${DPADD:T:Nlib*:N*include}
168.if !empty(_nonlibs)
169ddep_list =
170.for f in ${_nonlibs:@x@${DPADD:M*/$x}@}
171.if exists($f.dirdep)
172ddep_list += $f.dirdep
173.elif exists(${f:H}.dirdep)
174ddep_list += ${f:H}.dirdep
175.else
176dir_list += ${f:H:tA}
166.if !empty(DPADD)
167_nonlibs := ${DPADD:T:Nlib*:N*include}
168.if !empty(_nonlibs)
169ddep_list =
170.for f in ${_nonlibs:@x@${DPADD:M*/$x}@}
171.if exists($f.dirdep)
172ddep_list += $f.dirdep
173.elif exists(${f:H}.dirdep)
174ddep_list += ${f:H}.dirdep
175.else
176dir_list += ${f:H:tA}
177dpadd_dir_list += ${f:H:tA}
177.endif
178.endfor
179.if !empty(ddep_list)
180ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
181 sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,;s,\.${MACHINE}$$,,'
182
183.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
184.info ${RELDIR}: raw_dir_list='${dir_list}'

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

192# DIRDEPS represent things that had to have been built first
193# so they should all be undir OBJTOP.
194# Note that ${_OBJTOP}/bsd/include/machine will get reported
195# to us as $SRCTOP/bsd/sys/$MACHINE_ARCH/include meaning we
196# will want to visit bsd/include
197# so we add
198# ${"${dir_list:M*bsd/sys/${MACHINE_ARCH}/include}":?bsd/include:}
199# to GENDIRDEPS_DIR_LIST_XTRAS
178.endif
179.endfor
180.if !empty(ddep_list)
181ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
182 sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,;s,\.${MACHINE}$$,,'
183
184.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
185.info ${RELDIR}: raw_dir_list='${dir_list}'

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

193# DIRDEPS represent things that had to have been built first
194# so they should all be undir OBJTOP.
195# Note that ${_OBJTOP}/bsd/include/machine will get reported
196# to us as $SRCTOP/bsd/sys/$MACHINE_ARCH/include meaning we
197# will want to visit bsd/include
198# so we add
199# ${"${dir_list:M*bsd/sys/${MACHINE_ARCH}/include}":?bsd/include:}
200# to GENDIRDEPS_DIR_LIST_XTRAS
200_objtops = ${OBJTOP} ${_OBJTOP} ${_obtop}
201_objtops = ${OBJTOP} ${_OBJTOP} ${_objtop}
201_objtops := ${_objtops:O:u}
202dirdep_list = \
203 ${_objtops:@o@${dir_list:M$o*/*:C,$o[^/]*/,,}@} \
204 ${GENDIRDEPS_DIR_LIST_XTRAS}
205
206# sort longest first
207M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]}
208
209# anything we use from an object dir other than ours
210# needs to be qualified with its .<machine> suffix
211# (we used the pseudo machine "host" for the HOST_TARGET).
212skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@}
213.for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}}
214# we need := so only skip_ql to this point applies
202_objtops := ${_objtops:O:u}
203dirdep_list = \
204 ${_objtops:@o@${dir_list:M$o*/*:C,$o[^/]*/,,}@} \
205 ${GENDIRDEPS_DIR_LIST_XTRAS}
206
207# sort longest first
208M2D_OBJROOTS := ${M2D_OBJROOTS:O:u:[-1..1]}
209
210# anything we use from an object dir other than ours
211# needs to be qualified with its .<machine> suffix
212# (we used the pseudo machine "host" for the HOST_TARGET).
213skip_ql= ${SRCTOP}* ${_objtops:@o@$o*@}
214.for o in ${M2D_OBJROOTS:${skip_ql:${M_ListToSkip}}}
215# we need := so only skip_ql to this point applies
215ql := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,}
216qualdir_list += ${ql}
216ql.$o := ${dir_list:${skip_ql:${M_ListToSkip}}:M$o*/*/*:C,$o([^/]+)/(.*),\2.\1,:S,.${HOST_TARGET},.host,}
217qualdir_list += ${ql.$o}
218.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
219.info ${RELDIR}: o=$o ${ql.$o qualdir_list:L:@v@$v=${$v}@}
220.endif
217skip_ql+= $o*
218.endfor
219
220dirdep_list := ${dirdep_list:O:u}
221qualdir_list := ${qualdir_list:N*.${MACHINE}:O:u}
222
223DIRDEPS = \
224 ${dirdep_list:N${RELDIR}:N${RELDIR}/*} \

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

236 ${dirdep_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/$d/$m):?$d:${exists(${SRCTOP}/${d:R}/$m):?$d:}}@}@} \
237 ${qualdir_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/${d:R}/$m):?$d:}@}@}
238
239DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:O:u}
240
241.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
242.info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS}
243.info ${RELDIR}: dir_list='${dir_list}'
221skip_ql+= $o*
222.endfor
223
224dirdep_list := ${dirdep_list:O:u}
225qualdir_list := ${qualdir_list:N*.${MACHINE}:O:u}
226
227DIRDEPS = \
228 ${dirdep_list:N${RELDIR}:N${RELDIR}/*} \

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

240 ${dirdep_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/$d/$m):?$d:${exists(${SRCTOP}/${d:R}/$m):?$d:}}@}@} \
241 ${qualdir_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/${d:R}/$m):?$d:}@}@}
242
243DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:O:u}
244
245.if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
246.info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS}
247.info ${RELDIR}: dir_list='${dir_list}'
248.info ${RELDIR}: dpadd_dir_list='${dpadd_dir_list}'
244.info ${RELDIR}: dirdep_list='${dirdep_list}'
245.info ${RELDIR}: qualdir_list='${qualdir_list}'
246.info ${RELDIR}: SKIP_GENDIRDEPS='${SKIP_GENDIRDEPS}'
247.info ${RELDIR}: GENDIRDEPS_FILTER='${GENDIRDEPS_FILTER}'
248.info ${RELDIR}: FORCE_DPADD='${DPADD}'
249.info ${RELDIR}: DIRDEPS='${DIRDEPS}'
250.endif
251

--- 81 unchanged lines hidden ---
249.info ${RELDIR}: dirdep_list='${dirdep_list}'
250.info ${RELDIR}: qualdir_list='${qualdir_list}'
251.info ${RELDIR}: SKIP_GENDIRDEPS='${SKIP_GENDIRDEPS}'
252.info ${RELDIR}: GENDIRDEPS_FILTER='${GENDIRDEPS_FILTER}'
253.info ${RELDIR}: FORCE_DPADD='${DPADD}'
254.info ${RELDIR}: DIRDEPS='${DIRDEPS}'
255.endif
256

--- 81 unchanged lines hidden ---