From f991debebbd17225a6302b7bcd51101b0f41a621 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 4 Feb 2010 00:27:07 +0100 Subject: 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. --- .gitignore | 2 +- Makefile | 6 +++ mk/build.mk | 104 +++++++++++++++++++++++++++++++++++++-------------- mk/split-cfg.mk | 7 ++-- scripts/split-cfg.sh | 10 +++-- target/bulk.lst | 29 +++++++++++++- 6 files changed, 120 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 7e27e221d..957033da2 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ toolchain_build_*/ .defconfig all.config .cfg/ -.cfg.*/ +.cfg_*/ cross_*/ root_*/ bin/ diff --git a/Makefile b/Makefile index 5e9c37a3e..9959e3169 100644 --- a/Makefile +++ b/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 diff --git a/mk/build.mk b/mk/build.mk index 5c26ea4c9..a9d493924 100644 --- a/mk/build.mk +++ b/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) diff --git a/mk/split-cfg.mk b/mk/split-cfg.mk index 9f4bff8e7..a5c59b682 100644 --- a/mk/split-cfg.mk +++ b/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}' diff --git a/scripts/split-cfg.sh b/scripts/split-cfg.sh index 07cdd5838..297d42beb 100644 --- a/scripts/split-cfg.sh +++ b/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 diff --git a/target/bulk.lst b/target/bulk.lst index 0dacdd64c..b637abc1a 100644 --- a/target/bulk.lst +++ b/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 -- cgit v1.2.3