Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
Koushik Dutta | 129a798 | 2011-11-16 18:27:02 -0800 | [diff] [blame] | 3 | |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 4 | # Bionic Branches Switches (CM7/AOSP/ICS) |
| 5 | BIONIC_ICS := true |
Tanguy Pruvot | eba4519 | 2011-07-15 20:38:12 +0200 | [diff] [blame] | 6 | |
Tanguy Pruvot | 29d8ebe | 2011-10-29 15:15:34 +0200 | [diff] [blame] | 7 | |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 8 | # Make a static library for regex. |
| 9 | include $(CLEAR_VARS) |
| 10 | LOCAL_SRC_FILES := android/regex/regex.c |
| 11 | LOCAL_C_INCLUDES := android/regex |
| 12 | LOCAL_MODULE := libclearsilverregex |
| 13 | include $(BUILD_STATIC_LIBRARY) |
| 14 | |
Tanguy Pruvot | 29d8ebe | 2011-10-29 15:15:34 +0200 | [diff] [blame] | 15 | |
Tanguy Pruvot | b2ccaf3 | 2011-07-05 18:22:26 +0200 | [diff] [blame] | 16 | # Execute make clean, make prepare and copy profiles required for normal & static busybox (recovery) |
| 17 | |
| 18 | include $(CLEAR_VARS) |
Tanguy Pruvot | eba4519 | 2011-07-15 20:38:12 +0200 | [diff] [blame] | 19 | KERNEL_MODULES_DIR ?= /system/lib/modules |
| 20 | BUSYBOX_CONFIG := minimal full |
Tanguy Pruvot | b2ccaf3 | 2011-07-05 18:22:26 +0200 | [diff] [blame] | 21 | $(BUSYBOX_CONFIG): |
| 22 | @echo GENERATE INCLUDES FOR BUSYBOX $@ |
| 23 | @cd $(LOCAL_PATH) && make clean |
| 24 | cp $(LOCAL_PATH)/.config-$@ $(LOCAL_PATH)/.config |
| 25 | cd $(LOCAL_PATH) && make prepare |
| 26 | @#cp $(LOCAL_PATH)/.config $(LOCAL_PATH)/.config-$@ |
| 27 | @mkdir -p $(LOCAL_PATH)/include-$@ |
| 28 | cp $(LOCAL_PATH)/include/*.h $(LOCAL_PATH)/include-$@/ |
| 29 | @rm $(LOCAL_PATH)/include/usage_compressed.h |
Tanguy Pruvot | eba4519 | 2011-07-15 20:38:12 +0200 | [diff] [blame] | 30 | @rm -f $(LOCAL_PATH)/.config-old |
Tanguy Pruvot | b2ccaf3 | 2011-07-05 18:22:26 +0200 | [diff] [blame] | 31 | |
| 32 | busybox_prepare: $(BUSYBOX_CONFIG) |
| 33 | LOCAL_MODULE := busybox_prepare |
| 34 | LOCAL_MODULE_TAGS := eng |
| 35 | include $(BUILD_STATIC_LIBRARY) |
| 36 | |
| 37 | |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 38 | include $(CLEAR_VARS) |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 39 | |
Tanguy Pruvot | eba4519 | 2011-07-15 20:38:12 +0200 | [diff] [blame] | 40 | KERNEL_MODULES_DIR ?= /system/lib/modules |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 41 | |
Tanguy Pruvot | eba4519 | 2011-07-15 20:38:12 +0200 | [diff] [blame] | 42 | SUBMAKE := make -s -C $(LOCAL_PATH) CC=$(CC) |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 43 | |
| 44 | BUSYBOX_SRC_FILES = $(shell cat $(LOCAL_PATH)/busybox-$(BUSYBOX_CONFIG).sources) \ |
| 45 | libbb/android.c |
| 46 | |
| 47 | ifeq ($(TARGET_ARCH),arm) |
| 48 | BUSYBOX_SRC_FILES += \ |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 49 | android/libc/arch-arm/syscalls/adjtimex.S \ |
| 50 | android/libc/arch-arm/syscalls/getsid.S \ |
| 51 | android/libc/arch-arm/syscalls/stime.S \ |
| 52 | android/libc/arch-arm/syscalls/swapon.S \ |
| 53 | android/libc/arch-arm/syscalls/swapoff.S \ |
| 54 | android/libc/arch-arm/syscalls/sysinfo.S |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 55 | endif |
| 56 | |
Rocky Zhang | 8f997da | 2011-10-03 21:11:37 +0800 | [diff] [blame] | 57 | ifeq ($(TARGET_ARCH),mips) |
| 58 | BUSYBOX_SRC_FILES += \ |
| 59 | android/libc/arch-mips/syscalls/adjtimex.S \ |
| 60 | android/libc/arch-mips/syscalls/getsid.S \ |
| 61 | android/libc/arch-mips/syscalls/stime.S \ |
| 62 | android/libc/arch-mips/syscalls/swapon.S \ |
| 63 | android/libc/arch-mips/syscalls/swapoff.S \ |
| 64 | android/libc/arch-mips/syscalls/sysinfo.S |
| 65 | endif |
| 66 | |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 67 | BUSYBOX_C_INCLUDES = \ |
| 68 | $(LOCAL_PATH)/include-$(BUSYBOX_CONFIG) \ |
| 69 | $(LOCAL_PATH)/include $(LOCAL_PATH)/libbb \ |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 70 | bionic/libc/private \ |
| 71 | bionic/libm/include \ |
| 72 | bionic/libm \ |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 73 | libc/kernel/common \ |
| 74 | $(LOCAL_PATH)/android/regex |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 75 | |
| 76 | BUSYBOX_CFLAGS = \ |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 77 | -Werror=implicit \ |
| 78 | -DNDEBUG \ |
Tanguy Pruvot | c81b2cf | 2011-07-04 10:18:25 +0200 | [diff] [blame] | 79 | -DANDROID \ |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 80 | -include include-$(BUSYBOX_CONFIG)/autoconf.h \ |
| 81 | -D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \ |
| 82 | -D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion)) $(BUSYBOX_SUFFIX)"' -DBB_BT=AUTOCONF_TIMESTAMP |
| 83 | |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 84 | # to handle differences in ICS (ipv6) |
| 85 | ifeq ($(BIONIC_ICS),true) |
| 86 | BUSYBOX_CFLAGS += -DBIONIC_ICS |
| 87 | endif |
Tanguy Pruvot | 64baaf5 | 2011-07-04 09:41:45 +0200 | [diff] [blame] | 88 | |
Tanguy Pruvot | d0fce6d | 2011-07-04 04:46:06 +0200 | [diff] [blame] | 89 | |
| 90 | # Build the static lib for the recovery tool |
| 91 | |
Tanguy Pruvot | d0fce6d | 2011-07-04 04:46:06 +0200 | [diff] [blame] | 92 | BUSYBOX_CONFIG:=minimal |
| 93 | BUSYBOX_SUFFIX:=static |
| 94 | LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES) |
| 95 | LOCAL_C_INCLUDES := $(BUSYBOX_C_INCLUDES) |
| 96 | LOCAL_CFLAGS := -Dmain=busybox_driver $(BUSYBOX_CFLAGS) |
| 97 | LOCAL_CFLAGS += \ |
| 98 | -Dgetusershell=busybox_getusershell \ |
| 99 | -Dsetusershell=busybox_setusershell \ |
| 100 | -Dendusershell=busybox_endusershell \ |
| 101 | -Dttyname_r=busybox_ttyname_r \ |
| 102 | -Dgetmntent=busybox_getmntent \ |
| 103 | -Dgetmntent_r=busybox_getmntent_r \ |
| 104 | -Dgenerate_uuid=busybox_generate_uuid |
| 105 | LOCAL_MODULE := libbusybox |
| 106 | LOCAL_MODULE_TAGS := eng |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 107 | LOCAL_STATIC_LIBRARIES := libcutils libc libm |
Tanguy Pruvot | 985c411 | 2011-10-10 21:28:29 +0200 | [diff] [blame] | 108 | $(LOCAL_MODULE): busybox_prepare |
Tanguy Pruvot | d0fce6d | 2011-07-04 04:46:06 +0200 | [diff] [blame] | 109 | include $(BUILD_STATIC_LIBRARY) |
| 110 | |
| 111 | |
| 112 | # Bionic Busybox /system/xbin |
| 113 | |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 114 | include $(CLEAR_VARS) |
| 115 | BUSYBOX_CONFIG:=full |
| 116 | BUSYBOX_SUFFIX:=bionic |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 117 | LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES) |
| 118 | ifeq ($(BIONIC_ICS),true) |
| 119 | LOCAL_SRC_FILES += android/libc/__set_errno.c |
| 120 | endif |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 121 | LOCAL_C_INCLUDES := $(BUSYBOX_C_INCLUDES) |
| 122 | LOCAL_CFLAGS := $(BUSYBOX_CFLAGS) |
| 123 | LOCAL_MODULE := busybox |
| 124 | LOCAL_MODULE_TAGS := eng |
| 125 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 126 | LOCAL_SHARED_LIBRARIES := libc libcutils libm |
Koushik Dutta | 129a798 | 2011-11-16 18:27:02 -0800 | [diff] [blame] | 127 | LOCAL_STATIC_LIBRARIES := libclearsilverregex |
Tanguy Pruvot | 985c411 | 2011-10-10 21:28:29 +0200 | [diff] [blame] | 128 | $(LOCAL_MODULE): busybox_prepare |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 129 | include $(BUILD_EXECUTABLE) |
| 130 | |
| 131 | BUSYBOX_LINKS := $(shell cat $(LOCAL_PATH)/busybox-$(BUSYBOX_CONFIG).links) |
| 132 | # nc is provided by external/netcat |
| 133 | exclude := nc |
| 134 | SYMLINKS := $(addprefix $(TARGET_OUT_OPTIONAL_EXECUTABLES)/,$(filter-out $(exclude),$(notdir $(BUSYBOX_LINKS)))) |
| 135 | $(SYMLINKS): BUSYBOX_BINARY := $(LOCAL_MODULE) |
| 136 | $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) |
| 137 | @echo "Symlink: $@ -> $(BUSYBOX_BINARY)" |
| 138 | @mkdir -p $(dir $@) |
| 139 | @rm -rf $@ |
| 140 | $(hide) ln -sf $(BUSYBOX_BINARY) $@ |
| 141 | |
| 142 | ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS) |
| 143 | |
| 144 | # We need this so that the installed files could be picked up based on the |
| 145 | # local module name |
| 146 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ |
| 147 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS) |
| 148 | |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 149 | |
codeworkx | 258ba0c | 2011-09-08 21:25:43 +0200 | [diff] [blame] | 150 | # Static Busybox |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 151 | |
| 152 | include $(CLEAR_VARS) |
| 153 | BUSYBOX_CONFIG:=full |
| 154 | BUSYBOX_SUFFIX:=static |
| 155 | LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES) |
| 156 | LOCAL_C_INCLUDES := $(BUSYBOX_C_INCLUDES) |
| 157 | LOCAL_CFLAGS := $(BUSYBOX_CFLAGS) |
| 158 | LOCAL_CFLAGS += \ |
| 159 | -Dgetusershell=busybox_getusershell \ |
| 160 | -Dsetusershell=busybox_setusershell \ |
| 161 | -Dendusershell=busybox_endusershell \ |
| 162 | -Dttyname_r=busybox_ttyname_r \ |
| 163 | -Dgetmntent=busybox_getmntent \ |
| 164 | -Dgetmntent_r=busybox_getmntent_r \ |
| 165 | -Dgenerate_uuid=busybox_generate_uuid |
| 166 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Tanguy Pruvot | 985c411 | 2011-10-10 21:28:29 +0200 | [diff] [blame] | 167 | LOCAL_MODULE := static_busybox |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 168 | LOCAL_MODULE_TAGS := optional |
Tanguy Pruvot | 36efc94 | 2011-11-20 14:41:41 +0100 | [diff] [blame] | 169 | LOCAL_STATIC_LIBRARIES := libclearsilverregex libc libcutils libm |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 170 | LOCAL_MODULE_CLASS := UTILITY_EXECUTABLES |
codeworkx | 258ba0c | 2011-09-08 21:25:43 +0200 | [diff] [blame] | 171 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/utilities |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 172 | LOCAL_UNSTRIPPED_PATH := $(PRODUCT_OUT)/symbols/utilities |
| 173 | LOCAL_MODULE_STEM := busybox |
Tanguy Pruvot | 985c411 | 2011-10-10 21:28:29 +0200 | [diff] [blame] | 174 | $(LOCAL_MODULE): busybox_prepare |
Tanguy Pruvot | 8aeb371 | 2011-06-30 08:59:26 +0200 | [diff] [blame] | 175 | include $(BUILD_EXECUTABLE) |