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 |
|
| 70 | ifeq ($(BOARD_TYPE),MDL_MINI)
|
| 71 | board=mdl_mini
|
| 72 | endif
|
| 73 |
|
| 74 | ifeq ($(BOARD_TYPE),MDL_MINI_64)
|
| 75 | board=mdl_mini_64
|
| 76 | endif
|
| 77 |
|
| 78 | ifeq ($(BOARD_TYPE),WATCH)
|
| 79 | board=watch
|
| 80 | endif
|
| 81 |
|
| 82 | ifeq ($(BOARD_TYPE),WATCH_CAP)
|
| 83 | board=watch_cap
|
| 84 | endif
|
| 85 |
|
| 86 | ifeq ($(strip $(board)),$(filter $(board),))
|
| 87 | ram_text=0x23EF0000
|
| 88 | V3T_RAM_TEXT_64M_UBOOT=y
|
| 89 | else
|
| 90 | ram_text=0x21EF0000
|
| 91 | endif
|
| 92 |
|
| 93 | ifeq ($(strip $(board)),$(filter $(board),mdl_ab))
|
| 94 | key_path=$(subst _ab,,$(board))
|
| 95 | endif
|
| 96 |
|
| 97 | ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
|
| 98 | key_path=mdl
|
| 99 | endif
|
| 100 |
|
| 101 | ifeq ($(strip $(board)),$(filter $(board),mdl_mini mifi_mini ufi_mini))
|
| 102 | key_path=$(subst _mini,,$(board))
|
| 103 | endif
|
| 104 |
|
| 105 | ifeq ($(strip $(board)),$(filter $(board),mifi_mini_xr819))
|
| 106 | key_path=$(subst _mini_xr819,,$(board))
|
| 107 | endif
|
| 108 |
|
| 109 | ifeq ($(strip $(board)),$(filter $(board),mdl_mini_64 mifi_mini_64))
|
| 110 | key_path=$(subst _mini_64,,$(board))
|
| 111 | endif
|
| 112 |
|
| 113 | ifeq ($(strip $(board)),$(filter $(board),watch_cap))
|
| 114 | key_path=$(subst _cap,,$(board))
|
| 115 | endif
|
| 116 |
|
| 117 | ifeq ($(strip $(board)),$(filter $(board),cpe_switch))
|
| 118 | key_path=$(subst _switch,,$(board))
|
| 119 | endif
|
| 120 |
|
| 121 | ifeq ($(strip $(board)),$(filter $(board),cpe evb fwp mdl mifi phone watch))
|
| 122 | key_path=$(board)
|
| 123 | endif
|
| 124 |
|
| 125 | export chip board key_path ram_text V3T_RAM_TEXT_64M_UBOOT
|
| 126 |
|
| 127 | default: help
|
| 128 |
|
| 129 | help:
|
| 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 |
|
| 137 | tloader:
|
| 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 |
|
| 146 | zloader:
|
| 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 | ::------------------------------------------------------------------------------------------
|
| 162 | make-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 |
|
| 169 | uboot:
|
| 170 | $(call make-uboot,build_uboot.sh)
|
| 171 |
|
| 172 | ::------------------------------------------------------------------------------------------
|
| 173 | :: clean
|
| 174 | ::------------------------------------------------------------------------------------------
|
| 175 | zloaderclean:
|
| 176 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/*load*
|
| 177 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/*load*
|
| 178 | tloaderclean:
|
| 179 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*load*
|
| 180 | loadersrcclean:
|
| 181 | cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_loader_clean.sh
|
| 182 |
|
| 183 | ubootclean:
|
| 184 | ifeq ($(strip $(board)),$(filter $(board),fwp phone))
|
| 185 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/$(lcd)/*boot*
|
| 186 | else
|
| 187 | rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*boot*
|
| 188 | endif
|
| 189 |
|
| 190 | ubootsrcclean:
|
| 191 | cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_uboot_clean.sh
|
| 192 |
|
| 193 | ::------------------------------------------------------------------------------------------
|
| 194 | :: all
|
| 195 | ::------------------------------------------------------------------------------------------
|
| 196 | all: zloader tloader uboot
|
| 197 | allclean: zloaderclean tloaderclean ubootclean
|
| 198 | bootclean: loadersrcclean ubootsrcclean
|
| 199 |
|
| 200 | klocwork:
|
| 201 | bash $(KLOCWORK_SCRIPT_PATH)/0_flush.sh $(KLOCWORK_WEBUI_PRJ_NAME) allclean all
|
| 202 |
|
| 203 | covall:
|
| 204 | bash $(COVERITY_SCRIPT_PATH)/flush.sh allclean all
|
| 205 | make cov_upload
|
| 206 |
|
| 207 | coverity:
|
| 208 | bash $(COVERITY_SCRIPT_PATH)/flush.sh $(COV_TARGET)
|
| 209 |
|
| 210 | cov_upload:
|
| 211 | bash $(COVERITY_SCRIPT_PATH)/upload.sh $(COVERITY_PRJ_STREAM_NAME)
|
| 212 |
|
| 213 | cov_report:
|
| 214 | bash $(COVERITY_SCRIPT_PATH)/report2.sh
|