From 7279052efaf1dc2bca86b53993d0d71ed106b308 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 2 Jul 2018 09:30:20 +0800 Subject: [PATCH] initrd: Fix parallel build Add explicit target orders to oinit/Makefile, because such orders are set in but not in . Since the make targets (e.g., depend, all, install, clean) are now ordered, so remove 'clean cleandepend' from the same command as 'depend all install'. Also allow defining the 'NO_CLEAN" variable to not clean previous builds. --- initrd/Makefile | 9 +++++---- initrd/oinit/Makefile | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/initrd/Makefile b/initrd/Makefile index cc2da93a67..6aa2406e48 100644 --- a/initrd/Makefile +++ b/initrd/Makefile @@ -13,12 +13,14 @@ INITRD_STAGEDIR!= mktemp -d -t initrd-stage rescue: @${ECHO} ">>> Building and installing rescue tools ..." .for _dir in bin oinit sbin sbin.libcrypto +.if !defined(NO_CLEAN) + (cd ${.CURDIR}/${_dir}; \ + ${INITRD_MAKE} BINDIR=${RESCUE_DIR} clean cleandepend) +.endif (cd ${.CURDIR}/${_dir}; \ ${ECHO} "=> ${_dir}"; \ - ${INITRD_MAKE} BINDIR=${RESCUE_DIR} clean cleandepend; \ ${INITRD_MAKE} BINDIR=${RESCUE_DIR} obj; \ - ${INITRD_MAKE} BINDIR=${RESCUE_DIR} \ - depend all install clean cleandepend) + ${INITRD_MAKE} BINDIR=${RESCUE_DIR} depend all install) .endfor initrd: rescue @@ -32,7 +34,6 @@ initrd: rescue -b ${DESTDIR}/boot \ -r ${DESTDIR}${RESCUE_DIR} \ -c ${INITRD_STAGEDIR} - (cd ${.CURDIR}/etc; ${INITRD_MAKE} clean cleandepend) clean: @${ECHO} ">>> Cleaning ..." diff --git a/initrd/oinit/Makefile b/initrd/oinit/Makefile index 7f0db38874..bb9b6b9d9c 100644 --- a/initrd/oinit/Makefile +++ b/initrd/oinit/Makefile @@ -6,3 +6,5 @@ DPADD= ${LIBUTIL} LDADD= -lutil .include + +.ORDER: clean cleandepend cleandir obj depend all install -- 2.41.0