blob: ffa572494681264a4ea6f1205591ab8338cb4417 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001::------------------------------------------------------------------------------------------
2:: makefile for project
3::------------------------------------------------------------------------------------------
4BOOTLOADER_PATH=..
5BOOTLOADER_PRJ_PATH=../../prj
6
7ECHO=@
8
9TIMER_START = $(shell date)
10SRCROOT = $(word $(words $(subst /, ,$(subst /common/scripts,,$(shell pwd)))),$(subst /, ,$(subst /common/scripts,,$(shell pwd))))
11
12
13ifeq ($(CHIP_TYPE),ZX297520V3)
14chip=zx297520v3
15endif
16
17
18ifeq ($(BOARD_TYPE),EVB)
19board=evb
20endif
21
22ifeq ($(BOARD_TYPE),MIFI)
23board=mifi
24endif
25
26ifeq ($(BOARD_TYPE),MIFI_MINI)
27board=mifi_mini
28endif
29
30ifeq ($(BOARD_TYPE),MIFI_MINI_XR819)
31board=mifi_mini_xr819
32endif
33
34ifeq ($(BOARD_TYPE),MIFI_MINI_64)
35board=mifi_mini_64
36endif
37
38ifeq ($(BOARD_TYPE),UFI_MINI)
39board=ufi_mini
40endif
41
42ifeq ($(BOARD_TYPE),CPE)
43board=cpe
44endif
45
46ifeq ($(BOARD_TYPE),CPE_SWITCH)
47board=cpe_switch
48endif
49
50ifeq ($(BOARD_TYPE),PHONE)
51board=phone
52endif
53
54ifeq ($(BOARD_TYPE),FWP)
55board=fwp
56endif
57
58ifeq ($(BOARD_TYPE),MDL)
59board=mdl
60endif
61
62ifeq ($(BOARD_TYPE),MDL_AB)
63board=mdl_ab
64endif
65
66ifeq ($(BOARD_TYPE),VEHICLE_DC)
67board=vehicle_dc
68endif
69
70ifeq ($(BOARD_TYPE),MDL_MINI)
71board=mdl_mini
72endif
73
74ifeq ($(BOARD_TYPE),MDL_MINI_64)
75board=mdl_mini_64
76endif
77
78ifeq ($(BOARD_TYPE),WATCH)
79board=watch
80endif
81
82ifeq ($(BOARD_TYPE),WATCH_CAP)
83board=watch_cap
84endif
85
86ifeq ($(strip $(board)),$(filter $(board),))
87 ram_text=0x23EF0000
88 V3T_RAM_TEXT_64M_UBOOT=y
89else
90 ram_text=0x21EF0000
91endif
92
93ifeq ($(strip $(board)),$(filter $(board),mdl_ab))
94 key_path=$(subst _ab,,$(board))
95endif
96
97ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
98 key_path=mdl
99endif
100
101ifeq ($(strip $(board)),$(filter $(board),mdl_mini mifi_mini ufi_mini))
102 key_path=$(subst _mini,,$(board))
103endif
104
105ifeq ($(strip $(board)),$(filter $(board),mifi_mini_xr819))
106 key_path=$(subst _mini_xr819,,$(board))
107endif
108
109ifeq ($(strip $(board)),$(filter $(board),mdl_mini_64 mifi_mini_64))
110 key_path=$(subst _mini_64,,$(board))
111endif
112
113ifeq ($(strip $(board)),$(filter $(board),watch_cap))
114 key_path=$(subst _cap,,$(board))
115endif
116
117ifeq ($(strip $(board)),$(filter $(board),cpe_switch))
118 key_path=$(subst _switch,,$(board))
119endif
120
121ifeq ($(strip $(board)),$(filter $(board),cpe evb fwp mdl mifi phone watch))
122 key_path=$(board)
123endif
124
125export chip board key_path ram_text V3T_RAM_TEXT_64M_UBOOT
126
127default: help
128
129help:
130 @echo "================== Make help ==================="
131 @echo "make [help] help"
132 @echo "make all[clean] compile all && link"
133 @echo "make zloader[clean] build zloader"
134 @echo "make tloader[clean] build tloader"
135 @echo "make uboot[clean] build uboot"
136
137tloader:
138 chmod -R 777 ../../../$(SRCROOT)
139 cp -rf $(BOOTLOADER_PRJ_PATH)/../../tools/SignImage/test_key/$(key_path)/key.h $(BOOTLOADER_PATH)/src/loader/include
140 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_tloader.sh
141 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load
142 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load.map
143 @echo "$(TIMER_START)"
144 @date
145
146zloader:
147 chmod -R 777 ../../../$(SRCROOT)
148 cp -rf $(BOOTLOADER_PRJ_PATH)/../../tools/SignImage/test_key/$(key_path)/key.h $(BOOTLOADER_PATH)/src/loader/include
149 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dlon.sh
150 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load
151 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load.map
152
153 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dloff.sh
154 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load
155 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load.map
156 @echo "$(TIMER_START)"
157 @date
158
159::------------------------------------------------------------------------------------------
160:: º¯Êý¶¨Ò壬עÒ⺯Êý¶¨Òå»»ÐкóÊǿոñ£¬²»ÊÇtab
161::------------------------------------------------------------------------------------------
162make-uboot = \
163 chmod -R 777 ../../../$(SRCROOT); \
164 cp -rf $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/config/uboot/* $(BOOTLOADER_PATH)/src/uboot; \
165 cd $(BOOTLOADER_PATH)/scripts/build && sh ./$(1); \
166 echo "$(TIMER_START)"; \
167 date;
168
169uboot:
170 $(call make-uboot,build_uboot.sh)
171
172::------------------------------------------------------------------------------------------
173:: clean
174::------------------------------------------------------------------------------------------
175zloaderclean:
176 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/*load*
177 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/*load*
178tloaderclean:
179 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*load*
180loadersrcclean:
181 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_loader_clean.sh
182
183ubootclean:
184ifeq ($(strip $(board)),$(filter $(board),fwp phone))
185 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/$(lcd)/*boot*
186else
187 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*boot*
188endif
189
190ubootsrcclean:
191 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_uboot_clean.sh
192
193::------------------------------------------------------------------------------------------
194:: all
195::------------------------------------------------------------------------------------------
196all: zloader tloader uboot
197allclean: zloaderclean tloaderclean ubootclean
198bootclean: loadersrcclean ubootsrcclean
199
200klocwork:
201 bash $(KLOCWORK_SCRIPT_PATH)/0_flush.sh $(KLOCWORK_WEBUI_PRJ_NAME) allclean all
202
203covall:
204 bash $(COVERITY_SCRIPT_PATH)/flush.sh allclean all
205 make cov_upload
206
207coverity:
208 bash $(COVERITY_SCRIPT_PATH)/flush.sh $(COV_TARGET)
209
210cov_upload:
211 bash $(COVERITY_SCRIPT_PATH)/upload.sh $(COVERITY_PRJ_STREAM_NAME)
212
213cov_report:
214 bash $(COVERITY_SCRIPT_PATH)/report2.sh