forked from fefifofum/android_kernel_bq_maxwell2qc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AndroidKernel.mk
executable file
·66 lines (52 loc) · 1.76 KB
/
AndroidKernel.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
#Android makefile to build kernel as a part of Android Build
TARGET_PREBUILT_INT_KERNEL := kernel/arch/arm/boot/zImage
TARGET_PREBUILT_KERNEL := $(TARGET_PREBUILT_INT_KERNEL)
LOGO_FILE := kernel/drivers/video/logo/logo_linux_clut224.o
file_exist:=$(shell if [ -f $(LOGO_FILE) ]; then echo "exist"; else echo "notexist"; fi;)
KERNEL_MALATA_DEFCONFIG := malata_kernel_tmp_defconfig
KERNEL_ROOT_CONFIG_PATH := kernel/arch/arm/configs/
KERNEL_TMP_DEFCONFIG := $(KERNEL_ROOT_CONFIG_PATH)$(KERNEL_MALATA_DEFCONFIG)
tmp_config_exist:=$(shell if [ -f $(KERNEL_TMP_DEFCONFIG) ]; then echo "exist"; else echo "notexist"; fi;)
define generate-config
cp kernel/arch/arm/configs/$(KERNEL_DEFCONFIG) $(KERNEL_TMP_DEFCONFIG)
for param in $(KERNEL_SPECIAL_CONFIG); \
do \
echo $$param >> $(KERNEL_TMP_DEFCONFIG); \
done
for param in $(KERNEL_DEL_SPECIAL_CONFIG); \
do \
sed -i "s/$$param/#$$param/g" $(KERNEL_TMP_DEFCONFIG); \
done
endef
define copy-kernel-image
cp kernel/arch/arm/boot/Image $(PRODUCT_OUT)/kernel
endef
ifneq ($(KERNEL_DEFCONFIG), )
$(KERNEL_CONFIG):
$(MAKE) -C kernel $(KERNEL_MALATA_DEFCONFIG)
$(TARGET_PREBUILT_INT_KERNEL):
ifneq ($(KERNEL_LOGO_FILE), )
cp $(KERNEL_LOGO_FILE) kernel/drivers/video/logo/
ifeq ($(file_exist), exist)
rm $(LOGO_FILE)
else
echo "$(LOGO_FILE) not exist"
endif
endif
ifeq ($(tmp_config_exist), exist)
rm $(KERNEL_TMP_DEFCONFIG)
endif
$(generate-config)
$(MAKE) -C kernel $(KERNEL_MALATA_DEFCONFIG)
$(MAKE) -C kernel kernel.img
$(copy-kernel-image)
kernelconfig: $(KERNEL_CONFIG)
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel menuconfig
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel savedefconfig
cp kernel/defconfig kernel/arch/arm/configs/$(KERNEL_DEFCONFIG)
else
$(TARGET_PREBUILT_INT_KERNEL):
$(copy-kernel-image)
endif