author | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2014-07-24 21:21:48 (GMT) |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2014-07-30 08:34:41 (GMT) |
commit | f641061499ffd527119d60b40f4452c01dfea914 (patch) | |
tree | cf761220edc7174aa61273600f4a2484d0765f86 | |
parent | bc2a6e50d183811222912a1f01ca453d940ff3a6 (diff) | |
download | busybox-f641061499ffd527119d60b40f4452c01dfea914.zip busybox-f641061499ffd527119d60b40f4452c01dfea914.tar.gz busybox-f641061499ffd527119d60b40f4452c01dfea914.tar.bz2 |
Android: final cleanup of new build system
Rename hidden config files to busybox-<profile>.config
Set also KBUILD_OUTPUT to prevent generation of files in src dir,
if local make without O= is made (which create host code)
That do not force the rebuild of config files, except with mm -B
With the help of Chih-Wei Huang <cwhuang@linux.org.tw>
Change-Id: Ic6bc2bc7177b1f266b9c0d1ccdfb925c1aa00d46
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Android.mk | 58 | ||||
-rw-r--r-- | CleanSpec.mk | 7 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README | 9 | ||||
-rw-r--r-- | busybox-full.config (renamed from .config-full) | 0 | ||||
-rw-r--r-- | busybox-minimal.config (renamed from .config-minimal) | 0 | ||||
-rwxr-xr-x | include-full/copy-current.sh | 8 | ||||
-rwxr-xr-x | include-minimal/copy-current.sh | 8 |
9 files changed, 31 insertions, 63 deletions
@@ -13,7 +13,7 @@ Config.in # Never ignore these # !.gitignore -!.config-* +!.config* # # Normal output @@ -33,10 +33,10 @@ include $(CLEAR_VARS) # Explicitly set an architecture specific CONFIG_CROSS_COMPILER_PREFIX ifeq ($(TARGET_ARCH),arm) - BUSYBOX_CROSS_COMPILER_PREFIX := arm-eabi- + BUSYBOX_CROSS_COMPILER_PREFIX := arm-linux-androideabi- endif ifeq ($(TARGET_ARCH),x86) - BUSYBOX_CROSS_COMPILER_PREFIX := i686-linux-android- + BUSYBOX_CROSS_COMPILER_PREFIX := $(if $(filter x86_64,$(HOST_ARCH)),x86_64,i686)-linux-android- endif ifeq ($(TARGET_ARCH),mips) BUSYBOX_CROSS_COMPILER_PREFIX := mipsel-linux-android- @@ -48,45 +48,25 @@ ifeq ($(HOST_OS),darwin) BB_PREPARE_FLAGS := HOSTCC=$(BB_HOSTCC) endif -bb_gen := $(TARGET_OUT_INTERMEDIATES)/busybox -ifeq (,$(findstring $(ANDROID_BUILD_TOP),$(TARGET_OUT_INTERMEDIATES))) - bb_gen := $(ANDROID_BUILD_TOP)/$(TARGET_OUT_INTERMEDIATES)/busybox -endif +# On aosp (master), path is relative, not on cm (kitkat) +bb_gen := $(abspath $(TARGET_OUT_INTERMEDIATES)/busybox) -LOCAL_MODULE := busybox_prepare_full -LOCAL_MODULE_TAGS := eng debug -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(bb_gen)/full -LOCAL_SRC_FILES := .config-full -$(LOCAL_MODULE): - @echo -e ${CL_GRN}"Prepare config for busybox binary"${CL_RST} - @cd $(ANDROID_BUILD_TOP) +busybox_prepare_full := $(bb_gen)/full/.config +$(busybox_prepare_full): $(BB_PATH)/busybox-full.config + @echo -e ${CL_YLW}"Prepare config for busybox binary"${CL_RST} @rm -rf $(bb_gen)/full - @mkdir -p $(bb_gen)/full/include - cat $(BB_PATH)/.config-full > $(bb_gen)/full/.config - @echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" >> $(bb_gen)/full/.config - make -C $(BB_PATH) prepare O=$(bb_gen)/full $(BB_PREPARE_FLAGS) + @mkdir -p $(@D) + @cat $^ > $@ && echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" >> $@ + make -C $(BB_PATH) prepare O=$(@D) $(BB_PREPARE_FLAGS) -include $(BUILD_PREBUILT) - -LOCAL_PATH := $(BB_PATH) -include $(CLEAR_VARS) - -LOCAL_MODULE := busybox_prepare_minimal -LOCAL_MODULE_TAGS := eng debug -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_PATH := $(bb_gen)/minimal -LOCAL_SRC_FILES := .config-minimal -$(LOCAL_MODULE): - @echo -e ${CL_GRN}"Prepare config for libbusybox"${CL_RST} - @cd $(ANDROID_BUILD_TOP) +busybox_prepare_minimal := $(bb_gen)/minimal/.config +$(busybox_prepare_minimal): $(BB_PATH)/busybox-minimal.config + @echo -e ${CL_YLW}"Prepare config for libbusybox"${CL_RST} @rm -rf $(bb_gen)/minimal - @mkdir -p $(bb_gen)/minimal/include - cat $(BB_PATH)/.config-minimal > $(bb_gen)/minimal/.config - @echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" >> $(bb_gen)/minimal/.config - make -C $(BB_PATH) prepare O=$(bb_gen)/minimal $(BB_PREPARE_FLAGS) + @mkdir -p $(@D) + @cat $^ > $@ && echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" >> $@ + make -C $(BB_PATH) prepare O=$(@D) $(BB_PREPARE_FLAGS) -include $(BUILD_PREBUILT) ##################################################################### @@ -182,7 +162,7 @@ LOCAL_CFLAGS += \ LOCAL_MODULE := libbusybox LOCAL_MODULE_TAGS := eng debug LOCAL_STATIC_LIBRARIES := libcutils libc libm libselinux -LOCAL_ADDITIONAL_DEPENDENCIES := busybox_prepare_minimal +LOCAL_ADDITIONAL_DEPENDENCIES := $(busybox_prepare_minimal) include $(BUILD_STATIC_LIBRARY) @@ -205,7 +185,7 @@ LOCAL_MODULE_TAGS := eng debug LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) LOCAL_SHARED_LIBRARIES := libc libcutils libm LOCAL_STATIC_LIBRARIES := libclearsilverregex libuclibcrpc libselinux -LOCAL_ADDITIONAL_DEPENDENCIES := busybox_prepare_full +LOCAL_ADDITIONAL_DEPENDENCIES := $(busybox_prepare_full) include $(BUILD_EXECUTABLE) BUSYBOX_LINKS := $(shell cat $(BB_PATH)/busybox-$(BUSYBOX_CONFIG).links) @@ -254,5 +234,5 @@ LOCAL_STATIC_LIBRARIES := libclearsilverregex libc libcutils libm libuclibcrpc l LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities -LOCAL_ADDITIONAL_DEPENDENCIES := busybox_prepare_full +LOCAL_ADDITIONAL_DEPENDENCIES := $(busybox_prepare_full) include $(BUILD_EXECUTABLE) diff --git a/CleanSpec.mk b/CleanSpec.mk index 70694ec..7fc801d 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -38,21 +38,20 @@ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ +# Note: this is not really required, but remember only the added lines +# will be executed (see $OUT/clean_steps.mk value for the current line) + $(call add-clean-step, rm -f $(PRODUCT_OUT)/utilities/busybox) $(call add-clean-step, rm -f $(PRODUCT_OUT)/symbols/system/xbin/busybox) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/busybox) -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/ETC/busybox_*) - $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/EXECUTABLES/busybox_intermediates) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libbusybox_intermediates) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/UTILITY_EXECUTABLES/static_busybox_intermediates) $(call add-clean-step, rm -f external/busybox/.config) -$(call add-clean-step, rm -f external/busybox/include/applet_tables.h) $(call add-clean-step, rm -f external/busybox/include/applets.h) -$(call add-clean-step, cd external/busybox && git clean -f -- include*) # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST @@ -4,6 +4,8 @@ SUBLEVEL = 1 EXTRAVERSION = NAME = bionic +KBUILD_OUTPUT=$(OUT)/obj/busybox + # *DOCUMENTATION* # To see a list of typical targets execute "make help" # More info can be located in ./README @@ -9,12 +9,15 @@ WARNING : THIS IS A BIONIC VERSION OF BUSYBOX, DO NOT USE "make" IN THIS TREE This tree has multiple configurations (busybox and recovery lib), - lunch your device to prepare the environment -- edit the wanted config profile (.config-full or .config-minimal) +- edit the wanted config profile (ie busybox-full.config) - type "mma" in external/busybox to build with the dependencies - Finally copy $OUT/obj/busybox/full/.config to .config-full without - the CONFIG_CROSS_COMPILER_PREFIX line ! to stay compatible with x86 targets + Finally copy $OUT/obj/busybox/full/.config to the source tree without + the CONFIG_CROSS_COMPILER_PREFIX line! (to stay compatible with x86 targets) + + bb_obj=$OUT/obj/busybox/full + cat $bb_obj/.config | grep -v CROSS_COMPILER_ > ../busybox-full.config If you add or remove some applets, please also update busybox-profile.links and busybox-profile.sources diff --git a/.config-full b/busybox-full.config index 5989ddf..5989ddf 100644 --- a/.config-full +++ b/busybox-full.config diff --git a/.config-minimal b/busybox-minimal.config index fe852c2..fe852c2 100644 --- a/.config-minimal +++ b/busybox-minimal.config diff --git a/include-full/copy-current.sh b/include-full/copy-current.sh deleted file mode 100755 index 1ce6df3..0000000 --- a/include-full/copy-current.sh +++ b/dev/null @@ -1,8 +0,0 @@ -# after a change, you need copy the generated .config to the repository - -[ -z "$OUT" ] && exit 1 - -bb_obj=$OUT/obj/busybox/full - -cat $bb_obj/.config | grep -v CONFIG_CROSS_COMPILER_PREFIX > ../.config-full - diff --git a/include-minimal/copy-current.sh b/include-minimal/copy-current.sh deleted file mode 100755 index e950aa6..0000000 --- a/include-minimal/copy-current.sh +++ b/dev/null @@ -1,8 +0,0 @@ -# after a change, you need copy the generated .config to the repository - -[ -z "$OUT" ] && exit 1 - -bb_obj=$OUT/obj/busybox/minimal - -cat $bb_obj/.config | grep -v CONFIG_CROSS_COMPILER_PREFIX > ../.config-minimal - |