-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathAndroid.mk
172 lines (160 loc) · 8.2 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#Android makefile to build kernel as a part of Android Build
KERNEL_TOOLCHAIN := /home/gabry3795/cyanogen/bin/gcc-linaro-arm-linux-gnueabihf-4.7/bin
TARGET_KERNEL_CROSS_COMPILE_PREFIX := arm-linux-gnueabihf-
# TO BUILD THE KERNEL WITH ANDROID:
# Symlink the kernel source to out/target/product/mt7_l09/obj/kernel
SYMLINK_KERNEL := $(shell mkdir -p $(TARGET_OUT_INTERMEDIATES) && ln -sf $(shell pwd)/$(TARGET_KERNEL_SOURCE) $(TARGET_OUT_INTERMEDIATES)/kernel)
# ifeq ($(BALONG_TOPDIR),)
# export BALONG_TOPDIR := $(shell pwd)/vendor/hisi
# endif
#
# ifeq ($(OBB_PRODUCT_NAME),)
# export OBB_PRODUCT_NAME := $(HISI_TARGET_PRODUCT)
# endif
#
# HISI_3635_MODEM_DEFCONFIG := vendor/hisi/config/product/$(OBB_PRODUCT_NAME)/os/acore/hi6930_modem_defconfig
# ifeq ($(strip $(TARGET_BOARD_PLATFORM)), hi3635)
# HISI_3635_MODEM_DEFCONFIG := vendor/hisi/config/product/$(OBB_PRODUCT_NAME)/os/acore/hi3635_modem_defconfig
# endif
#
# HISI_3630_MODEM_DEFCONFIG := vendor/hisi/config/product/$(OBB_PRODUCT_NAME)/os/acore/hi6930_modem_defconfig
#
# KERNEL_CONFIG := $(KERNEL_OUT)/.config
#
# ifeq ($(TARGET_ARM_TYPE), arm64)
# KERNEL_ARCH_PREFIX := arm64
# CROSS_COMPILE_PREFIX=aarch64-linux-android-
# TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/arm64/boot/Image
# else
# KERNEL_ARCH_PREFIX := arm
# CROSS_COMPILE_PREFIX=arm-linux-gnueabihf-
# TARGET_PREBUILT_KERNEL := $(KERNEL_OUT)/arch/arm/boot/zImage
# endif
#
# COMMON_HEAD := $(shell pwd)/kernel/drivers/
# COMMON_HEAD += $(shell pwd)/kernel/mm/
# COMMON_HEAD += $(shell pwd)/kernel/include/hisi/
# COMMON_HEAD += $(shell pwd)/vendor/hisi/ap/config/product/$(OBB_PRODUCT_NAME)/include/
# COMMON_HEAD += $(shell pwd)/external/efipartition
# ifeq ($(HISI_TARGET_PRODUCT), hi6210sft)
# COMMON_HEAD += $(shell pwd)/vendor/hisi/ap/platform/hi6210sft/
# endif
#
# ifneq ($(COMMON_HEAD),)
# BALONG_INC := $(patsubst %,-I%,$(COMMON_HEAD))
# else
# BALONG_INC :=
# endif
#
# export BALONG_INC
#
# KERNEL_N_TARGET ?= vmlinux
# UT_EXTRA_CONFIG ?=
#
# KERNEL_ARCH_ARM_CONFIGS := $(shell pwd)/kernel/arch/$(KERNEL_ARCH_PREFIX)/configs
# KERNEL_GEN_CONFIG_FILE := hw_$(TARGET_PRODUCT)_defconfig
# KERNEL_GEN_CONFIG_PATH := $(KERNEL_ARCH_ARM_CONFIGS)/$(KERNEL_GEN_CONFIG_FILE)
#
# KERNEL_COMMON_DEFCONFIG := $(KERNEL_ARCH_ARM_CONFIGS)/$(KERNEL_DEFCONFIG)
# KERNEL_PRODUCT_CONFIGS := $(shell pwd)/device/hisi/customize/config/${TARGET_ARM_TYPE}/$(TARGET_DEVICE)/${TARGET_PRODUCT}/product_config/kernel_config
# ifeq ($(strip $(TARGET_PRODUCT)), hisi_pilot)
# KERNEL_PRODUCT_CONFIGS := $(shell pwd)/device/hisi/customize/config/${TARGET_ARM_TYPE}/hi6220/${TARGET_PRODUCT}/product_config/kernel_config
# endif
#
# define DTS_PARSE_CONFIG
# @echo generating dtsi files, please wait for minutes!
# @cd device/hisi/customize/build_script; ./auto_dts_gen.sh > $(ANDROID_BUILD_TOP)/auto_dts_gen.log 2>&1
# endef
# HI3XXX_MODEM_DIR := $(shell pwd)/vendor/hisi/modem/drv/acore/kernel/drivers/modem
# ifeq ($(wildcard $(HI3XXX_MODEM_DIR)),)
# $(HI3XXX_MODEM_DIR):
# @mkdir -p $(HI3XXX_MODEM_DIR)
# @touch $(HI3XXX_MODEM_DIR)/Makefile
# @touch $(HI3XXX_MODEM_DIR)/Kconfig
# endif
#
# HI6XXX_MODEM_DRV_DIR := $(shell pwd)/vendor/hisi/modem/drv820/common/src/acore
# ifeq ($(wildcard $(HI6XXX_MODEM_DRV_DIR)),)
# $(HI6XXX_MODEM_DRV_DIR):
# @mkdir -p $(HI6XXX_MODEM_DRV_DIR)
# @touch $(HI6XXX_MODEM_DRV_DIR)/Makefile
# @touch $(HI6XXX_MODEM_DRV_DIR)/Kconfig
# endif
# HISI_PILOT_KERNEL_DIR := $(shell pwd)/kernel/drivers/hisi_pilot/
# DEPENDENCY_FILELIST := $(shell find $(ANDROID_BUILD_TOP)/device/hisi/customize/config/$(KERNEL_ARCH_PREFIX)/$(TARGET_BOARD_PLATFORM)/$(TARGET_PRODUCT)/board_config -name config.dts -type f 2>/dev/null | xargs echo)
# DEPENDENCY_FILELIST += $(shell find $(ANDROID_BUILD_TOP)/device/hisi/customize/dtsi/$(KERNEL_ARCH_PREFIX)/$(TARGET_BOARD_PLATFORM) -type f 2>/dev/null | xargs echo)
# DEPENDENCY_FILELIST += $(shell find $(ANDROID_BUILD_TOP)/device/hisi/customize/config/$(KERNEL_ARCH_PREFIX)/$(TARGET_BOARD_PLATFORM)/$(TARGET_PRODUCT)/board_config -name iomux.xml -type f 2>/dev/null | xargs echo)
# DEPENDENCY_FILELIST += $(shell find $(ANDROID_BUILD_TOP)/vendor/huawei/extra/power/batt_raw_data/data/$(TARGET_BOARD_PLATFORM) -name "*.xlsx" -type f 2>/dev/null | xargs echo)
# DEPENDENCY_FILELIST += $(shell find $(ANDROID_BUILD_TOP)/vendor/huawei_platform/power/batt_raw_data/data/$(TARGET_BOARD_PLATFORM) -name "*.xlsx" -type f 2>/dev/null | xargs echo)
# ifneq ($(filter hi3635fpga hi3635 hi3635emulator, $(TARGET_BOARD_PLATFORM)),)
# ifeq ($(strip $(CFG_HISI_MINI_AP)), false)
# APPEND_MODEM_DEFCONFIG := cat $(HISI_3635_MODEM_DEFCONFIG) >> $(KERNEL_GEN_CONFIG_PATH)
# endif
# endif
# ifneq ($(filter hi3630 , $(TARGET_BOARD_PLATFORM)),)
# ifeq ($(strip $(CFG_HISI_MINI_AP)), false)
# APPEND_MODEM_DEFCONFIG := cat $(HISI_3630_MODEM_DEFCONFIG) >> $(KERNEL_GEN_CONFIG_PATH); echo >> $(KERNEL_GEN_CONFIG_PATH); echo "CONFIG_HISI_BALONG_MODEM_HI3630=y" >> $(KERNEL_GEN_CONFIG_PATH)
# endif
# endif
#
# GENERATE_DTB := $(KERNEL_OUT)/.timestamp
# $(GENERATE_DTB):$(DEPENDENCY_FILELIST) $(KERNEL_CONFIG)
# $(DTS_PARSE_CONFIG)
# make -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) dtbs;touch $@
#
# $(KERNEL_GEN_CONFIG_PATH): $(KERNEL_COMMON_DEFCONFIG) $(wildcard $(KERNEL_PRODUCT_CONFIGS)/*)
# $(hide) echo GENERATING $(KERNEL_GEN_CONFIG_FILE) ...
# $(ANDROID_BUILD_TOP)/device/hisi/customize/build_script/kernel-config.sh -f $(KERNEL_COMMON_DEFCONFIG) -d $(KERNEL_PRODUCT_CONFIGS) -o $(KERNEL_GEN_CONFIG_PATH)
# $(APPEND_MODEM_DEFCONFIG)
# ifeq ($(OBB_PRINT_CMD), true)
# $(KERNEL_CONFIG): MAKEFLAGS :=
# $(KERNEL_CONFIG):
# mkdir -p $(KERNEL_OUT)
# $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) hisi_$(TARGET_PRODUCT)_defconfig
# else
# ifeq ($(HISI_PILOT_LIBS), true)
# $(KERNEL_CONFIG): $(KERNEL_GEN_CONFIG_PATH) $(HI3XXX_MODEM_DIR) $(HI6XXX_MODEM_DRV_DIR) HISI_PILOT_PREBUILD
# else
# $(KERNEL_CONFIG): $(KERNEL_GEN_CONFIG_PATH) $(HI3XXX_MODEM_DIR) $(HI6XXX_MODEM_DRV_DIR)
# endif
# mkdir -p $(KERNEL_OUT)
# $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) $(KERNEL_GEN_CONFIG_FILE)
# endif
#
# $(TARGET_PREBUILT_KERNEL): FORCE $(KERNEL_CONFIG)
# ifeq ($(OBB_PRINT_CMD), true)
# $(hide) $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) $(KERNEL_N_TARGET) $(UT_EXTRA_CONFIG)
# touch $(TARGET_PREBUILT_KERNEL)
# else
# $(hide) $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX)
# touch $(TARGET_PREBUILT_KERNEL)
# endif
#
# HISI_PILOT_PREBUILD:
# $(hide) rm -rf kernel/include/huawei_platform
# $(hide) rm -rf kernel/include/modem
# $(hide) rm -rf kernel/drivers/huawei_platform
# $(hide) rm -rf kernel/drivers/huawei_platform_legacy
# $(hide) rm -rf kernel/drivers/hisi/modem_hi6xxx
# $(hide) rm -rf kernel/drivers/device-depend-arm64
# $(hide) cp -rf $(HISI_PILOT_TOPDIR)kernel/include/huawei_platform kernel/include/.
# $(hide) cp -rf $(HISI_PILOT_TOPDIR)kernel/drivers/huawei_platform kernel/drivers/
# $(hide) cp -rf $(HISI_PILOT_TOPDIR)kernel/drivers/huawei_platform_legacy kernel/drivers/
# $(hide) cp -rf $(HISI_PILOT_TOPDIR)kernel/drivers/hisi/modem_hi6xxx kernel/drivers/hisi/.
# $(hide) cp $(HISI_PILOT_KERNEL_DIR)/Makefile.pilot $(HISI_PILOT_KERNEL_DIR)/Makefile
# $(hide) cp $(HISI_PILOT_KERNEL_DIR)/Kconfig.pilot $(HISI_PILOT_KERNEL_DIR)/Kconfig
# ifeq ($(TARGET_VERSION_MODE),factory)
# $(hide) cd kernel/drivers/; ln -s ../../vendor/hisi_pilot/libs_factory/kernel/drivers/device-depend-arm64 device-depend-arm64
# else
# $(hide) cd kernel/drivers/; ln -s ../../vendor/hisi_pilot/libs/kernel/drivers/device-depend-arm64 device-depend-arm64
# endif
#
# # kernelconfig: $(KERNEL_GEN_CONFIG_PATH)
# # mkdir -p $(KERNEL_OUT)
# # $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) $(KERNEL_GEN_CONFIG_FILE) menuconfig
# #
# # zImage Image:$(TARGET_PREBUILT_KERNEL)
# # @mkdir -p $(dir $(INSTALLED_KERNEL_TARGET))
# # @cp -fp $(TARGET_PREBUILT_KERNEL) $(INSTALLED_KERNEL_TARGET)
# pclint_kernel: $(KERNEL_CONFIG)
# $(hide) $(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=$(KERNEL_ARCH_PREFIX) CROSS_COMPILE=$(CROSS_COMPILE_PREFIX) pc_lint_all