blob: f71c564ed69e59b7c2577df8dcf1989340214770 [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
xf.li6c8fc1e2023-08-12 00:11:09 -070070ifeq ($(BOARD_TYPE),VEHICLE_DC_REF)
71board=vehicle_dc_ref
72endif
73
lh9ed821d2023-04-07 01:36:19 -070074ifeq ($(BOARD_TYPE),MDL_MINI)
75board=mdl_mini
76endif
77
78ifeq ($(BOARD_TYPE),MDL_MINI_64)
79board=mdl_mini_64
80endif
81
82ifeq ($(BOARD_TYPE),WATCH)
83board=watch
84endif
85
86ifeq ($(BOARD_TYPE),WATCH_CAP)
87board=watch_cap
88endif
89
90ifeq ($(strip $(board)),$(filter $(board),))
91 ram_text=0x23EF0000
92 V3T_RAM_TEXT_64M_UBOOT=y
xf.libdd93d52023-05-12 07:10:14 -070093else ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
94 ram_text=0x27EF0000
95 V3T_RAM_TEXT_128M_UBOOT=y
xf.li6c8fc1e2023-08-12 00:11:09 -070096else ifeq ($(strip $(board)),$(filter $(board),vehicle_dc_ref))
97 ram_text=0x27EF0000
98 V3T_RAM_TEXT_128M_UBOOT=y
lh9ed821d2023-04-07 01:36:19 -070099else
100 ram_text=0x21EF0000
101endif
102
lh9ed821d2023-04-07 01:36:19 -0700103ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
xf.liaa4d92f2023-09-13 00:18:58 -0700104 key_path=key/RSA_2048/private.k
105else
xf.li6c8fc1e2023-08-12 00:11:09 -0700106ifeq ($(strip $(board)),$(filter $(board),vehicle_dc_ref))
xf.liaa4d92f2023-09-13 00:18:58 -0700107 key_path=key/RSA_2048/private.k
108else
109 key_path=key/RSA_1024/private.k -t md5
110endif
xf.li6c8fc1e2023-08-12 00:11:09 -0700111endif
112
lh9ed821d2023-04-07 01:36:19 -0700113
lh9ed821d2023-04-07 01:36:19 -0700114
115export chip board key_path ram_text V3T_RAM_TEXT_64M_UBOOT
116
xf.libdd93d52023-05-12 07:10:14 -0700117export chip board key_path ram_text V3T_RAM_TEXT_128M_UBOOT
118
lh9ed821d2023-04-07 01:36:19 -0700119default: help
120
121help:
122 @echo "================== Make help ==================="
123 @echo "make [help] help"
124 @echo "make all[clean] compile all && link"
125 @echo "make zloader[clean] build zloader"
126 @echo "make tloader[clean] build tloader"
127 @echo "make uboot[clean] build uboot"
128
129tloader:
130 chmod -R 777 ../../../$(SRCROOT)
lh9ed821d2023-04-07 01:36:19 -0700131 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_tloader.sh
132 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load
133 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load.map
134 @echo "$(TIMER_START)"
135 @date
136
137zloader:
138 chmod -R 777 ../../../$(SRCROOT)
lh9ed821d2023-04-07 01:36:19 -0700139 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dlon.sh
140 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load
141 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load.map
142
143 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dloff.sh
144 @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load
145 @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load.map
146 @echo "$(TIMER_START)"
147 @date
148
149::------------------------------------------------------------------------------------------
150:: º¯Êý¶¨Ò壬עÒ⺯Êý¶¨Òå»»ÐкóÊǿոñ£¬²»ÊÇtab
151::------------------------------------------------------------------------------------------
152make-uboot = \
153 chmod -R 777 ../../../$(SRCROOT); \
154 cp -rf $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/config/uboot/* $(BOOTLOADER_PATH)/src/uboot; \
155 cd $(BOOTLOADER_PATH)/scripts/build && sh ./$(1); \
156 echo "$(TIMER_START)"; \
157 date;
158
159uboot:
160 $(call make-uboot,build_uboot.sh)
161
162::------------------------------------------------------------------------------------------
163:: clean
164::------------------------------------------------------------------------------------------
165zloaderclean:
166 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/*load*
167 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/*load*
168tloaderclean:
169 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*load*
170loadersrcclean:
171 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_loader_clean.sh
172
173ubootclean:
174ifeq ($(strip $(board)),$(filter $(board),fwp phone))
175 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/$(lcd)/*boot*
176else
177 rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*boot*
178endif
179
180ubootsrcclean:
181 cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_uboot_clean.sh
182
183::------------------------------------------------------------------------------------------
184:: all
185::------------------------------------------------------------------------------------------
186all: zloader tloader uboot
187allclean: zloaderclean tloaderclean ubootclean
188bootclean: loadersrcclean ubootsrcclean
189
190klocwork:
191 bash $(KLOCWORK_SCRIPT_PATH)/0_flush.sh $(KLOCWORK_WEBUI_PRJ_NAME) allclean all
192
193covall:
194 bash $(COVERITY_SCRIPT_PATH)/flush.sh allclean all
195 make cov_upload
196
197coverity:
198 bash $(COVERITY_SCRIPT_PATH)/flush.sh $(COV_TARGET)
199
200cov_upload:
201 bash $(COVERITY_SCRIPT_PATH)/upload.sh $(COVERITY_PRJ_STREAM_NAME)
202
203cov_report:
204 bash $(COVERITY_SCRIPT_PATH)/report2.sh