Rewrite crunchgen target handling for progs so that it can be parallelized.
This covers 'clean', 'cleandepend', 'cleandir', 'obj', 'objlink' and 'build-tools'. This uses the same method as bsd.subdir.mk. MFC after: 2 weeks X-MFC-With: r289731 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
7c69db50df
commit
5583e49be6
@ -123,29 +123,32 @@ objs: $(OUTMK)
|
|||||||
|
|
||||||
# <sigh> Someone should replace the bin/csh and bin/sh build-tools with
|
# <sigh> Someone should replace the bin/csh and bin/sh build-tools with
|
||||||
# shell scripts so we can remove this nonsense.
|
# shell scripts so we can remove this nonsense.
|
||||||
build-tools:
|
|
||||||
.for _tool in $(CRUNCH_BUILDTOOLS)
|
.for _tool in $(CRUNCH_BUILDTOOLS)
|
||||||
|
build-tools-${_tool}:
|
||||||
${_+_}cd $(.CURDIR)/../../${_tool}; \
|
${_+_}cd $(.CURDIR)/../../${_tool}; \
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \
|
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools
|
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools
|
||||||
|
build-tools: build-tools-${_tool}
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
# Use a separate build tree to hold files compiled for this crunchgen binary
|
# Use a separate build tree to hold files compiled for this crunchgen binary
|
||||||
# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't
|
# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't
|
||||||
# get that to cooperate with bsd.prog.mk. Besides, many of the standard
|
# get that to cooperate with bsd.prog.mk. Besides, many of the standard
|
||||||
# targets should NOT be propagated into the components.
|
# targets should NOT be propagated into the components.
|
||||||
cleandepend cleandir obj objlink:
|
.for __target in clean cleandepend cleandir obj objlink
|
||||||
.for D in $(CRUNCH_SRCDIRS)
|
.for D in $(CRUNCH_SRCDIRS)
|
||||||
.for P in $(CRUNCH_PROGS_$(D))
|
.for P in $(CRUNCH_PROGS_$(D))
|
||||||
.ifdef CRUNCH_SRCDIR_${P}
|
.ifdef CRUNCH_SRCDIR_${P}
|
||||||
${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \
|
__dir= ${CRUNCH_SRCDIR_$(P)}
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
|
|
||||||
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
|
|
||||||
.else
|
.else
|
||||||
${_+_}cd $(.CURDIR)/../../${D}/${P} && \
|
__dir= ${.CURDIR}/../../${D}/${P}
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
|
|
||||||
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
|
|
||||||
.endif
|
.endif
|
||||||
|
${__target}_crunchdir_${P}: .PHONY .MAKE
|
||||||
|
${_+_}cd ${__dir} && \
|
||||||
|
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
|
||||||
|
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target}
|
||||||
|
${__target}: ${__target}_crunchdir_${P}
|
||||||
|
.endfor
|
||||||
.endfor
|
.endfor
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
@ -154,16 +157,3 @@ clean:
|
|||||||
${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
|
${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \
|
${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \
|
||||||
fi
|
fi
|
||||||
.for D in $(CRUNCH_SRCDIRS)
|
|
||||||
.for P in $(CRUNCH_PROGS_$(D))
|
|
||||||
.ifdef CRUNCH_SRCDIR_${P}
|
|
||||||
${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \
|
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
|
|
||||||
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
|
|
||||||
.else
|
|
||||||
${_+_}cd $(.CURDIR)/../../${D}/${P} && \
|
|
||||||
${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \
|
|
||||||
DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET}
|
|
||||||
.endif
|
|
||||||
.endfor
|
|
||||||
.endfor
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user