版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
MTKALPS開發(fā)環(huán)境配置及編譯Liu.YangMTKALPS開發(fā)環(huán)境配置及編譯Liu.YangAndroidAndroidAnatomyAndroidAndroidAnatomyAndroidAndroidSourceCode|--Makefile (全局的Makefile,make總?cè)肟冢?/p>
|--bionic (一些基礎(chǔ)的庫的源代碼)
|--bootloader (引導(dǎo)加載器)
|--build (是編譯和配置所需要的腳本和工具)
|--cts (cts測試源碼)
|--dalvik (JAVA虛擬機(jī)有關(guān)的代碼)
|--development (程序開發(fā)所需要的模板和工具)
|--external (目標(biāo)機(jī)器使用的一些庫)
|--frameworks (應(yīng)用程序的框架層)
|--hardware
(與硬件相關(guān)的庫,供framework調(diào)用)
|--kernel
(Linux內(nèi)核源代碼)
|--mediatek
(MTK平臺(tái)相關(guān)代碼)
|--packages (Android的各種應(yīng)用程序)
|--prebuilt
(Android在各種平臺(tái)下編譯的預(yù)置腳本)
|--recovery
(與目標(biāo)的恢復(fù)功能相關(guān))|--system (Android的底層的一些庫以及守護(hù)進(jìn)程)
AndroidAndroidSourceCodeEnvironmentRequirementsOS LinuxUbuntu10.04(LTS,longtermsupportversion)64bitMemory&DiskSpace
2+Gphysicalmemory(Avoid“JVMrunoutofmemory”&Speedupbuildperformance)
10+Gormorediskspaceisneeded(tobuildAndroidtree)Compilationtoolchain arm-eabi-4.4.3(cangetfromreleasedSWpackage,prebuilt/linux-x86/toolchain/arm-eabi-4.4.3) gcc4.4.3 JDK1.6Perl,Pythoninterpreter Perl5.10.X Python2.6.XEnvironmentRequirementsOSEnvironmentRequirementsMakeutility GNUmake3.81oraboveOthers wine1.1orabove bison2.4.X,flex2.5.X,gperf3.0.X mingw32(tobuildwin32executableforemulatoronlinuxhost) unix2dos/tofrodos(tobuildwindowstoolforSDKpackage)EnvironmentRequirementsMakeInstallSoftwareRequiredPackages&recommendinstallationwayInstallSoftwareRequiredPackaInstallSoftwareInstallSoftwareInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallUbuntuInstallSoftwareInstallSoftwareInstallSoftwareConfigureBuildProfile
gedit~/.bashrc AddyouJavafoldertoSystemPath
source~/.bashrc (Notnessary,itwillalsobesetbymbldenv.shwhenmakeMtk)InstallSoftwareConfigureBuilInstallSoftwareConfigureBuildProfile
geditmbldenv.sh thenchangetheJava,eabi,andpythonpathforyourcomputer Takemineforexample:InstallSoftwareConfigureBuilInstallSoftwareCheckEnvironment IfhavingfinishedinstallingyourenvironmenttobuildALPS, Youcanusethiscommand
./makeMtkcheck-env
toknowiftheenvironmentisprepared
InstallSoftwareCheckEnvironmInstallSoftwareCheckEnvironment Fromthesceenshotabove,weknowmyenvironmentisfailedformylowphysicalmemory. SometimeourcomputersmaynotmeetthelowesthardwarerequriementforAPLS, Soweneedtocheatinenvironmentcheck.
geditmediatek/build/tools/checkEnv.pyInstallSoftwareCheckEnvironmInstallSoftwareCheckEnvironment NowtheenvironmentisOK, Ofcourse,youcanchange“checkEnv.py”forotherfailureifnecessary.InstallSoftwareCheckEnvironmInstallSoftwareBuildanewproject Taketinnopmt73_gbforExample
./makeMtklistp Youwillgetalltheprojectsupportedinyoursourcecode Buildthewholeprojecttinnopmt73_gb ./makeMtktinnopmt73_gbr
Notice:Ifyoufailinbuildingandroid,trymakeupdate-apiinALPSrootdirectoryInstallSoftwareBuildanewprInstallSoftwareBuildanewproject
InstallSoftwareBuildanewprInstallSoftwareBuildanewproject
Youcanreviewthelogsin/out/target/product,ifthereareanyerrors.InstallSoftwareBuildanewprInstallSoftwareBuildanewproject Youcanfindallyouproductimagesinout/target/product/tinnopmt73_gbInstallSoftwareBuildanewprBuildALPSWeuse“makeMtk”buildALPS Ifyoutype./makeMtkor./makeMtk–h,youwillgethowtousethemakeMtkBuildALPSWeuse“makeMtk”buiBuildALPSWeuse“makeMtk”buildALPS
BuildALPSWeuse“makeMtk”buiBuildALPSWeuse“makeMtk”buildALPS
Forexample 1.Buildthewholeprojectfortinnopmt73_gb
./makeMtktinnopmt73_gbr 2.BuildtheLinuxKernelfortinnopmt73_gb ./makeMtktinnopmt73_gbrk ./makeMtktinnopmt73_gbbootimage
3.BuildtheGalley.apkfortinnopmt73_gb ./makeMtktinnopmt73_gbrdrGallery
Notice:mkisalinktomakeMtk,sowecanusemktoreplacemakeMtkBuildALPSWeuse“makeMtk”buiBuildALPSBuildScriptsIntroduction
1)makeMtk
./mbldenv.sh#mentionedabove,setyourbuildenv Ifthefollowingfoldersorfilesdonotexsits,makeMtkwilldie
mediatek mediatek/config
mediatek/build/tools
mediatek/config/${project}/ProjectConfig.mk Mainlyusethefollowingscripts
mediatek/build/makemtk.mkBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
2)makeMtk.mk ItexecutesthecommandsentbymakeMtk,like“custgen”,“rebuild”,“clean”andsoon. Itwillalsosavethelogsforbuilding.
Mainlyusesthefollowingscripts mediatek/build/Makefile definesseveralglobevariablesinthefunctioncodebase-pathforuse mediatek/build/custgen.mk mostimportantscriptwhichusedbymakeMtk.mkfor“custgen”BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
custgen.mkisusedtochoosethesourcecodeandconfigforourownproject. Mainlyusethefollowingscripts mediatek/build/Makefile
mediatek/build/libs/gmsl mediatek/build/libs/custom.mk mediatek/build/libs/config.mk ----Thelastthreescriptsisincludedinmediatek/build/Makefile
Thecontentsofcustgen.mkisverysimple includemediatek/build/Makefile $(callcodebase-path) all:mtk-config-filesmtk-custom-files @echo"done" mtk-config-files:=$(strip$(callmtk.config.generate-rules,mtk-config-files)) mtk-custom-files:=$(strip$(callmtk.custom.generate-rules,mtk-custom-files))
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk mediatek/build/libs/gmslisanExtendedLibraryforGNUmake ItdefinessomeAPIformakeuse Forexample definepath.split $(patsubst%/,%,$(dir$(patsubst%/,%,$1)))$(notdir$(patsubst%/,%,$1)) endef Usage: $(callpath.split,kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c)) outputis kernel/imgsensor/ov7675_yuvov7675yuv_Sensor.c
definewildcard2 $(strip$(if$(wildcard$(1)),$(wildcard$(1)),$(wildcard$(subst],\],$(subst[,\[,$(1)))))) endef
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk mediatek/build/libs/custom.mkisusedtochoosethecorrectsourcecodeforourproject definemtk.custom.generate-rules $(if$(MTK_ROOT_CUSTOM),$(strip\ $(eval_custflist_:=)$(eval_custfmap_:=)$(eval_custfgen:=)\ $(foreachd,$(addprefix$(MTK_ROOT_CUSTOM)/,$(MTK_CUSTOM_FOLDERS)),\ $(eval_dirs:=$(callwildcard2,$(if$(2),$(addprefix$(d)/,$(2)),$(d))))\ $(if$(_dirs),\ $(eval_files:=$(filter-out$(_custflist_),\ $(patsubst$(d)/%,%,$(shellfind-L$(_dirs)\(!-name.\*\)-typef))))\ $(foreachf,$(_files),\ $(eval_:=$(call.mtk.custom.map-module,$f))\ $(if$_,\ $(eval_src_:=$(firstword$_))\ $(eval_des_:=$(lastword$_))\ $(eval_custflist_+=$(_src_))\ $(eval_custfmap_+=$(MTK_ROOT_CUSTOM_OUT)/$(_des_):$(d)/$(_src_))\ ,)\ )\ ,)\ )\
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(eval#TODOpre-generatedfilesshouldbeenforceddirectlybyarchitecture)\ $(if$(3),$(foreachf,$(filter-out$(_custflist_),$(3)),\ $(eval_g_:=$(MTK_ROOT_CUSTOM_OUT)/$(patsubst$(MTK_ROOT_CUSTOM)/$(MTK_PROJECT)/%,%,$(f)))\ $(if$(filter$(addprefix$(MTK_ROOT_CUSTOM_OUT)/,$(_custflist_)),$(_g_)),,\ $(eval_custfgen+=$(_g_))$(eval_custflist_+=$(f))$(eval_custfmap_+=$(_g_):$(f))\ )),)\ $(if$(callwildcard2,$(MTK_ROOT_CUSTOM_OUT)),\ $(foreachf,$(filter-out$(_custfgen)$(foreachf,$(_custfmap_),$(word1,$(subst:,,$f))),\ $(shellfind$(if$(2),$(addprefix$(MTK_ROOT_CUSTOM_OUT)/,$(2)),$(MTK_ROOT_CUSTOM_OUT))\ !\(-name'*.[oas]'-o-name'*.ko'-o-name'.*'-o-name'*.mod.c'-o-name'*.gcno'\ -o-name'modules.order'\)-typef2>/dev/null)),\ $(eval$(call.mtk.custom.delete-rule,$(1),$(f))))\ ,)\ $(foreachf,$(_custfmap_),\ $(eval$(call.mtk.custom.generate-rule,$(1),$(word1,$(subst:,,$(f))),$(word2,$(subst:,,$(f)))))\ $(word1,$(subst:,,$(f)))\ )),) endef
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Taketinnopmt73_gbforexample
MTK_ROOT_CUSTOM
:=$(MTK_ROOT)/custom==>mediatek/custom
MTK_ROOT_CUSTOM_OUT
:=$(MTK_ROOT_CUSTOM)/out/$(FULL_PROJECT))==>mediatek/custom/out/tinnopmt73_gb
MTK_PLATFORM
=MT6573---inProjectConfig.mk
MTK_CUSTOM_FOLDERS
:=$(call.mtk.custom.generate-folder-list) define.mtk.custom.generate-folder-list $(strip$(eval_mtk_project_:=$(subst],,$(subst[,,$(FULL_PROJECT))))\ $(eval_flvlist_:=$(strip$(subst+,,$(word2,$(_mtk_project_)))))\ $(eval_prjlist_:=$(call.mtk.custom.split-project,$(subst.,/,$(word1,$(_mtk_project_)))))\ $(eval_fp_list_:=$(foreachp,$(_prjlist_),$(foreachf,$(_flvlist_),$(p)[$(f)]))$(_prjlist_))\
$(_fp_list_)$(calllc,$(MTK_PLATFORM))common) endef
_fp_list_---tinnopmt73_gb
$(calllc,$(MTK_PLATFORM))common)---mt6573common soMTK_CUSTOM_FOLDERSistinnopmt73_gbmt6573common
$(addprefix$(MTK_ROOT_CUSTOM)/,$(MTK_CUSTOM_FOLDERS))==>
mediatek/custom/tinnopmt73_gbmediatek/custom/mt6573mediatek/custom/common
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(patsubst$(d)/%,%,$(shellfind-L$(_dirs)\(!-name.\*\)-typef))
When_dirsismediatek/custom/common
find-L$(_dirs)\(!-name.\*\)-typefwilllistallthefiles(exceptfilesbeginwith“.”)under
mediatek/custom/common(includesubfolders) like
… mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.h mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_CameraCustomized.h mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Camera_Sensor_para.h …
Thenweusepatsubsttofilteroutthecustomfoldernames,sothefilelistabovewillbechangedto
… kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.h kernel/imgsensor/ov7675_yuv/ov7675yuv_CameraCustomized.h kernel/imgsensor/ov7675_yuv/ov7675yuv_Camera_Sensor_para.h …BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk Thenwemeetthefollowingfuction define.mtk.custom.map-module $(strip\ $(eval_custom._:=$(callpath.split,$1))\ $(eval_custom.d:=$(callpath.split,$(firstword$(_custom._))))\ $(eval_custom.f:=$(lastword$(_custom._)))\ $(eval_custom.n:=CUSTOM_$(calluc,$(subst/,_,$(firstword$(_custom.d)))))\ $(eval_custom.v:=$(lastword$(_custom.d)))\ $(if$(filter$($(_custom.n)),$(_custom.v)), $1$(firstword$(_custom.d))/$(_custom.f), $(if$(callseq,undefined,$(origin$(_custom.n))),$1$1,\ $(if$(filterinc,$(_custom.v)),$1$1,\ $(if$(filtersrc,$(_custom.v)),$1$(firstword$(_custom.d))/$(_custom.f),)\ ) ))\ ) endefBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Forexample,wesetthefirstinputparam--kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
_custom._==>kernel/imgsensor/ov7675_yuvov7675yuv_Sensor.c
_custom.d==>kernel/imgsensorov7675_yuv
_custom.f==>ov7675yuv_Sensor.c
_custom.n==>CUSTOM_KERNEL_IMGSENSOR
_custom.v==>ov7675_yuv
NowwetrytofindwheretheCUSTOM_KERNEL_IMGSENSORdefined
beforegoingon
MTK_PROJECT_CONFIGS:=$(callwildcard2,$(foreachc,$(callreverse,$(addsuffix/ProjectConfig.mk,\ $(addprefix../../config/,$(MTK_CUSTOM_FOLDERS)))),$(callrelative-path,$(c)))) AfterparsingMTK_PROJECT_CONFIGSis mediatek/build/libs/../../config/common/ProjectConfig.mk mediatek/build/libs/../../config/mt6573/ProjectConfig.mk mediatek/build/libs/../../config/tinnopmt73_gb/ProjectConfig.mk $(foreachp,$(MTK_PROJECT_CONFIGS),$(evalexportMTK_PROJECT$(strip$(shellcat$p|\ grep-v"^\s*#"|sed's/\s*=\s*.*//g'))))BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(foreachp,$(MTK_PROJECT_CONFIGS),$(evalexportMTK_PROJECT$(strip$(shellcat$p|\ grep-v"^\s*#"|sed's/\s*=\s*.*//g')))) When$pismediatek/build/libs/../../config/tinnopmt73_gb/ProjectConfig.mk
grep-v"^\s*#"
willfilteroutthecontentsafter“#”,and
sed's/\s*=\s*.*//g‘willfilteroutthecontentsontherighterof“=” Forexample #tempsolutionforcustomfolder CUSTOM_HAL_IMGSENSOR=imx073_mipi_rawov7675_yuv CUSTOM_KERNEL_IMGSENSOR=imx073_mipi_rawov7675_yuv CUSTOM_HAL_LENS=fm50afdummy_lens CUSTOM_KERNEL_LENS=fm50afdummy_lens Whenweusethefollowingfilterrule,thetextwillturnto CUSTOM_HAL_IMGSENSOR CUSTOM_KERNEL_IMGSENSOR CUSTOM_HAL_LENS CUSTOM_KERNEL_LENSBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
So(shellcat$p|\grep-v"^\s*#"|sed's/\s*=\s*.*//g')willreturnallthevariablesdefinesin$p Afterusing“export”,wecangetthevariablesvalueinMakefiles Frommediatek/build/libs/../../config/tinnopmt73_gb/ProjectConfig.mk Weknow
CUSTOM_KERNEL_IMGSENSOR=imx073_mipi_rawov7675_yuv
Nowgobackto.mtk.custom.map-module $(if$(filter$($(_custom.n)),$(_custom.v)), $1$(firstword$(_custom.d))/$(_custom.f), $(if$(callseq,undefined,$(origin$(_custom.n))),$1$1,\ $(if$(filterinc,$(_custom.v)),$1$1,\ $(if$(filtersrc,$(_custom.v)),$1$(firstword$(_custom.d))/$(_custom.f),)\ ) ))
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
So,theremaybefivepossibilitiesforallthefiles Ifweset $1kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
output:kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.ckernel/imgsensor/ov7675yuv_Sensor.c $1kernel/btwlanem/btwlanem/btwlanem.c
COSTOM_KERNEL_BTWLANEMnotdefined,nochange
output:kernel/btwlanem/btwlanem/btwlanem.ckernel/btwlanem/btwlanem/btwlanem.c
$1kernel/imgsensor/inc/kd_imgsensor.h
output:kernel/imgsensor/inc/kd_imgsensor.hkernel/imgsensor/inc/kd_imgsensor.h
$1kernel/imgsensor/src/kd_sensorlist.h
output:kernel/imgsensor/src/kd_sensorlist.hkernel/imgsensor/kd_sensorlist.h $1kernel/imgsensor/ov5642_raw/ov5642raw_Sensor.c
output
:Null
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Having.mtk.custom.map-modulereviewed,Wegobacktomtk.custom.generate-rules $(foreachf,$(_files),\ $(eval_:=$(call.mtk.custom.map-module,$f))\ $(if$_,\ $(eval_src_:=$(firstword$_))\ $(eval_des_:=$(lastword$_))\$(eval_custflist_+=$(_src_))\ $(eval_custfmap_+=$(MTK_ROOT_CUSTOM_OUT)/$(_des_):$(d)/$(_src_))\ ,)
MTK_ROOT_CUSTOM_OUT:=$(MTK_ROOT_CUSTOM)/out/$(FULL_PROJECT))==>mediatek/custom/out/tinnopmt73_gb
if$(f)iskernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c $(_src_)iskernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
$(_des_)iskernel/imgsensor/ov7675yuv_Sensor.c
Thenaddkernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
to$(_custflist_) andmediatek/custom/out/tinnopmt73_gb/kernel/imgsensor/ov7675yuv_Sensor.c:
mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
to$(_custfmap_)==>$(d)ismediatek/custom/commonhere
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(foreachf,$(_custfmap_),\ $(eval$(call.mtk.custom.generate-rule,$(1),$(word1,$(subst:,,$(f))),$(word2,$(subst:,,$(f)))))\ $(word1,$(subst:,,$(f)))\ )
$(_custfmap_)istheoutputfilelistwehavejustgenerated define.mtk.custom.generate-rule $(1):$(2) $(2):$(3) @echo"[CUSTOM]copy$(3)" @echo"to$(2)" @mkdir-p$(dir$(2)) @cp-f$(3)$(2) endef
When$(f)ismediatek/custom/out/tinnopmt73_gb/kernel/imgsensor/ov7675yuv_Sensor.c:mediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c $(2)ismediatek/custom/out/tinnopmt73_gb/kernel/imgsensor/ov7675yuv_Sensor.c $(3)ismediatek/custom/common/kernel/imgsensor/ov7675_yuv/ov7675yuv_Sensor.c
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(dir$(2))==>mediatek/custom/out/tinnopmt73_gb/kernel/imgsensor mkdir–p$(dir$(2))==>createtheabovefolder(andtheparentfolderifnecessary,replaynoerrorevenifthefolderexsits) cp-f$(3)$(2)==>copythefiletothe“out”folder
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk mediatek/build/libs/config.mkisusedtochoosethecorrectconfigsforourproject definemtk.config.generate-rules ... $(foreachc,$(MTK_AUTOCONFIG_LIST),$(call.mtk.config.generate-auto-rules,$c))\ $(if$(MTK_ROOT_CONFIG),$(strip\ $(eval_confflist_:=)$(eval_conffmap_:=)\ $(foreachd,$(addprefix$(MTK_ROOT_CONFIG)/,$(MTK_CUSTOM_FOLDERS)),\ $(eval_dirs:=$(d))\ $(info$(_dirs)\) $(if$(_dirs),\ $(eval_files:=$(filter-out$(_confflist_),\ $(patsubst$(d)/%,%,$(shellfind-L$(_dirs)\(!-name.\*\)-typef|\ grep-v"autoconfig/\|ProjectConfig\.mk"))))\ $(foreachf,$(_files),\ $(eval_confflist_+=$(f))\ $(eval_conffmap_+=$(MTK_ROOT_CONFIG_OUT)/$(f):$(d)/$(f))\ )\ ,)\ )\BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk $(if$(callwildcard2,$(MTK_ROOT_CONFIG_OUT)),\ $(foreachf,$(filter-out$(MTK_ROOT_CONFIG_OUT)/ProjectConfig.mk\ $(callwildcard2,$(MTK_ROOT_CONFIG_OUT)/autoconfig/*)\ $(foreachf,$(_conffmap_),$(word1,$(subst:,,$f))),\ $(shellfind$(if$(2),$(addprefix$(MTK_ROOT_CONFIG_OUT)/,$(2)),$(MTK_ROOT_CONFIG_OUT))\ -typef2>/dev/null)),\ $(eval$(call.mtk.config.delete-rule,$(1),$(f))))\ ,)\ $(foreachf,$(_conffmap_),\ $(eval$(call.mtk.config.generate-rule,$(1),$(word1,$(subst:,,$(f))),$(word2,$(subst:,,$(f)))))\ $(word1,$(subst:,,$(f)))\ )),) endef
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
(foreachc,$(MTK_AUTOCONFIG_LIST),$(call.mtk.config.generate-auto-rules,$c))
MTK_AUTOCONFIG_LIST:=$(patsubst$(callrelative-path,../../config/common/autoconfig/)%,%,\ $(callwildcard2,$(callrelative-path,../../config/common/autoconfig/*)))
Wemeetthefuctionbelow define.mtk.config.generate-auto-rules $(evalinclude$(MTK_ROOT_CONFIG)/common/autoconfig/$1/config.mk)\ $(eval_merge_order_:=$(callwildcard2,$(foreachm,$(merge-order),$(foreachp,\ $(callreverse,$(MTK_CUSTOM_FOLDERS)),$(MTK_ROOT_CONFIG)/$(p)/autoconfig/$1/$(m)))))\ $(eval_target_file_:=$(MTK_ROOT_GEN_CONFIG)/$1)\ $(if$(callseq,auto-merge,$(config-type)),$(eval\ $(call.mtk.config.generate-auto-merge-rules,$1,$(_target_file_),$(_merge_order_)\ ,$(MTK_ROOT_GEN_CONFIG),$(merge-command)) ),$(eval####################addyourownconfigfileparsingrulehere######################) )$(_target_file_) endef
BuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
When$1iskconfig
$(MTK_ROOT_CONFIG)/common/autoconfig/$1/config.mkis
mediatek/config/common/autoconfig/kconfig/config.mk
$(merge-order)definedintheabove.mk merge-order:=\ common\ platform\ $(if$(callseq,yes,$(HAVE_AEE_FEATURE)),AEE,)\ project\ flavor\ $(if$(callseq,user,$(TARGET_BUILD_VARIANT)),USER,)
merge-orderiscommonplatformAEEprojectflavor _merge_order_is mediatek/config/mt6573/autoconfig/kconfig/platform mediatek/config/common/autoconfig/kconfig/AEE mediatek/config/tinnopmt73_gb/autoconfig/kconfig/project
_target_file_ismediatek/config/out/tinnopmt73_gb/autoconfig/kconfigBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Nowwemeetanotherfuctionagain
define.mtk.config.generate-auto-merge-rules .PHONY:mediatek-configs.$(1) mediatek-configs:mediatek-configs.$(1) mediatek-configs.$(1):$(2) $(2):PRIVATE_FILE_LIST:=$(3) $(2):$(3)$(4) @echo"[CONFIG]generate$(2)" @cat$(3)|$(5)>$(2) endefBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Usethevalueswehavegottoreplace
.PHONY:mediatek-configs.kconfig mediatek-configs:mediatek-configs.kconfig mediatek-configs.kconfig:mediatek/config/out/tinnopmt73_gb/autoconfig/kconfig
mediatek/config/out/tinnopmt73_gb/autoconfig/kconfig:PRIVATE_FILE_LIST:= mediatek/config/mt6573/autoconfig/kconfig/platform
mediatek/config/common/autoconfig/kconfig/AEE mediatek/config/tinnopmt73_gb/autoconfig/kconfig/project
mediatek/config/out/tinnopmt73_gb/autoconfig/kconfig:
mediatek/config/mt6573/autoconfig/kconfig/platform
mediatek/config/common/autoconfig/kconfig/AEE
mediatek/config/tinnopmt73_gb/autoconfig/kconfig/project
@echo"[CONFIG]generatemediatek/config/out/tinnopmt73_gb/autoconfig/kconfig" @catmediatek/config/mt6573/autoconfig/kconfig/platform mediatek/config/common/autoconfig/kconfig/AEE
mediatek/config/tinnopmt73_gb/autoconfig/kconfig/project
|pythonmediatek/build/tools/config/merge-kconfig.py>mediatek/config/out/tinnopmt73_gb/autoconfig/kconfigBuildALPSBuildScriptsIntrodBuildALPSBuildScriptsIntroduction
3)custgen.mk
Notice:
IfwewanttochangeaMacroforKernel,Remembertheorder 1.common 2.platform 3.AEE 4.project 5.flavor ifweopenanMacroincommon,platformorprojectcannotcloseit Forexample WesetCONFIG_MTK_AEE_FEATURE=yinmediatek/config/common/autoconfig/kconfig/AEE thenwedonotsetCONFIG_MTK_AEE_FEATUREorsetCONFIG_MTK_AEE_FEATURE=n
inmediatek/config/mt6573/autoconfig/kconfig/platform ormediatek/config/tinnopmt73_gb/autoconfig/kconfig/project WewillfindtheCONFIG_MTK_AEE_FEATUREisstillyinthenoutputfilemediatek/config/out/tinnopmt73_gb/autoconfig/kconfig
BuildALPSBuildScriptsIntrodBuildALPSAddanewdriverinALPS
1.Addafolderdebuginmediatek/custom/common/kernel
(Youcanalsoadditinmediatek/custom/mt6573/kernel
ormediatek/custom/tinnopmt73_gb/kernelifnecessary)
2.Addourdrivertypefolders9050underdebug 3.Adddriversourcecodedebug_control.hdebug_control.cunders9050
BuildALPSAddanewdriverinBuildALPSAddanewdriverinALPS
4.Forthedriverfolderiskernel/debug/s9050,addamacroCUSTOM_KERNEL_DEBUG=s9050 in/mediatek/config/tinnopmt73_gb/ProjectConfig.mk
BuildALPSAddanewdriverinBuildALPSAddanewdriverinALPS
5.Rebuildthekernel,youwillfindourdebugdriverhasbeenadded
BuildALPSAddanewdriverinBuildALPSAddanewdriverinALPS
6.Donotworryabout“Makefile” Aswediscussabove,
mediatek/custom/out/tinnopmt73_gb/kernel/Makefileiscopyfrom mediatek/custom/common/kernel/Makefile
NowLetushavealookatthemakefile include$(MTK_PATH_BUILD)/common.mk==>mediatek/build/kernel/common.mk $(callall-modules-src-or-makefile,$(obj),CUSTOM_KERNEL_) obj-n:=dummy.o
Soweshouldtalkaboutthefollowingfunctiondefinedincommon.mk defineall-modules-src-or-makefile $(eval_:=$(callmodules,$(1),$(2)))\ $(eval_+=$(filter-out$(_),$(patsubst$(obj)/%,%,\ $(callwildcard2,$(addprefix$(obj)/,$(addsuffixsrc,$(callsubdirs-have-module,$(1),$(2))))))))\ $(evaldir:=$(subst$(obj)/,,$(substMakefile,,$(callwildcard2,\ $(addsuffix/Makefile,$(addprefix$(obj)/,$(_)))))))\ $(evalfile:=$(subst$(obj)/,,$(callwildcard2,$(addsuffix/*.c,\ $(addprefix$(obj)/,$(filter-out\ $(patsubst%/,%,$(dir)),$(_)))))))\ $(evalobj-y:=$(dir)$(patsubst%.c,%.o,$(file))) endefBuildALPSAddanewdriverinBuildALPSAddanewdriverinALPS
6.Do
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年生物基材料生產(chǎn)與銷售合同
- 2024旅游景區(qū)導(dǎo)游勞動(dòng)合同書含旅游行業(yè)創(chuàng)新發(fā)展研究2篇
- 7-2 《一名物理學(xué)家的教育歷程》說課稿 2023-2024學(xué)年統(tǒng)編版高中語文必修下冊
- 2024柚子果品質(zhì)量檢測與認(rèn)證服務(wù)合同3篇
- 2024年財(cái)務(wù)報(bào)表保密合同3篇
- 個(gè)人住宅租賃簡明合同樣本(2024版)版B版
- 2024年水產(chǎn)養(yǎng)殖聯(lián)盟協(xié)議3篇
- 福建省南平市武夷山第三中學(xué)高三地理月考試題含解析
- 個(gè)人融資擔(dān)保借款標(biāo)準(zhǔn)化協(xié)議樣本版
- 6 影子第二課時(shí) 說課稿-2024-2025學(xué)年語文一年級(jí)上冊統(tǒng)編版
- 關(guān)于水滸傳的題目單選題100道及答案解析
- 冠心病課件完整版本
- 磷化工產(chǎn)業(yè)鏈副產(chǎn)物資源農(nóng)業(yè)全量利用途徑分析
- 浙江省舟山市定海區(qū)2023-2024學(xué)年七年級(jí)上學(xué)期期末科學(xué)試題
- 倉庫安全培訓(xùn)考試題及答案
- 第六單元 中華民族的抗日戰(zhàn)爭 教學(xué)設(shè)計(jì) 2024-2025學(xué)年統(tǒng)編版八年級(jí)歷史上冊
- 公路工程標(biāo)準(zhǔn)施工招標(biāo)文件(2018年版)
- 初中古詩文言文背誦內(nèi)容
- 附件2:慢病管理中心評(píng)審實(shí)施細(xì)則2024年修訂版
- 《ISO56001-2024創(chuàng)新管理體系 - 要求》之4:“4組織環(huán)境-確定創(chuàng)新管理體系的范圍”解讀和應(yīng)用指導(dǎo)材料(雷澤佳編制-2024)
- 近三年投標(biāo)沒有發(fā)生過重大質(zhì)量安全事故的書面聲明范文
評(píng)論
0/150
提交評(píng)論