lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | ::------------------------------------------------------------------------------------------
|
| 2 | :: makefile for project
|
| 3 | ::------------------------------------------------------------------------------------------
|
| 4 | BOOTLOADER_PATH=..
|
| 5 | BOOTLOADER_PRJ_PATH=../../prj
|
| 6 |
|
| 7 | ECHO=@
|
| 8 |
|
| 9 | TIMER_START = $(shell date)
|
| 10 | SRCROOT = $(word $(words $(subst /, ,$(subst /common/scripts,,$(shell pwd)))),$(subst /, ,$(subst /common/scripts,,$(shell pwd))))
|
| 11 |
|
| 12 |
|
| 13 | ifeq ($(CHIP_TYPE),ZX297520V3)
|
| 14 | chip=zx297520v3
|
| 15 | endif
|
| 16 |
|
| 17 |
|
| 18 | ifeq ($(BOARD_TYPE),EVB)
|
| 19 | board=evb
|
| 20 | endif
|
| 21 |
|
| 22 | ifeq ($(BOARD_TYPE),MIFI)
|
| 23 | board=mifi
|
| 24 | endif
|
| 25 |
|
| 26 | ifeq ($(BOARD_TYPE),MIFI_MINI)
|
| 27 | board=mifi_mini
|
| 28 | endif
|
| 29 |
|
| 30 | ifeq ($(BOARD_TYPE),MIFI_MINI_XR819)
|
| 31 | board=mifi_mini_xr819
|
| 32 | endif
|
| 33 |
|
| 34 | ifeq ($(BOARD_TYPE),MIFI_MINI_64)
|
| 35 | board=mifi_mini_64
|
| 36 | endif
|
| 37 |
|
| 38 | ifeq ($(BOARD_TYPE),UFI_MINI)
|
| 39 | board=ufi_mini
|
| 40 | endif
|
| 41 |
|
| 42 | ifeq ($(BOARD_TYPE),CPE)
|
| 43 | board=cpe
|
| 44 | endif
|
| 45 |
|
| 46 | ifeq ($(BOARD_TYPE),CPE_SWITCH)
|
| 47 | board=cpe_switch
|
| 48 | endif
|
| 49 |
|
| 50 | ifeq ($(BOARD_TYPE),PHONE)
|
| 51 | board=phone
|
| 52 | endif
|
| 53 |
|
| 54 | ifeq ($(BOARD_TYPE),FWP)
|
| 55 | board=fwp
|
| 56 | endif
|
| 57 |
|
| 58 | ifeq ($(BOARD_TYPE),MDL)
|
| 59 | board=mdl
|
| 60 | endif
|
| 61 |
|
| 62 | ifeq ($(BOARD_TYPE),MDL_AB)
|
| 63 | board=mdl_ab
|
| 64 | endif
|
| 65 |
|
| 66 | ifeq ($(BOARD_TYPE),VEHICLE_DC)
|
| 67 | board=vehicle_dc
|
| 68 | endif
|
| 69 |
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 70 | ifeq ($(BOARD_TYPE),VEHICLE_DC_REF)
|
| 71 | board=vehicle_dc_ref
|
| 72 | endif
|
| 73 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 74 | ifeq ($(BOARD_TYPE),MDL_MINI)
|
| 75 | board=mdl_mini
|
| 76 | endif
|
| 77 |
|
| 78 | ifeq ($(BOARD_TYPE),MDL_MINI_64)
|
| 79 | board=mdl_mini_64
|
| 80 | endif
|
| 81 |
|
| 82 | ifeq ($(BOARD_TYPE),WATCH)
|
| 83 | board=watch
|
| 84 | endif
|
| 85 |
|
| 86 | ifeq ($(BOARD_TYPE),WATCH_CAP)
|
| 87 | board=watch_cap
|
| 88 | endif
|
| 89 |
|
| 90 | ifeq ($(strip $(board)),$(filter $(board),))
|
| 91 | ram_text=0x23EF0000
|
| 92 | V3T_RAM_TEXT_64M_UBOOT=y
|
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 93 | else ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
|
| 94 | ram_text=0x27EF0000
|
| 95 | V3T_RAM_TEXT_128M_UBOOT=y
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 96 | else ifeq ($(strip $(board)),$(filter $(board),vehicle_dc_ref))
|
| 97 | ram_text=0x27EF0000
|
| 98 | V3T_RAM_TEXT_128M_UBOOT=y
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 99 | else
|
| 100 | ram_text=0x21EF0000
|
| 101 | endif
|
| 102 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 103 | ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
|
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 104 | key_path=key/RSA_2048/private.k
|
| 105 | else
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 106 | ifeq ($(strip $(board)),$(filter $(board),vehicle_dc_ref))
|
xf.li | aa4d92f | 2023-09-13 00:18:58 -0700 | [diff] [blame] | 107 | key_path=key/RSA_2048/private.k
|
| 108 | else
|
| 109 | key_path=key/RSA_1024/private.k -t md5
|
| 110 | endif
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 111 | endif
|
| 112 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 113 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 114 |
|
| 115 | export chip board key_path ram_text V3T_RAM_TEXT_64M_UBOOT
|
| 116 |
|
xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame] | 117 | export chip board key_path ram_text V3T_RAM_TEXT_128M_UBOOT
|
| 118 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 119 | default: help
|
| 120 |
|
| 121 | help:
|
| 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 |
|
| 129 | tloader:
|
| 130 | chmod -R 777 ../../../$(SRCROOT)
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 131 | 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 |
|
| 137 | zloader:
|
| 138 | chmod -R 777 ../../../$(SRCROOT)
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 139 | 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 | ::------------------------------------------------------------------------------------------
|
| 152 | make-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 |
|
| 159 | uboot:
|
| 160 | $(call make-uboot,build_uboot.sh)
|
| 161 |
|
| 162 | ::------------------------------------------------------------------------------------------
|
| 163 | :: clean
|
| 164 | ::------------------------------------------------------------------------------------------
|
| 165 | zloaderclean:
|
| 166 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/*load*
|
| 167 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/*load*
|
| 168 | tloaderclean:
|
| 169 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*load*
|
| 170 | loadersrcclean:
|
| 171 | cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_loader_clean.sh
|
| 172 |
|
| 173 | ubootclean:
|
| 174 | ifeq ($(strip $(board)),$(filter $(board),fwp phone))
|
| 175 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/$(lcd)/*boot*
|
| 176 | else
|
| 177 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*boot*
|
| 178 | endif
|
| 179 |
|
| 180 | ubootsrcclean:
|
| 181 | cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_uboot_clean.sh
|
| 182 |
|
| 183 | ::------------------------------------------------------------------------------------------
|
| 184 | :: all
|
| 185 | ::------------------------------------------------------------------------------------------
|
| 186 | all: zloader tloader uboot
|
| 187 | allclean: zloaderclean tloaderclean ubootclean
|
| 188 | bootclean: loadersrcclean ubootsrcclean
|
| 189 |
|
| 190 | klocwork:
|
| 191 | bash $(KLOCWORK_SCRIPT_PATH)/0_flush.sh $(KLOCWORK_WEBUI_PRJ_NAME) allclean all
|
| 192 |
|
| 193 | covall:
|
| 194 | bash $(COVERITY_SCRIPT_PATH)/flush.sh allclean all
|
| 195 | make cov_upload
|
| 196 |
|
| 197 | coverity:
|
| 198 | bash $(COVERITY_SCRIPT_PATH)/flush.sh $(COV_TARGET)
|
| 199 |
|
| 200 | cov_upload:
|
| 201 | bash $(COVERITY_SCRIPT_PATH)/upload.sh $(COVERITY_PRJ_STREAM_NAME)
|
| 202 |
|
| 203 | cov_report:
|
| 204 | bash $(COVERITY_SCRIPT_PATH)/report2.sh
|