META_MODE: Don't rebuild build-tools targets during normal build.

This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build.  Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2016-04-14 21:06:10 +00:00
parent c027e2497f
commit b40d5fe0a7
11 changed files with 22 additions and 10 deletions

View File

@ -296,6 +296,10 @@ CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \
MACHINE_ARCH=${TARGET_ARCH} \
MACHINE=${TARGET} \
CPUTYPE=${TARGET_CPUTYPE}
.if ${MK_META_MODE} != "no"
# Don't rebuild build-tools targets during normal build.
CROSSENV+= BUILD_TOOLS_META=.NOMETA_CMP
.endif
.if ${MK_GROFF} != "no"
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \

View File

@ -88,6 +88,10 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \
LIBDIR=/usr/lib${libcompat} \
SHLIBDIR=/usr/lib${libcompat} \
DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}"
.if ${MK_META_MODE} != "no"
# Don't rebuild build-tools targets during normal build.
LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP
.endif
LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \
CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \
DESTDIR=${LIBCOMPATTMP} \

View File

@ -109,7 +109,7 @@ csh.1: tcsh.man
build-tools: gethost
gethost: gethost.c sh.err.h tc.const.h sh.h
gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META}
@rm -f ${.TARGET}
${CC} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \
${TCSHDIR}/gethost.c

View File

@ -44,10 +44,10 @@ builtins.c builtins.h: mkbuiltins builtins.def
# XXX this is just to stop the default .c rule being used, so that the
# intermediate object has a fixed name.
# XXX we have a default .c rule, but no default .o rule.
.o:
mknodes.o mksyntax.o: ${BUILD_TOOLS_META}
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
mknodes: mknodes.o
mksyntax: mksyntax.o
mknodes: mknodes.o ${BUILD_TOOLS_META}
mksyntax: mksyntax.o ${BUILD_TOOLS_META}
.ORDER: nodes.c nodes.h
nodes.c nodes.h: mknodes nodetypes nodes.c.pat

View File

@ -39,7 +39,7 @@ magic.mgc: mkmagic magic
CLEANFILES+= mkmagic
build-tools: mkmagic
mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c
mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${BUILD_TOOLS_META}
${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} \
${LDADD}

View File

@ -389,10 +389,10 @@ keys.list: MKkeys_list.sh Caps
# Build tools
build-tools: make_hash make_keys
make_keys: make_keys.c names.c ncurses_def.h ${HEADERS}
make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META}
${CC} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c
make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS}
make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META}
${CC} -o $@ ${CFLAGS} -DMAIN_PROGRAM \
${NCURSES_DIR}/ncurses/tinfo/make_hash.c

View File

@ -19,7 +19,7 @@ ${SCRMAPS}: ${.TARGET:R}.mk
uuencode ${.TARGET:R}.tmp ${.TARGET:R} > ${.TARGET}
rm -f ${.TARGET:R}.tmp
${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c
${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c ${BUILD_TOOLS_META}
${CC} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" ${LDFLAGS} \
-o ${.TARGET} ${.CURDIR}/mkscrfil.c

View File

@ -24,6 +24,6 @@ proctab.c: maketab
./maketab > proctab.c
build-tools: maketab
maketab: ytab.h ${AWKSRC}/maketab.c
maketab: ytab.h ${AWKSRC}/maketab.c ${BUILD_TOOLS_META}
.include <bsd.prog.mk>

View File

@ -13,3 +13,5 @@ build-tools: mkcsmapper_static
.include "${.CURDIR}/../mkcsmapper/Makefile.inc"
.include <bsd.prog.mk>
${PROG}: ${BUILD_TOOLS_META}

View File

@ -13,3 +13,5 @@ build-tools: mkesdb_static
.include "${.CURDIR}/../mkesdb/Makefile.inc"
.include <bsd.prog.mk>
${PROG}: ${BUILD_TOOLS_META}

View File

@ -100,7 +100,7 @@ english.base: dump ${SCAN} #Makefile
sort -nu > $@
dump: dump.c
dump: dump.c ${BUILD_TOOLS_META}
${CC} -o ${.TARGET} ${.ALLSRC}
CLEANFILES+= dump ${CAT} english.base *.check __ck1 __ck2