[oe-commits] Richard Purdie : base.bbclass: Enable using 'make clean' for rebuilds

git at git.openembedded.org git at git.openembedded.org
Fri Oct 24 21:00:22 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: a65ca7828410ddc68c0e8d963c688c1704f4ca75
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a65ca7828410ddc68c0e8d963c688c1704f4ca75

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Fri Oct 24 15:17:03 2014 +0100

base.bbclass: Enable using 'make clean' for rebuilds

When something rebuilds say due to ${baselib} changing or some
other key variable, software is often not rebuilt due to the
fact that make detects no dependency change.

By running "make clean" when these changes occur, we can at least try
and ensure the correct rebuilds happen. We use the same checksum check as
autotools to decide if things have changed or not.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/base.bbclass | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index ff8c633..e1b25ff 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -216,11 +216,24 @@ python base_eventhandler() {
 
 }
 
+CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
+
 addtask configure after do_patch
 do_configure[dirs] = "${S} ${B}"
 do_configure[deptask] = "do_populate_sysroot"
 base_do_configure() {
-	:
+	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+			cd ${B}
+			if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+				${MAKE} clean
+			fi
+			find ${B} -name \*.la -delete
+		fi
+	fi
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
 }
 
 addtask compile after do_configure



More information about the Openembedded-commits mailing list