在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > GNU ARM匯編--(十七)u-boot的makefile和mkconfig解讀

            GNU ARM匯編--(十七)u-boot的makefile和mkconfig解讀

            作者: 時間:2016-11-26 來源:網(wǎng)絡(luò) 收藏
            [cpp]view plaincopy
            1. VERSION=2012
            2. PATCHLEVEL=07
            3. SUBLEVEL=
            4. EXTRAVERSION=
            5. ifneq"$(SUBLEVEL)"""
            6. U_BOOT_VERSION=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
            7. else
            8. U_BOOT_VERSION=$(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
            9. endif
            10. ################################
            11. #定義U_BOOT_VERSION為2012.07
            12. #####################################
            13. TIMESTAMP_FILE=$(obj)include/generated/timestamp_autogenerated.h
            14. VERSION_FILE=$(obj)include/generated/version_autogenerated.h
            15. ###############################
            16. #因為obj為空,所以定義TIMESTAMP_FILE為include/generated/timestamp_autogenerated.h
            17. #定義VERSION_FILE為include/generated/version_autogenerated.h
            18. #****************
            19. HOSTARCH:=$(shelluname-m|
            20. sed-es/i.86/x86/
            21. -es/sun4u/sparc64/
            22. -es/arm.*/arm/
            23. -es/sa110/arm/
            24. -es/ppc64/powerpc/
            25. -es/ppc/powerpc/
            26. -es/macppc/powerpc/
            27. -es/sh.*/sh/)
            28. HOSTOS:=$(shelluname-s|tr[:upper:][:lower:]|
            29. sed-es/.*/cygwin/)
            30. #Setshelltobashifpossible,otherwisefallbacktosh
            31. SHELL:=$(shellif[-x"$$BASH"];thenecho$$BASH;
            32. elseif[-x/bin/bash];thenecho/bin/bash;
            33. elseechosh;fi;fi)
            34. exportHOSTARCHHOSTOSSHELL
            35. #########################
            36. #HOSTARCH為i686,HOSTOS為linux,SHELL為/bin/sh
            37. #############################
            38. #Dealwithcollidingdefinitionsfromtcshetc.
            39. VENDOR=
            40. #########################################################################
            41. #Allowforsilentbuilds
            42. ifeq(,$(findstrings,$(MAKEFLAGS)))
            43. XECHO=echo
            44. else
            45. XECHO=:
            46. endif
            47. ###########################
            48. #因為MAKEFLAGS變量的字符串為空,找不到s,所以ifeq為真,XECHO=echo
            49. ###########################
            50. #########################################################################
            51. #
            52. #U-bootbuildsupportsproducingaobjectfilestotheseparateexternal
            53. #directory.Twousecasesaresupported:
            54. #
            55. #1)AddO=tothemakecommandline
            56. #makeO=/tmp/buildall
            57. #
            58. #2)SetenvironementvariableBUILD_DIRtopointtothedesiredlocation
            59. #exportBUILD_DIR=/tmp/build
            60. #make
            61. #
            62. #ThesecondapproachcanalsobeusedwithaMAKEALLscript
            63. #exportBUILD_DIR=/tmp/build
            64. #./MAKEALL
            65. #
            66. #CommandlineO=settingoverridesBUILD_DIRenvironentvariable.
            67. #
            68. #Whennoneoftheabovemethodsisusedthelocalbuildisperformedand
            69. #theobjectfilesareplacedinthesourcedirectory.
            70. #
            71. ifdefO
            72. ifeq("$(originO)","commandline")
            73. BUILD_DIR:=$(O)
            74. endif
            75. endif
            76. #################################
            77. #如果沒有在make命令行中定義O=/tmp之類的,那么BUILD_DIR就為/tmp,否則為空。
            78. #當(dāng)使用makeO=/tmp時,表明#ifdefO有定義,而$(originO)返回的就是"commandline"
            79. #################################
            80. ifneq($(BUILD_DIR),)
            81. saved-output:=$(BUILD_DIR)
            82. #Attempttocreateaoutputdirectory.
            83. $(shell[-d${BUILD_DIR}]||mkdir-p${BUILD_DIR})
            84. #Verifyifitwassuccessful.
            85. BUILD_DIR:=$(shellcd$(BUILD_DIR)&&/bin/pwd)
            86. $(if$(BUILD_DIR),,$(erroroutputdirectory"$(saved-output)"doesnotexist))
            87. endif#ifneq($(BUILD_DIR),)
            88. #################################
            89. #如果BUILD_DIR不為空,那么這幾句就執(zhí)行:
            90. #首先,saved-output變量也是BUILD_DIR的值
            91. #如果BUILD_DIR不存在,那么就創(chuàng)建BUILD_DIR目錄
            92. #檢測BUILD_DIR目錄是否成功建好了,如果有問題就輸出錯誤信息
            93. #################################
            94. OBJTREE:=$(if$(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
            95. SPLTREE:=$(OBJTREE)/spl
            96. SRCTREE:=$(CURDIR)
            97. TOPDIR:=$(SRCTREE)
            98. LNDIR:=$(OBJTREE)
            99. exportTOPDIRSRCTREEOBJTREESPLTREE
            100. ###########################################
            101. #如果BUILD_DIR有值,那么OBJTREE就是BUILD_DIR的值,如果BUILD_DIR為空,那么OBJTREE就是CURDIR的值,$(CURDIR)時GNUMake內(nèi)嵌的變量,是當(dāng)前目錄。
            102. #我們在make時候不加O=/tmp之類的參數(shù),所以O(shè)BJTREE就是當(dāng)前工作目錄,SPLTREE是當(dāng)前工作目錄下的spl目錄,SRCTREE時當(dāng)前工作目錄,TOPDIR也是當(dāng)前目錄,LNDIR也是當(dāng)前目錄。
            103. ##########################################
            104. MKCONFIG:=$(SRCTREE)/mkconfig
            105. exportMKCONFIG
            106. #############################################
            107. #MKCONFIG定義為當(dāng)前工作目錄下的mkconfig腳本,并export
            108. #############################################
            109. ifneq($(OBJTREE),$(SRCTREE))
            110. REMOTE_BUILD:=1
            111. exportREMOTE_BUILD
            112. endif
            113. ####################################################################
            114. #在我們的執(zhí)行中,OBJTREE和SRCTREE是相等的,所以不管了
            115. ###################################################################
            116. #$(obj)and(src)aredefinedinconfig.mkbuthereinmainMakefile
            117. #wealsoneedthembeforeconfig.mkisincludedwhichisthecasefor
            118. #sometargetslikeunconfig,clean,clobber,distclean,etc.
            119. ifneq($(OBJTREE),$(SRCTREE))
            120. obj:=$(OBJTREE)/
            121. src:=$(SRCTREE)/
            122. else
            123. obj:=
            124. src:=
            125. endif
            126. exportobjsrc
            127. #######################################
            128. #可以先看下上面的注釋因為兩個路徑相同,所以執(zhí)行else
            129. #########################################
            130. #MakesureCDPATHsettingsdontinterfere
            131. unexportCDPATH
            132. #########################################################################
            133. #The"tools"areneededearly,soputthisfirst
            134. #Dontincludestuffalreadydonein$(LIBS)
            135. #The"examples"conditionallydependonU-Boot(say,whenUSE_PRIVATE_LIBGCC
            136. #is"yes"),socompileexamplesafterU-Bootiscompiled.
            137. SUBDIR_TOOLS=tools
            138. SUBDIR_EXAMPLES=examples/standaloneexamples/api
            139. SUBDIRS=$(SUBDIR_TOOLS)
            140. ###############################################
            141. #定義SUBDIR_TOOLSSUBDIR_EXAMPLES和SUBDIRS
            142. ###############################################
            143. .PHONY:$(SUBDIRS)$(VERSION_FILE)$(TIMESTAMP_FILE)
            144. ########################
            145. #定義幾個偽目標(biāo)
            146. ########################
            147. ifeq($(obj)include/config.mk,$(wildcard$(obj)include/config.mk))
            148. #Includeautoconf.mkbeforeconfig.mksothattheconfigoptionsareavailable
            149. #toalltoplevelbuildfiles.Weneedthedummyall:targettopreventthe
            150. #dependencytargetinautoconf.mk.depfrombeingthedefault.
            151. all:
            152. sinclude$(obj)include/autoconf.mk.dep
            153. sinclude$(obj)include/autoconf.mk
            154. ###################################################################################
            155. #包含auoconf.mk和autoconf.mk.dep文件
            156. ###################################################################################
            157. ifndefCONFIG_SANDBOX
            158. SUBDIRS+=$(SUBDIR_EXAMPLES)
            159. endif
            160. ###################################
            161. #追加SUBDIRS為"toolsexamples/standaloneexamples/api"
            162. ###################################
            163. #loadARCH,BOARD,andCPUconfiguration
            164. include$(obj)include/config.mk
            165. exportARCHCPUBOARDVENDORSOC
            166. #######################################
            167. #包含include/config.mk文件,這個文件是在makexxx_config過程中產(chǎn)生的
            168. #######################################
            169. #setdefaulttonothingfornativebuilds
            170. ifeq($(HOSTARCH),$(ARCH))
            171. CROSS_COMPILE?=
            172. endif
            173. #######################################
            174. #看看注釋就知道了,但是很顯示我們的HOSTARCH是x86的,目標(biāo)時arm的
            175. ########################################
            176. #loadotherconfiguration
            177. include$(TOPDIR)/config.mk
            178. #######################################
            179. #包含uboot頂層目錄的config.mk文件
            180. #######################################
            181. #IfboardcodeexplicitlyspecifiedLDSCRIPTorCONFIG_SYS_LDSCRIPT,use
            182. #that(orfailifabsent).Otherwise,searchforalinkerscriptina
            183. #standardlocation.
            184. LDSCRIPT_MAKEFILE_DIR=$(dir$(LDSCRIPT))
            185. ##############################################################################
            186. #用等號賦值的變量是遞歸方式擴展的變量。變量定義時,變量值中對其他變量的引用不會被替換展開;
            187. #而是變量在引用它的地方替換展開的同時,它所引用的其它變量才會被一同替換展開。
            188. #其優(yōu)點是:
            189. #這種類型變量在定義時,可以引用其它的之前沒有定義的變量(可能在后續(xù)部分定義,或者是通過make的命令行選項傳遞的變量)。
            190. #LDSCRIPT變量就是后面才定義的
            191. ##############################################################################
            192. ifndefLDSCRIPT
            193. #LDSCRIPT:=$(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
            194. ifdefCONFIG_SYS_LDSCRIPT
            195. #needtostripoffdoublequotes
            196. LDSCRIPT:=$(subst",,$(CONFIG_SYS_LDSCRIPT))
            197. endif
            198. endif
            199. #######################################################################################
            200. #如果定義了CONFIG_SYS_LDSCRIPT,將CONFIG_SYS_LDSCRIPT代表的字符串去掉雙引號后賦值給LDSCRIPT變量
            201. #這里我們并沒有定義CONFIG_SYS_LDSCRIPT
            202. #######################################################################################
            203. #Ifthereisnospecifiedlinkscript,welookinanumberofplacesforit
            204. ifndefLDSCRIPT
            205. ifeq($(CONFIG_NAND_U_BOOT),y)
            206. LDSCRIPT:=$(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
            207. ifeq($(wildcard$(LDSCRIPT)),)
            208. LDSCRIPT:=$(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
            209. endif
            210. endif
            211. ifeq($(wildcard$(LDSCRIPT)),)
            212. LDSCRIPT:=$(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
            213. endif
            214. ifeq($(wildcard$(LDSCRIPT)),)
            215. LDSCRIPT:=$(TOPDIR)/$(CPUDIR)/u-boot.lds
            216. endif
            217. ifeq($(wildcard$(LDSCRIPT)),)
            218. LDSCRIPT:=$(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
            219. #WedontexpectaMakefilehere
            220. LDSCRIPT_MAKEFILE_DIR=
            221. endif
            222. ifeq($(wildcard$(LDSCRIPT)),)
            223. $(errorcouldnotfindlinkerscript)
            224. endif
            225. endif
            226. ##########################################################################################
            227. #注釋寫的很明確,如果沒有用CONFIG_SYS_LDSCRIPT指定LDSCRIPT,那么就在幾個地方搜
            228. #第一個地方:如果CONFIG_NAND_U_BOOT是y,就用u-boot-nand.lds但是這里沒有這個定義
            229. #第一個地方?jīng)]找到,就找第二個地方:u-boot-2012.07/board/samsung/smdk2410這個目錄沒有u-boot.lds文件
            230. #第二個地方?jīng)]找到,就找第三個地方:其中CPUDIR是在頂層的config.mk中定義的,在arch/arm/cpu/arm920t中找這個目錄也沒有
            231. #第三個地方?jīng)]找到,就找第四個地方:arch/arm/cpu/u-boot.lds,這里就找到了?。。。?/li>
            232. ##########################################################################################
            233. #########################################################################
            234. #U-Bootobjects....orderisimportant(i.e.startmustbefirst)
            235. OBJS=$(CPUDIR)/start.o
            236. ifeq($(CPU),x86)
            237. OBJS+=$(CPUDIR)/start16.o
            238. OBJS+=$(CPUDIR)/resetvec.o
            239. endif
            240. ifeq($(CPU),ppc4xx)
            241. OBJS+=$(CPUDIR)/resetvec.o
            242. endif
            243. ifeq($(CPU),mpc85xx)
            244. OBJS+=$(CPUDIR)/resetvec.o
            245. endif
            246. OBJS:=$(addprefix$(obj),$(OBJS))
            247. #####################################
            248. #為OBJS增加前綴,其中obj在頂層目錄的config.mk中定義,這里根據(jù)實際情況OBJS就是arch/arm/cpu/arm920t/start.o
            249. #####################################
            250. LIBS=lib/libgeneric.o
            251. LIBS+=lib/lzma/liblzma.o
            252. LIBS+=lib/lzo/liblzo.o
            253. LIBS+=lib/zlib/libz.o
            254. ifeq($(CONFIG_TIZEN),y)
            255. LIBS+=lib/tizen/libtizen.o
            256. endif
            257. LIBS+=$(shellif[-fboard/$(VENDOR)/common/Makefile];thenecho
            258. "board/$(VENDOR)/common/lib$(VENDOR).o";fi)
            259. LIBS+=$(CPUDIR)/lib$(CPU).o
            260. ifdefSOC
            261. LIBS+=$(CPUDIR)/$(SOC)/lib$(SOC).o
            262. endif
            263. ifeq($(CPU),ixp)
            264. LIBS+=arch/arm/cpu/ixp/npe/libnpe.o
            265. endif
            266. ifeq($(CONFIG_OF_EMBED),y)
            267. LIBS+=dts/libdts.o
            268. endif
            269. LIBS+=arch/$(ARCH)/lib/lib$(ARCH).o
            270. LIBS+=fs/cramfs/libcramfs.ofs/fat/libfat.ofs/fdos/libfdos.ofs/jffs2/libjffs2.o
            271. fs/reiserfs/libreiserfs.ofs/ext2/libext2fs.ofs/yaffs2/libyaffs2.o
            272. fs/ubifs/libubifs.o
            273. LIBS+=net/libnet.o
            274. LIBS+=disk/libdisk.o
            275. LIBS+=drivers/bios_emulator/libatibiosemu.o
            276. LIBS+=drivers/block/libblock.o
            277. LIBS+=drivers/dma/libdma.o
            278. LIBS+=drivers/fpga/libfpga.o
            279. LIBS+=drivers/gpio/libgpio.o
            280. LIBS+=drivers/hwmon/libhwmon.o
            281. LIBS+=drivers/i2c/libi2c.o
            282. LIBS+=drivers/input/libinput.o
            283. LIBS+=drivers/misc/libmisc.o
            284. LIBS+=drivers/mmc/libmmc.o
            285. LIBS+=drivers/mtd/libmtd.o
            286. LIBS+=drivers/mtd/nand/libnand.o
            287. LIBS+=drivers/mtd/onenand/libonenand.o
            288. LIBS+=drivers/mtd/ubi/libubi.o
            289. LIBS+=drivers/mtd/spi/libspi_flash.o
            290. LIBS+=drivers/net/libnet.o
            291. LIBS+=drivers/net/phy/libphy.o
            292. LIBS+=drivers/pci/libpci.o
            293. LIBS+=drivers/pcmcia/libpcmcia.o
            294. LIBS+=drivers/power/libpower.o
            295. LIBS+=drivers/spi/libspi.o
            296. ifeq($(CPU),mpc83xx)
            297. LIBS+=drivers/qe/libqe.o
            298. LIBS+=arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
            299. LIBS+=arch/powerpc/cpu/mpc8xxx/lib8xxx.o
            300. endif
            301. ifeq($(CPU),mpc85xx)
            302. LIBS+=drivers/qe/libqe.o
            303. LIBS+=drivers/net/fm/libfm.o
            304. LIBS+=arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
            305. LIBS+=arch/powerpc/cpu/mpc8xxx/lib8xxx.o
            306. endif
            307. ifeq($(CPU),mpc86xx)
            308. LIBS+=arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
            309. LIBS+=arch/powerpc/cpu/mpc8xxx/lib8xxx.o
            310. endif
            311. LIBS+=drivers/rtc/librtc.o
            312. LIBS+=drivers/serial/libserial.o
            313. ifeq($(CONFIG_GENERIC_LPC_TPM),y)
            314. LIBS+=drivers/tpm/libtpm.o
            315. endif
            316. LIBS+=drivers/twserial/libtws.o
            317. LIBS+=drivers/usb/eth/libusb_eth.o
            318. LIBS+=drivers/usb/gadget/libusb_gadget.o
            319. LIBS+=drivers/usb/host/libusb_host.o
            320. LIBS+=drivers/usb/musb/libusb_musb.o
            321. LIBS+=drivers/usb/phy/libusb_phy.o
            322. LIBS+=drivers/usb/ulpi/libusb_ulpi.o
            323. LIBS+=drivers/video/libvideo.o
            324. LIBS+=drivers/watchdog/libwatchdog.o
            325. LIBS+=common/libcommon.o
            326. LIBS+=lib/libfdt/libfdt.o
            327. LIBS+=api/libapi.o
            328. LIBS+=post/libpost.o
            329. ifneq($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
            330. LIBS+=$(CPUDIR)/omap-common/libomap-common.o
            331. endif
            332. ifeq($(SOC),mx5)
            333. LIBS+=$(CPUDIR)/imx-common/libimx-common.o
            334. endif
            335. ifeq($(SOC),mx6)
            336. LIBS+=$(CPUDIR)/imx-common/libimx-common.o
            337. endif
            338. ifeq($(SOC),s5pc1xx)
            339. LIBS+=$(CPUDIR)/s5p-common/libs5p-common.o
            340. endif
            341. ifeq($(SOC),exynos)
            342. LIBS+=$(CPUDIR)/s5p-common/libs5p-common.o
            343. endif


            關(guān)鍵詞: ARM匯編u-bootmakefilemkconfi

            評論


            技術(shù)專區(qū)

            關(guān)閉