Make.bat文件perl make2.pl %*make2.pl文件$ini = "make.ini";$delCmd = "rm";$dirDelim = "/";$makeFolder = "make/";$toolsFolder = "tools/";$MTKtoolsFolder = "mtk_tools/";$makeCmd = "tools/make";$myMF = "gsm2.mak";$prj_file = "make/${custom}_${project}.mak";@tools_Dirs = qw(tools/ tools/MinGW tools/MSYS);$makeCmd = "tools/make";push (@tools_file,$makeCmd) ;@mmi_path = qw(plutommi/Customer/ResGenerator lcmmi/Customer/ResGenerator); foreach $mmi_path (@mmi_path){next if (!-d $mmi_path);$sevenZa_file = $mmi_path."/7za.exe";push (@tools_file,$sevenZa_file) ;$convert = $mmi_path."/convert.exe";push (@tools_file,$convert) ;last;}# $ENV{"NUMBER_OF_PROCESSORS"} = 1;if ($env_last_S_CF eq "") {system("bsub -I perl m_cp2lsf.pl @orgARGV");} else {system("bsub -I -m \"${env_last_S_CF}+2 mtkcf+1\" perl m_cp2lsf.pl @orgARGV"); }if (($action eq "remake") || ($action eq "update") ||($action eq "new")|| ($action eq "bm_new")) {if ($action eq "bm_new") {system("echo BM_NEW=TRUE >> ${makeFolder}~buildinfo.tmp");$result = system("${makeCmd} -f${makeFolder}${myMF} -k -r -R CUSTOMER=$custom PROJECT=$project new");} else {$result = system("${makeCmd} -f${makeFolder}${myMF} -r -R CUSTOMER=$custom PROJECT=$project $action");}USAGE:tools\make.exe -f[make file] [build_flag] <CUSTOMER> <PROJECT> <ACTION> Example:tools\make.exe –fmake\gsm2.mak -r -R CUSTOMER=mtk PROJECT=gprs newm_cp2lsf.plif(-e "$lsf_dir\\custom_release\\$CUS_REL_FOLDER_NAME\\make\\Custom.bld"){ foreach my $file (<$lsf_dir\\custom_release\\$CUS_REL_FOLDER_NAME\\make\\*.mak>){next if -d $file;if (($file =~ /\\(\w+)_(GPRS|GSM|L1S|BASIC|UMTS)\.mak/i) && ($file !~ /\\REL_\w+_(GPRS|GSM|L1S|BASIC|UMTS)\.mak/i)){$make_file = $file;}if ($file =~ /\\REL_(CR|sub)_(\w+)_(GPRS|GSM|L1S|BASIC|UMTS)\.mak/i){$RELEASE_PACKAGE = $2;}}open MAKE_FILE, "<$make_file" or die "\ncannot open $make_file\n\n";Gsm2.mak# -----------------------------# Include scripts# -----------------------------include make\option.mak # Build option definitons-include make\app_cfg.mak# ************************************************************************* New Build# *************************************************************************ifeq ($(strip $(call Upper,$(LEVEL))),VENDOR)ifeq ($(strip $(NEED_BUILD_BOOTLOADER)),TRUE)new : cleanall cleanlog cleanbin resgen $(BTLD_BIN_FILE) remakeelsenew : cleanall cleanlog cleanbin resgen remakeendifelseifeq ($(strip $(NEED_BUILD_BOOTLOADER)),TRUE)ifeq ($(strip $(call Upper,$(L1_WCDMA))),TRUE)new : cleanall sysgen ckscatter mmi_feature_check asngen umts_gen codegen asnregen operator_check $(BTLD_BIN_FILE) updateelsenew : cleanall sysgen ckscatter mmi_feature_check asngen codegen asnregen operator_check $(BTLD_BIN_FILE) updateendifelseifeq ($(strip $(call Upper,$(PROJECT))),UMTS)new : cleanall sysgen ckscatter mmi_feature_check asngen umts_gen codegen asnregen operator_check updateelsenew : cleanall sysgen ckscatter mmi_feature_check asngen codegen asnregen operator_check updateendifendifendif-include make\Custom.bld # Custom release buildCkscatter@echo Check scatter fileCustom_Release.mak# -----------------------------# Include scripts# -----------------------------# Build option definitonsinclude make\option.makinclude make\ALIAS.makOption.mak# ************************************************************************* # Include GNU Make Standard Library (GMSL)# ************************************************************************* -include tools\GMSL\gmslLINK = $(DIR_TOOL)\armlink.exe # LinkerASM = $(DIR_TOOL)\armasm.exe # ARM assemblerLIB = $(DIR_TOOL)\armar.exe # Library toolBIN_CREATE = $(DIR_TOOL)\fromelf.exe # Binary toolCFLAGS := -cpu ARM7EJ-S -littleend -O2 -zo -facustominfo.pl# CMOS_SENSORif (($project ne "basic") && ($project ne "l1s") && defined($cmos_sensor)) {if ($cmos_sensor ne "NONE") {push(@thatdirs, "drv\\camera\\$board_ver");if (($yuv_sensor_support eq "TRUE") && ($isp_support eq "TRUE")) {push(@thatdirs, "drv\\yuv_sensor\\$cmos_sensor");} else {push(@thatdirs, "drv\\image_sensor\\$cmos_sensor");}}}$allinc .= "${mmidir}\\MMI\\Inc\n";.\tools\chk_env.exe例子Upper = $(subst z,Z,$(subst y,Y,$(subst x,X,$(subst w,W,$(subst v,V,$(subst u,U,$(subst t,T,$(subst s,S,$(subst r,R,$(subst q,Q,$(subst p,P,$(subst o,O,$(subst n,N,$(subst m,M,$(subst l,L,$(subst k,K,$(subst j,J,$(subst i,I,$(subst h,H,$(subst g,G,$(subst f,F,$(subst e,E,$(subst d,D,$(subst c,C,$(subst b,B,$(subst a,A,$(1)))))))))))))))))))))))))))CUSTOMERROOT = $(firstword $(subst _, ,$(strip $(call Upper,$(CUSTOMER)))))。