-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndroidBoard.mk
75 lines (65 loc) · 2.28 KB
/
AndroidBoard.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
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := mtk-kpd.kcm
include $(BUILD_KEY_CHAR_MAP)
##################################
$(call config-custom-folder,modem:modem)
##### SET MD OUTPUT POSITION #####
ifeq ($(strip $(MTK_CIP_SUPPORT)),yes)
MTK_MODEM_OUT_ETC := $(TARGET_CUSTOM_OUT)/etc
else
MTK_MODEM_OUT_ETC := $(TARGET_OUT_ETC)
endif
MTK_MODEM_LOCAL_PATH := $(LOCAL_PATH)
MTK_MODEM_INSTALLED_MODULES :=
MTK_MODEM_SRC_FIRMWARE := modem*.img
ifeq ($(strip $(MTK_MDLOGGER_SUPPORT)),yes)
MTK_MODEM_SRC_FIRMWARE += catcher_filter*.bin
endif
MTK_MODEM_MAP_VALUE_TO_X := 1 2
MTK_MODEM_MAP_X_1_TO_YY := 2g wg tg
MTK_MODEM_MAP_X_2_TO_YY := 2g wg tg
define mtk-install-modem
include $$(CLEAR_VARS)
LOCAL_MODULE := $$(notdir $(1))
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(2)
LOCAL_SRC_FILES := $(1)
include $$(BUILD_PREBUILT)
MTK_MODEM_INSTALLED_MODULES += $$(LOCAL_INSTALLED_MODULE)
endef
##### INSTALL MODEM FIRMWARE #####
$(foreach x,$(MTK_MODEM_MAP_VALUE_TO_X),\
$(if $(filter yes,$(strip $(MTK_ENABLE_MD$(x)))),\
$(foreach yy,$(MTK_MODEM_MAP_X_$(x)_TO_YY),\
$(if $(wildcard $(MTK_MODEM_LOCAL_PATH)/modem/modem_$(x)_$(yy)_n.img),\
$(foreach src,$(MTK_MODEM_SRC_FIRMWARE) $(MTK_MODEM_SRC_FIRMWARE_$(x)),\
$(eval des := $(subst *,_$(x)_$(yy)_n,$(src)))\
$(eval $(call mtk-install-modem,modem/$(des),$(MTK_MODEM_OUT_ETC)/firmware))\
)\
)\
)\
)\
)
########INSTALL MODEM_DATABASE########
ifeq ($(strip $(MTK_INCLUDE_MODEM_DB_IN_IMAGE)),yes)
ifeq ($(filter generic banyan_addon banyan_addon_x86,$(PROJECT)),)
$(foreach x,$(MTK_MODEM_MAP_VALUE_TO_X),\
$(if $(filter yes,$(strip $(MTK_ENABLE_MD$(x)))),\
$(foreach yy,$(MTK_MODEM_MAP_X_$(x)_TO_YY),\
$(if $(wildcard $(MTK_MODEM_LOCAL_PATH)/modem/BPLGUInfoCustomAppSrcP_*_$(x)_$(yy)_n),\
$(eval MTK_MODEM_SRC_MDDB := $(wildcard $(MTK_MODEM_LOCAL_PATH)/modem/BPLGUInfoCustomAppSrcP_*_$(x)_$(yy)_n))\
,\
$(eval MTK_MODEM_SRC_MDDB := $(wildcard $(MTK_MODEM_LOCAL_PATH)/modem/BPLGUInfoCustomApp_*_$(x)_$(yy)_n))\
)\
$(foreach src,$(MTK_MODEM_SRC_MDDB),\
$(eval des := $(notdir $(src)))\
$(eval $(call mtk-install-modem,modem/$(des),$(MTK_MODEM_OUT_ETC)/mddb))\
)\
)\
)\
)
endif
endif
##################################
$(info MTK_MODEM_INSTALLED_MODULES = $(MTK_MODEM_INSTALLED_MODULES))