-
Notifications
You must be signed in to change notification settings - Fork 367
/
Android.mk
94 lines (80 loc) · 3 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
LOCAL_PATH := $(call my-dir)
# Make a static library for clearsilver's regex. This prevents multiple
# symbol definition error.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := ../clearsilver/util/regex/regex.c
LOCAL_MODULE := libclearsilverregex
LOCAL_C_INCLUDES := \
external/clearsilver \
external/clearsilver/util/regex
include $(BUILD_STATIC_LIBRARY)
SUBMAKE := make -s -C $(LOCAL_PATH) CC=$(CC)
KERNEL_MODULES_DIR?=/system/modules/lib/modules
BUSYBOX_SRC_FILES = $(shell cat $(LOCAL_PATH)/busybox-$(BUSYBOX_CONFIG).sources) \
libbb/android.c
ifeq ($(strip $(CYANOGEN_BIONIC)),true)
ifeq ($(TARGET_ARCH),arm)
BUSYBOX_SRC_FILES += \
android/libc/arch-arm/syscalls/adjtimex.S \
android/libc/arch-arm/syscalls/getsid.S \
android/libc/arch-arm/syscalls/stime.S \
android/libc/arch-arm/syscalls/swapon.S \
android/libc/arch-arm/syscalls/swapoff.S \
android/libc/arch-arm/syscalls/sysinfo.S
endif
endif
BUSYBOX_C_INCLUDES = \
$(LOCAL_PATH)/include-$(BUSYBOX_CONFIG) \
$(LOCAL_PATH)/include $(LOCAL_PATH)/libbb \
external/clearsilver \
external/clearsilver/util/regex \
bionic/libc/private \
libc/kernel/common
BUSYBOX_CFLAGS = \
-std=gnu99 \
-Werror=implicit \
-DNDEBUG \
-DANDROID_CHANGES \
-include include-$(BUSYBOX_CONFIG)/autoconf.h \
-D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \
-D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion))$(BUSYBOX_CONFIG)"' -DBB_BT=AUTOCONF_TIMESTAMP
include $(CLEAR_VARS)
BUSYBOX_CONFIG:=full
LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES)
LOCAL_C_INCLUDES := $(BUSYBOX_C_INCLUDES)
LOCAL_CFLAGS := $(BUSYBOX_CFLAGS)
LOCAL_MODULE := busybox
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_STATIC_LIBRARIES += libclearsilverregex
include $(BUILD_EXECUTABLE)
BUSYBOX_LINKS := $(shell cat $(LOCAL_PATH)/busybox-$(BUSYBOX_CONFIG).links)
# nc is provided by external/netcat
exclude := nc
SYMLINKS := $(addprefix $(TARGET_OUT_OPTIONAL_EXECUTABLES)/,$(filter-out $(exclude),$(notdir $(BUSYBOX_LINKS))))
$(SYMLINKS): BUSYBOX_BINARY := $(LOCAL_MODULE)
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE)
@echo "Symlink: $@ -> $(BUSYBOX_BINARY)"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf $(BUSYBOX_BINARY) $@
ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
# We need this so that the installed files could be picked up based on the
# local module name
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
# Build a static busybox for the recovery image
include $(CLEAR_VARS)
BUSYBOX_CONFIG:=minimal
LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES)
LOCAL_C_INCLUDES := $(BUSYBOX_C_INCLUDES)
LOCAL_CFLAGS := -Dmain=busybox_driver $(BUSYBOX_CFLAGS)
LOCAL_CFLAGS += \
-Dgetusershell=busybox_getusershell \
-Dsetusershell=busybox_setusershell \
-Dendusershell=busybox_endusershell \
-Dttyname_r=busybox_ttyname_r \
-Dgetmntent=busybox_getmntent \
-Dgetmntent_r=busybox_getmntent_r
LOCAL_MODULE := libbusybox
LOCAL_STATIC_LIBRARIES += libclearsilverregex libcutils libc libm
include $(BUILD_STATIC_LIBRARY)