Browse Source

finetune make bulk

add bulk targets for allmodconfig/allconfig.
add more targets to the bulk list.
use a separate .cfg directory for target-libc combinations.
Waldemar Brodkorb 14 years ago
parent
commit
f991debebb
6 changed files with 120 additions and 38 deletions
  1. 1 1
      .gitignore
  2. 6 0
      Makefile
  3. 76 28
      mk/build.mk
  4. 4 3
      mk/split-cfg.mk
  5. 6 4
      scripts/split-cfg.sh
  6. 27 2
      target/bulk.lst

+ 1 - 1
.gitignore

@@ -19,7 +19,7 @@ toolchain_build_*/
 .defconfig
 all.config
 .cfg/
-.cfg.*/
+.cfg_*/
 cross_*/
 root_*/
 bin/

+ 6 - 0
Makefile

@@ -144,6 +144,12 @@ package_index: .prereq_done
 bulk: .prereq_done
 	@${GMAKE_INV} bulk
 
+bulkall: .prereq_done
+	@${GMAKE_INV} bulkall
+
+bulkallmod: .prereq_done
+	@${GMAKE_INV} bulkallmod
+
 menu: .prereq_done
 	@${GMAKE_INV} menu
 

+ 76 - 28
mk/build.mk

@@ -55,6 +55,7 @@ noconfig_targets:=	menuconfig \
 			_config \
 			_mconfig \
 			distclean \
+			defconfig \
 			tags
 
 MAKECLEANDIR_SYMBOLS=	ADK_DEBUG
@@ -101,16 +102,13 @@ include ${TOPDIR}/mk/split-cfg.mk
 
 all: world
 
-allcopy: all
-	$(CP) $(BIN_DIR) $(TOPDIR)/bulkdir/${targetdir}/
-
 ${TOPDIR}/package/Depends.mk: ${TOPDIR}/.config $(wildcard ${TOPDIR}/package/*/Makefile)
 	mksh ${TOPDIR}/package/depmaker
 
 .NOTPARALLEL:
 .PHONY: all world clean cleantarget cleandir distclean image_clean
 
-world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG
 	${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
 ifeq ($(ADK_NATIVE),y)
 	$(MAKE) -f mk/build.mk toolchain/kernel-headers-prepare target/config-prepare target/compile package/compile root_clean package/install package_index target/install
@@ -150,10 +148,10 @@ ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
 	echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
 endif
 
-package/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
+package/%: ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf ${TOPDIR}/package/Depends.mk
 	$(MAKE) -C package $(patsubst package/%,%,$@)
 
-target/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+target/%: ${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG
 	$(MAKE) -C target $(patsubst target/%,%,$@)
 
 toolchain/%: ${STAGING_DIR}
@@ -215,8 +213,9 @@ clean:
 			rm $$f ; \
 		done \
 	done
-	rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg \
-	    ${TOPDIR}/package/pkglist.d
+	rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) \
+		${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC} \
+	    	${TOPDIR}/package/pkglist.d
 	rm -f ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
 
 cleankernel:
@@ -237,16 +236,19 @@ cleandir:
 cleantarget:
 	@$(TRACE) cleantarget
 	@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
-	rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg
-	rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) all.config .defconfig
-	rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk .busyboxcfg
+	rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) \
+		${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}
+	rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT)
+	rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk \
+		.busyboxcfg all.config .defconfig
 
 distclean:
 	@$(TRACE) distclean
 	@$(MAKE) -C $(CONFIG) clean $(MAKE_TRACE)
 	@rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
-	    ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d $(TOPDIR)/bulkdir
-	@rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
+	    ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d
+	@rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) \
+		$(TOOLS_BUILD_DIR)
 	@rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
 	    .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk \
 	    .busyboxcfg
@@ -303,7 +305,25 @@ endif
 			echo $$symbol >> $(TOPDIR)/.defconfig; \
 		done; \
 	fi
-ifneq (,$(filter qemu%,${TARGET}))
+	@if [ ! -z "$(FS)" ];then \
+		grep "^config" target/Config.in \
+			|grep -i "$(FS)" \
+			|sed -e "s#^config \(.*\)#\1=y#" \
+			>> $(TOPDIR)/.defconfig; \
+	fi
+	@if [ ! -z "$(PKG)" ];then \
+		grep "^config" target/Config.in \
+			|grep -i "$(PKG)" \
+			|sed -e "s#^config \(.*\)#\1=y#" \
+			>> $(TOPDIR)/.defconfig; \
+	fi
+	@if [ ! -z "$(LIBC)" ];then \
+		grep "^config" target/Config.in \
+			|grep -i "$(LIBC)" \
+			|sed -e "s#^config \(.*\)#\1=y#" \
+			>> $(TOPDIR)/.defconfig; \
+	fi
+ifneq (,$(filter %_qemu,${TARGET}))
 	@echo ADK_LINUX_QEMU=y >> $(TOPDIR)/.defconfig
 endif
 ifneq (,$(filter rescue%,${TARGET}))
@@ -311,6 +331,12 @@ ifneq (,$(filter rescue%,${TARGET}))
 endif
 ifneq (,$(filter rb%,${TARGET}))
 	@echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/.defconfig
+endif
+ifneq (,$(filter alix%,${TARGET}))
+	@echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
+endif
+ifneq (,$(filter wrap%,${TARGET}))
+	@echo ADK_LINUX_ALIX=y >> $(TOPDIR)/.defconfig
 endif
 	@if [ ! -z "$(TARGET)" ];then \
 		$(CONFIG)/conf -D .defconfig $(CONFIG_CONFIG_IN); \
@@ -371,6 +397,12 @@ endif
 ifneq (,$(filter rb%,${TARGET}))
 	@echo ADK_LINUX_MIKROTIK=y >> $(TOPDIR)/all.config
 endif
+ifneq (,$(filter alix%,${TARGET}))
+	@echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
+endif
+ifneq (,$(filter wrap%,${TARGET}))
+	@echo ADK_LINUX_ALIX=y >> $(TOPDIR)/all.config
+endif
 
 menuconfig: $(CONFIG)/mconf defconfig .menu
 	@if [ ! -f .config ];then \
@@ -392,7 +424,7 @@ _mconfig2: ${CONFIG}/conf modconfig .menu
 distclean:
 	@$(MAKE) -C $(CONFIG) clean
 	@rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) \
-	    ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d $(TOPDIR)/bulkdir
+	    ${TOPDIR}/.cfg* ${TOPDIR}/package/pkglist.d 
 	@rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
 	@rm -f .config* .defconfig .tmpconfig.h all.config ${TOPDIR}/prereq.mk \
 	    .menu ${TOPDIR}/package/*/info.mk ${TOPDIR}/package/Depends.mk
@@ -401,23 +433,39 @@ endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
 
 # build all targets and combinations
 bulk:
-	while read target libc fs p; do \
-		mkdir -p $(TOPDIR)/bulkdir/$$target-$$libc-$$fs; \
+	while read target libc fs; do \
+		mkdir -p $(TOPDIR)/bin/$$target_$$libc; \
+	    ( \
+		echo === building $$target $$libc $$fs on $$(date); \
+		$(GMAKE) prereq && \
+			$(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs defconfig; \
+			$(GMAKE) VERBOSE=1 all; \
+		rm .config; \
+	    ) 2>&1 | tee $(TOPDIR)/bin/$$target_$$libc/$$target-$$libc-$$fs.log; \
+	done <${TOPDIR}/target/bulk.lst
+
+bulkall:
+	while read target libc fs; do \
+		mkdir -p $(TOPDIR)/bin/$$target_$$libc; \
+	    ( \
+		echo === building $$target $$libc $$fs on $$(date); \
+		$(GMAKE) prereq && \
+			$(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allconfig; \
+			$(GMAKE) VERBOSE=1 all; \
+		rm .config; \
+	    ) 2>&1 | tee $(TOPDIR)/bin/$$target_$$libc/$$target-$$libc-$$fs.log; \
+	done <${TOPDIR}/target/bulk.lst
+
+bulkallmod:
+	while read target libc fs; do \
+		mkdir -p $(TOPDIR)/bin/$$target_$$libc; \
 	    ( \
 		echo === building $$target $$libc $$fs on $$(date); \
 		$(GMAKE) prereq && \
-		if [ "x$$p" = xy ];then \
-			$(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs \
-				allmodconfig; \
-		else \
-			$(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs \
-				defconfig; \
-		fi && \
-		$(GMAKE) VERBOSE=1 -f mk/build.mk allcopy \
-		    targetdir=$$target-$$libc-$$fs; \
-		$(GMAKE) cleantarget; \
+			$(GMAKE) TARGET=$$target LIBC=$$libc FS=$$fs allmodconfig; \
+			$(GMAKE) VERBOSE=1 all; \
 		rm .config; \
-	    ) 2>&1 | tee $(TOPDIR)/bulkdir/$$target-$$libc-$$fs/log; \
+	    ) 2>&1 | tee $(TOPDIR)/bin/$$target_$$libc/$$target-$$libc-$$fs.log; \
 	done <${TOPDIR}/target/bulk.lst
 
 menu .menu: $(wildcard ${TOPDIR}/package/*/Makefile)

+ 4 - 3
mk/split-cfg.mk

@@ -2,6 +2,7 @@
 # material, please see the LICENCE file in the top-level directory.
 # must work with both BSD and GNU make
 
-${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG: ${TOPDIR}/.config \
-    ${TOPDIR}/mk/split-cfg.mk ${TOPDIR}/scripts/split-cfg.sh
-	mksh ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}'
+${TOPDIR}/.cfg_${ADK_TARGET}_${ADK_LIBC}/ADK_HAVE_DOT_CONFIG: \
+	${TOPDIR}/.config ${TOPDIR}/mk/split-cfg.mk \
+	${TOPDIR}/scripts/split-cfg.sh
+	mksh ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}' '${ADK_TARGET}' '${ADK_LIBC}'

+ 6 - 4
scripts/split-cfg.sh

@@ -4,13 +4,15 @@
 # ses the slow-down.
 
 TOPDIR=$1
+TARGET=$2
+LIBC=$3
 (( x_cols = (COLUMNS > 10) ? COLUMNS - 2 : 80 ))
 typeset -L$x_cols pbar
 
 grep -v '^BUSYBOX\|^# BUSYBOX' $TOPDIR/.config > $TOPDIR/.config.split
 
-mkdir -p $TOPDIR/.cfg
-cd $TOPDIR/.cfg
+mkdir -p $TOPDIR/.cfg_${TARGET}_${LIBC}
+cd $TOPDIR/.cfg_${TARGET}_${LIBC}
 
 oldfiles=$(print -r -- *)
 newfiles=:
@@ -66,7 +68,7 @@ print -nu2 '\r'
 # and the entire Config.in will be auto-generated anyway,
 # so we're better off placing it here
 #XXX this is too slow @868 configure options
-cd $TOPDIR/.cfg
+cd $TOPDIR/.cfg_${TARGET}_${LIBC}
 rm -f $TOPDIR/package/*/info.mk
 for option in *; do
 	pbar="$option ..."
@@ -78,7 +80,7 @@ for option in *; do
 	done | while read fname; do
 		[[ $ao = *:$fname:* ]] && continue
 		ao=$ao$fname:
-		echo "\${_IPKGS_COOKIE}: \${TOPDIR}/.cfg/$option" >>$fname
+		echo "\${_IPKGS_COOKIE}: \${TOPDIR}/.cfg_${TARGET}_${LIBC}/$option" >>$fname
 	done
 done
 pbar=done

+ 27 - 2
target/bulk.lst

@@ -1,2 +1,27 @@
-ag241		uclibc		nfsroot		y
-foxboard	uclibc		nfsroot		y
+ag241		uclibc		nfsroot
+foxboard	uclibc		nfsroot
+rb532		uclibc		nfsroot
+rb532		eglibc		nfsroot
+alix1c		uclibc		nfsroot
+alix1c		eglibc		nfsroot
+alix1c		glibc		nfsroot
+alix2d		uclibc		nfsroot
+alix2d		eglibc		nfsroot
+alix2d		glibc		nfsroot
+alix2d13	uclibc		nfsroot
+alix2d13	eglibc		nfsroot
+alix2d13	glibc		nfsroot
+wrap		uclibc		nfsroot
+wrap		eglibc		nfsroot
+wrap		glibc		nfsroot
+arm_qemu	uclibc		archive
+arm_qemu	eglibc		archive
+mips_qemu	uclibc		archive
+mips_qemu	eglibc		archive
+mipsel_qemu	uclibc		archive
+mipsel_qemu	eglibc		archive
+x86_qemu	uclibc		archive
+x86_qemu	eglibc		archive
+x86_qemu	glibc		archive
+x86_64_qemu	uclibc		archive
+x86_64_qemu	eglibc		archive