⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gsm2.mak

📁 MTK分布式编译需要修改的文件。配合incredibuild3就可以使用了。
💻 MAK
📖 第 1 页 / 共 5 页
字号:
		($(LINK) $(VIA) make\~sortedLibs.tmp > $(LOG) 2>&1) \
	else \
		($(LINK) $(VIA) make\~sortedLibs.tmp > $(LOG) )
endif
   # -----------------------------
   # The size of the binary image depends on the available memory on the target
   # platform.
   # -----------------------------
	@echo Creating binary file $(BIN_FILE)
	$(BIN_CREATE) $(strip $(TARGDIR))\$(IMG_FILE) $(BIN_FORMAT) -output $(strip $(TARGDIR))\$(BIN_FILE)
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
ifneq ($(findstring JRD,$(call Upper,$(strip $(CUSTOMER)))),)
	$(BIN_CREATE) $(strip $(TARGDIR))\$(IMG_FILE) -m32 -output $(strip $(TARGDIR))\$(patsubst %.bin,%.m32,$(strip $(BIN_FILE)))
endif
endif
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM  \
		(@if /I "$(strip $(UID_SUPPORT))" EQU "TRUE"  .\tools\update_img.exe -sym $(strip $(TARGDIR))\$(TARGNAME).sym -path $(strip $(TARGDIR))\$(BIN_FILE)\ROM) & \
		(@if /I "$(strip $(NAND_FLASH_BOOTING))" NEQ "TRUE" \
		  (@echo Combine resource images with original ROM) & \
		  ($(CATBIN) -p $(strip $(TARGDIR))\$(BIN_FILE) -s $(SCATTERFILE) -o $(strip $(TARGDIR))\$(strip $(BIN_FILE))\JTAG_$(BIN_FILE)) \
		) & \
		(@if exist $(strip $(FLASHFILE)) \
			   (perl .\tools\append2.pl $(strip $(TARGDIR))\$(TARGNAME).sym $(strip $(FLASHFILE)) $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM $(call Upper,$(strip $(BIN_FILE))) $(VERNO) $(strip $(THE_MF)) $(MEMORY_CFG) $(strip $(SCATTERFILE))) >> $(LOG) \
			else \
			   (perl .\tools\append2.pl $(strip $(TARGDIR))\$(TARGNAME).sym $(FLASH_CFG) $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM $(call Upper,$(strip $(BIN_FILE))) $(VERNO) $(strip $(THE_MF)) $(EMI_INFO) $(strip $(SCATTERFILE))) >> $(LOG) \
		)

	@if not exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM  \
	   (@if /I "$(strip $(UID_SUPPORT))" EQU "TRUE"  .\tools\update_img.exe -sym $(strip $(TARGDIR))\$(TARGNAME).sym -path $(strip $(TARGDIR))\$(BIN_FILE)) & \
		(@if exist $(strip $(FLASHFILE)) \
			(perl .\tools\append2.pl $(strip $(TARGDIR))\$(TARGNAME).sym $(strip $(FLASHFILE)) $(strip $(TARGDIR))\$(BIN_FILE) $(call Upper,$(strip $(BIN_FILE))) $(VERNO) $(strip $(THE_MF)) $(MEMORY_CFG) $(strip $(SCATTERFILE))) >> $(LOG) \
			else \
			(perl .\tools\append2.pl $(strip $(TARGDIR))\$(TARGNAME).sym $(FLASH_CFG) $(strip $(TARGDIR))\$(BIN_FILE) $(call Upper,$(strip $(BIN_FILE))) $(VERNO) $(strip $(THE_MF)) $(EMI_INFO) $(strip $(SCATTERFILE))) >> $(LOG) \
		)

	@if exist .\tools\NFBPack3rdROM.pl \
	(if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM  \
		(perl .\tools\NFBPack3rdROM.pl $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ $(strip $(THE_MF)) \
		) \
	else \
		(perl .\tools\NFBPack3rdROM.pl $(strip $(TARGDIR))\ $(strip $(THE_MF))))

ifdef FOTA_ENABLE
ifneq ($(strip $(FOTA_ENABLE)),NONE)
	@if exist tools\fota_ext_name.pl \
	   (perl tools\fota_ext_name.pl $(CUSTOM_FOTA_H) > make\~fota_ext.tmp)

	@for /f %%i in (make\~fota_ext.tmp) do \
	(@if not exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM \
	  (if exist tools\fota.exe \
            tools\fota.exe -ch $(strip $(TARGDIR))\$(strip $(BIN_FILE)) %%i))
endif
endif

# To support GPS_SUPPORT
ifdef GPS_SUPPORT
ifneq ($(findstring $(strip $(GPS_SUPPORT)),MT3316 MT3318),)
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM \
		((@if not exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\GPS (md $(strip $(TARGDIR))\$(strip $(BIN_FILE))\GPS)) & \
		@if exist gps\core\mt3318_gps_core.bin (copy /Y gps\core\mt3318_gps_core.bin $(strip $(TARGDIR))\$(strip $(BIN_FILE))\GPS)) \
	else \
		((@if not exist $(strip $(TARGDIR))\GPS (md $(strip $(TARGDIR))\GPS)) & \
		@if exist gps\core\mt3318_gps_core.bin (copy /Y gps\core\mt3318_gps_core.bin $(strip $(TARGDIR))\GPS))
ifeq ($(strip $(DRV_CUSTOM_TOOL_SUPPORT)),TRUE)
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM \
		(@if exist tools\gps_config2.pl \
			(perl tools\gps_config2.pl $(strip $(FIXPATH))\custom\drv\misc_drv\$(strip $(BOARD_VER))\codegen\gpio_var.c $(strip $(TARGDIR))\$(strip $(BIN_FILE))\GPS\gps.ini)) \
	else \
		(@if exist tools\gps_config2.pl \
			(perl tools\gps_config2.pl $(strip $(FIXPATH))\custom\drv\misc_drv\$(strip $(BOARD_VER))\codegen\gpio_var.c $(strip $(TARGDIR))\GPS\gps.ini))
else
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM \
		(@if exist tools\gps_config.pl \
			(perl tools\gps_config.pl $(strip $(FIXPATH))\custom\drv\gps\$(strip $(BOARD_VER))\gpsmtk_config.c $(strip $(TARGDIR))\$(strip $(BIN_FILE))\GPS\gps.ini)) \
	else \
		(@if exist tools\gps_config.pl \
			(perl tools\gps_config.pl $(strip $(FIXPATH))\custom\drv\gps\$(strip $(BOARD_VER))\gpsmtk_config.c $(strip $(TARGDIR))\GPS\gps.ini))
endif
endif
endif

   # -----------------------------
   # Nothting related binary directly
   # -----------------------------
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\__* (del /q $(strip $(TARGDIR))\$(strip $(BIN_FILE))\__*)
	@if exist $(strip $(TARGDIR))\__* (del /q $(strip $(TARGDIR))\__*)
	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM  \
		((@copy /y $(SCATTERFILE) $(strip $(TARGDIR))\$(strip $(BIN_FILE)) > nul) & \
		 (if exist $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE)) \
			(@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\$(strip $(BTLD_BIN_FILE)) del $(strip $(TARGDIR))\$(strip $(BIN_FILE))\$(strip $(BTLD_BIN_FILE))) & \
			(copy /Y $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE)) $(strip $(TARGDIR))\$(strip $(BIN_FILE)) > nul)) \
		) \
	else \
		(copy /y $(SCATTERFILE) $(strip $(TARGDIR)) > nul)

	@if exist $(strip $(MMI_FEATURES_FILE)) (copy /y $(strip $(MMI_FEATURES_FILE)) $(strip $(TARGDIR)) > nul)
	@if exist $(strip $(MMI_FEATURES_SWITCH_FILE)) (copy /y $(strip $(MMI_FEATURES_SWITCH_FILE)) $(strip $(TARGDIR)) > nul)
	@if exist $(strip $(THE_MF)) (copy /y $(strip $(THE_MF)) $(strip $(TARGDIR)) > nul)
	
   # -----------------------------
   # Gen TCL script
   # -----------------------------
ifeq ($(strip $(CUSTOM_RELEASE)),FALSE)
ifeq ($(strip $(MMI_VERSION)),PLUTO_MMI)
	@if exist $(TARGDIR)\tcl (rd /s /q $(TARGDIR)\tcl > nul 2>&1)
	@if exist $(TARGDIR)\default_tcl (rd /s /q $(TARGDIR)\default_tcl > nul 2>&1)
ifneq ($(strip $(FLAVOR)),)
	@if exist $(strip $(TARGDIR))\$(BIN_FILE) \
	if exist $(strip $(NETSIM)) \
	if exist $(strip $(MSCWORKSPACE)) \
	if exist $(strip $(CUSTMENUTREE)) \
	if exist mtk_tools\kill_process.pl \
	(echo sleep 60 > ~killp.bat & echo perl mtk_tools\kill_process.pl netsim.exe >> ~killp.bat & echo exit >> ~killp.bat & start /MIN ~killp.bat) & \
	if not exist $(TARGDIR)\tcl\sim (md $(TARGDIR)\tcl\sim) & \
	if not exist $(TARGDIR)\tcl\nosim (md $(TARGDIR)\tcl\nosim) & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) $(strip $(CUSTOMER))_$(strip $(FLAVOR))_SIM $(strip $(TARGDIR))\tcl\sim $(strip $(CUSTMENUTREE)) norun & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) $(strip $(CUSTOMER))_$(strip $(FLAVOR))_NOSIM $(strip $(TARGDIR))\tcl\nosim $(strip $(CUSTMENUTREE)) norun
else
	@if exist $(strip $(TARGDIR))\$(BIN_FILE) \
	if exist $(strip $(NETSIM)) \
	if exist $(strip $(MSCWORKSPACE)) \
	if exist $(strip $(CUSTMENUTREE)) \
	if exist mtk_tools\kill_process.pl \
	(echo sleep 60 > ~killp.bat & echo perl mtk_tools\kill_process.pl netsim.exe >> ~killp.bat & echo exit >> ~killp.bat & start /MIN ~killp.bat) & \
	if not exist $(TARGDIR)\tcl\sim (md $(TARGDIR)\tcl\sim) & \
	if not exist $(TARGDIR)\tcl\nosim (md $(TARGDIR)\tcl\nosim) & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) $(strip $(CUSTOMER))_SIM $(strip $(TARGDIR))\tcl\sim $(strip $(CUSTMENUTREE)) norun & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) $(strip $(CUSTOMER))_NOSIM $(strip $(TARGDIR))\tcl\nosim $(strip $(CUSTMENUTREE)) norun
endif
	@if exist $(TARGDIR)\tcl \
	if not exist $(TARGDIR)\tcl\sim\*.tcl \
	if not exist $(TARGDIR)\tcl\nosim\*.tcl \
	(rd /s /q $(TARGDIR)\tcl > nul 2>&1)
	
	@if not exist $(TARGDIR)\tcl \
	if exist $(strip $(TARGDIR))\$(BIN_FILE) \
	if exist $(strip $(NETSIM)) \
	if exist $(strip $(MSCWORKSPACE)) \
	if exist $(strip $(CUSTMENUTREE)) \
	if not exist $(TARGDIR)\default_tcl\sim (md $(TARGDIR)\default_tcl\sim) & \
	if not exist $(TARGDIR)\default_tcl\nosim (md $(TARGDIR)\default_tcl\nosim) & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) DEFAULT_SIM $(strip $(TARGDIR))\default_tcl\sim $(strip $(CUSTMENUTREE)) norun & \
	$(strip $(NETSIM)) $(strip $(MSCWORKSPACE)) DEFAULT_NOSIM $(strip $(TARGDIR))\default_tcl\nosim $(strip $(CUSTMENUTREE)) norun
	
	@if exist $(TARGDIR)\default_tcl \
	if not exist $(TARGDIR)\default_tcl\sim\*.tcl \
	if not exist $(TARGDIR)\default_tcl\nosim\*.tcl \
	(rd /s /q $(TARGDIR)\default_tcl > nul 2>&1)

	@if exist $(strip $(TARGDIR))\$(BIN_FILE) \
	if exist mtk_tools\AutoTest\at_init.pl \
	if exist $(TARGDIR)\tcl \
	(perl mtk_tools\AutoTest\at_init.pl $(INFOLOG)) \
	else \
	(if exist $(TARGDIR)\default_tcl perl mtk_tools\AutoTest\at_init.pl $(INFOLOG))
endif
endif
	
# *************************************************************************
#  FOTA Targets
# *************************************************************************
fota: $(FOTA_BIN_FILE) done

del_fota:
ifneq ($(strip $(FOTA_ENABLE)),NONE)
	@-if not exist $(TARGDIR) (md $(TARGDIR))            	\
	else                                                 	\
		(@if exist $(strip $(TARGDIR))\$(FOTA_BIN_FILE) (del $(strip $(TARGDIR))\$(FOTA_BIN_FILE))) &  	\
		(@if exist $(strip $(TARGDIR))\$(FOTA_PREFIX).elf (del $(strip $(TARGDIR))\$(FOTA_PREFIX).elf)) & \
		(@if exist $(strip $(TARGDIR))\$(FOTA_PREFIX).lis (del $(strip $(TARGDIR))\$(FOTA_PREFIX).lis)) & \
		(@if exist $(strip $(TARGDIR))\$(FOTA_PREFIX).sym (del $(strip $(TARGDIR))\$(FOTA_PREFIX).sym)) & \
		(@if exist $(strip $(TARGDIR))\$(FOTA_PREFIX).htm (del $(strip $(TARGDIR))\$(FOTA_PREFIX).htm)) & \
		(@if exist $(strip $(TARGDIR))\*.log (del /q $(strip $(TARGDIR))\*.log))
endif

$(FOTA_BIN_FILE): del_fota
ifneq ($(strip $(FOTA_ENABLE)),NONE)

	-@if not exist $(COMPLOGDIR)	(md $(COMPLOGDIR))         \
	else (@if exist $(strip $(COMPLOGDIR))\fota.log (del /q $(strip $(COMPLOGDIR))\fota.log))

	-@if not exist $(PROJDIR)	(md $(PROJDIR))
	-@if not exist $(OBJSDIR)	(md $(OBJSDIR))

	@echo Generate FOTA CMM file ...
	@perl .\tools\fota_NocodeCMMAutoGen.pl themf=$(strip $(THE_MF)) verno=$(strip $(FOTA_PURE_VERNO)) \
	   > FOTA_$(strip $(CUSTOMER))_$(strip $(PLATFORM))_nocode.cmm

	-@if not exist $(strip $(OBJSDIR))\fota	(md $(strip $(OBJSDIR))\fota) \
	else	(@if exist $(strip $(OBJSDIR))\fota\*.obj (del $(strip $(OBJSDIR))\fota\*.obj))

	-@if not exist $(strip $(COMPLIBDIR))	(md $(COMPLIBDIR)) \
	else	(@if exist $(strip $(COMPLIBDIR))\fota.lib (del $(strip $(COMPLIBDIR))\fota.lib))

	-@if not exist $(RULESDIR) (md $(RULESDIR))	\
	else	(@if exist $(strip $(RULESDIR))\fota.dep (del $(strip $(RULESDIR))\fota.dep))

	@tools\make.exe -fmake\gsm2.mak -r -R CUSTOMER=$(strip $(CUSTOMER)) PROJECT=$(strip $(PROJECT)) fota.lib

	@echo Linking $(strip $(FOTA_PREFIX)) ...
	@perl tools\time.pl -n
	@echo $(FOTALNKOPT) > make\~libs.tmp
	@echo $(strip $(COMPLIBDIR))\fota.lib(*) >> make\~libs.tmp
	
	@echo $(LINK) $(VIA) make\~libs.tmp

	@perl .\tools\sortLib.pl make\~libs.tmp $(strip $(COMPOBJS))
	@if /I %OS% EQU WINDOWS_NT \
		($(LINK) $(VIA) make\~sortedLibs.tmp >> $(FOTA_LOG) 2>&1) \
	else \
		($(LINK) $(VIA) make\~sortedLibs.tmp >> $(FOTA_LOG) )

	@echo Creating binary file $(FOTA_BIN_FILE)
	@echo $(BIN_CREATE) $(strip $(TARGDIR))\$(FOTA_PREFIX).elf $(BIN_FORMAT) -output $(strip $(TARGDIR))\$(FOTA_BIN_FILE)
	$(BIN_CREATE) $(strip $(TARGDIR))\$(FOTA_PREFIX).elf $(BIN_FORMAT) -output $(strip $(TARGDIR))\$(FOTA_BIN_FILE)

endif

# *************************************************************************
#  BOOTLOADER Targets
# *************************************************************************
bootloader: $(BTLD_BIN_FILE) done

ifneq ($(strip $(CUSTOM_RELEASE)),TRUE)     

ifeq ($(strip $(SSS_SUPPORT)),SSS_SOURCE)
$(BTLD_BIN_FILE): gen_bl_verno sss.lib che.lib
else
$(BTLD_BIN_FILE): gen_bl_verno che.lib
endif

else
$(BTLD_BIN_FILE): gen_bl_verno $(strip $(CUS_MTK_LIB))\che.lib
endif
ifeq ($(strip $(NEED_BUILD_BOOTLOADER)),TRUE)
	@-if not exist $(TARGDIR) (md $(TARGDIR))            	\
	else                                                 	\
		(@if exist $(strip $(TARGDIR))\$(BTLD_BIN_FILE) (del $(strip $(TARGDIR))\$(BTLD_BIN_FILE))) &  	\
		(@if exist $(strip $(TARGDIR))\$(BTLD_PREFIX).elf (del $(strip $(TARGDIR))\$(BTLD_PREFIX).elf)) & \
		(@if exist $(strip $(TARGDIR))\$(BTLD_PREFIX).lis (del $(strip $(TARGDIR))\$(BTLD_PREFIX).lis)) & \
		(@if exist $(strip $(TARGDIR))\$(BTLD_PREFIX).sym (del $(strip $(TARGDIR))\$(BTLD_PREFIX).sym)) & \
		(@if exist $(strip $(TARGDIR))\$(BTLD_PREFIX).htm (del $(strip $(TARGDIR))\$(BTLD_PREFIX).htm)) & \
		(@if exist $(strip $(TARGDIR))\*.log (del /q $(strip $(TARGDIR))\*.log))

	-@if not exist $(COMPLOGDIR)	(md $(COMPLOGDIR))         \
	else (@if exist $(strip $(COMPLOGDIR))\bootloader.log (del /q $(strip $(COMPLOGDIR))\bootloader.log))

	-@if not exist $(PROJDIR)	(md $(PROJDIR))
	-@if not exist $(OBJSDIR)	(md $(OBJSDIR))

	-@if not exist $(strip $(OBJSDIR))\bootloader	(md $(strip $(OBJSDIR))\bootloader) \
	else	(@if exist $(strip $(OBJSDIR))\bootloader\*.obj (del $(strip $(OBJSDIR))\bootloader\*.obj))

	-@if not exist $(strip $(COMPLIBDIR))	(md $(COMPLIBDIR)) \
	else	(@if exist $(strip $(COMPLIBDIR))\bootloader.lib (del $(strip $(COMPLIBDIR))\bootloader.lib))

	-@if not exist $(RULESDIR) (md $(RULESDIR))	\
	else	(@if exist $(strip $(RULESDIR))\bootloader.dep (del $(strip $(RULESDIR))\bootloader.dep))

	@tools\make.exe -fmake\gsm2.mak -k -r -R CUSTOMER=$(strip $(CUSTOMER)) PROJECT=$(strip $(PROJECT)) bootloader.lib

	@echo Linking $(strip $(BTLD_PREFIX)) ...
	@perl tools\time.pl -n
	@echo $(BTLDLNKOPT) > make\~libs.tmp
	@echo $(strip $(COMPLIBDIR))\bootloader.lib(*) >> make\~libs.tmp

ifdef SSS_SUPPORT
  ifeq ($(strip $(SSS_SUPPORT)),SSS_SOURCE)
		@echo $(strip $(COMPLIBDIR))\sss.lib >> make\~libs.tmp
  endif   
  ifeq ($(strip $(SSS_SUPPORT)),SSS_LIB)
		@echo sss\sss.lib >> make\~libs.tmp
  endif   
  ifneq ($(strip $(CUSTOM_RELEASE)),TRUE)     
		@echo $(strip $(COMPLIBDIR))\che.lib >> make\~libs.tmp
  else
		@echo $(strip $(CUS_MTK_LIB))\che.lib >> make\~libs.tmp
  endif
endif
	
	@perl .\tools\sortLib.pl make\~libs.tmp $(strip $(COMPOBJS))
	@if /I %OS% EQU WINDOWS_NT \
		($(LINK) $(VIA) make\~sortedLibs.tmp >> $(BOOTLOADER_LOG) 2>&1) \
	else \
		($(LINK) $(VIA) make\~sortedLibs.tmp >> $(BOOTLOADER_LOG) )

	@echo Creating binary file $(BTLD_BIN_FILE)
	$(BIN_CREATE) $(strip $(TARGDIR))\$(BTLD_PREFIX).elf $(BIN_FORMAT) -output $(strip $(TARGDIR))\$(BTLD_BIN_FILE)

	@if exist $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE))\READ_ONLY \
		copy /Y $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE))\READ_ONLY $(strip $(TARGDIR))\READ_ONLY & \
		rmdir /S /Q $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE)) & \
		move /Y $(strip $(TARGDIR))\READ_ONLY $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE))

	@perl .\tools\bl_append.pl $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE)) $(strip $(BTLDVERNODIR))\bl_verno.c $(strip $(BTLD_SCATTERFILE)) $(strip $(THE_MF)) $(strip $(TARGDIR))\$(BTLD_PREFIX).sym

	@if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\ROM \
	  (if exist $(strip $(TARGDIR))\$(strip $(BIN_FILE))\$(strip $(BTLD_BIN_FILE)) \
	     del $(strip $(TARGDIR))\$(strip $(BIN_FILE))\$(strip $(BTLD_BIN_FILE))) & \
	  copy /Y $(strip $(TARGDIR))\$(strip $(BTLD_BIN_FILE)) $(strip $(TARGDIR))\$(s

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -