Makefile 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175
  1. #
  2. # (C) Copyright 2000-2010
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. #
  5. # See file CREDITS for list of people who contributed to this
  6. # project.
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public License as
  10. # published by the Free Software Foundatio; either version 2 of
  11. # the License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. # MA 02111-1307 USA
  22. #
  23. VERSION = 2011
  24. PATCHLEVEL = 06
  25. SUBLEVEL =
  26. EXTRAVERSION = -rc1
  27. ifneq "$(SUBLEVEL)" ""
  28. U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
  29. else
  30. U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
  31. endif
  32. TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
  33. VERSION_FILE = $(obj)include/version_autogenerated.h
  34. HOSTARCH := $(shell uname -m | \
  35. sed -e s/i.86/x86/ \
  36. -e s/sun4u/sparc64/ \
  37. -e s/arm.*/arm/ \
  38. -e s/sa110/arm/ \
  39. -e s/ppc64/powerpc/ \
  40. -e s/ppc/powerpc/ \
  41. -e s/macppc/powerpc/\
  42. -e s/sh.*/sh/)
  43. HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
  44. sed -e 's/\(cygwin\).*/cygwin/')
  45. # Set shell to bash if possible, otherwise fall back to sh
  46. SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
  47. else if [ -x /bin/bash ]; then echo /bin/bash; \
  48. else echo sh; fi; fi)
  49. export HOSTARCH HOSTOS SHELL
  50. # Deal with colliding definitions from tcsh etc.
  51. VENDOR=
  52. #########################################################################
  53. # Allow for silent builds
  54. ifeq (,$(findstring s,$(MAKEFLAGS)))
  55. XECHO = echo
  56. else
  57. XECHO = :
  58. endif
  59. #########################################################################
  60. #
  61. # U-boot build supports producing a object files to the separate external
  62. # directory. Two use cases are supported:
  63. #
  64. # 1) Add O= to the make command line
  65. # 'make O=/tmp/build all'
  66. #
  67. # 2) Set environement variable BUILD_DIR to point to the desired location
  68. # 'export BUILD_DIR=/tmp/build'
  69. # 'make'
  70. #
  71. # The second approach can also be used with a MAKEALL script
  72. # 'export BUILD_DIR=/tmp/build'
  73. # './MAKEALL'
  74. #
  75. # Command line 'O=' setting overrides BUILD_DIR environent variable.
  76. #
  77. # When none of the above methods is used the local build is performed and
  78. # the object files are placed in the source directory.
  79. #
  80. ifdef O
  81. ifeq ("$(origin O)", "command line")
  82. BUILD_DIR := $(O)
  83. endif
  84. endif
  85. ifneq ($(BUILD_DIR),)
  86. saved-output := $(BUILD_DIR)
  87. # Attempt to create a output directory.
  88. $(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
  89. # Verify if it was successful.
  90. BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
  91. $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
  92. endif # ifneq ($(BUILD_DIR),)
  93. OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
  94. SRCTREE := $(CURDIR)
  95. TOPDIR := $(SRCTREE)
  96. LNDIR := $(OBJTREE)
  97. export TOPDIR SRCTREE OBJTREE
  98. MKCONFIG := $(SRCTREE)/mkconfig
  99. export MKCONFIG
  100. ifneq ($(OBJTREE),$(SRCTREE))
  101. REMOTE_BUILD := 1
  102. export REMOTE_BUILD
  103. endif
  104. # $(obj) and (src) are defined in config.mk but here in main Makefile
  105. # we also need them before config.mk is included which is the case for
  106. # some targets like unconfig, clean, clobber, distclean, etc.
  107. ifneq ($(OBJTREE),$(SRCTREE))
  108. obj := $(OBJTREE)/
  109. src := $(SRCTREE)/
  110. else
  111. obj :=
  112. src :=
  113. endif
  114. export obj src
  115. # Make sure CDPATH settings don't interfere
  116. unexport CDPATH
  117. #########################################################################
  118. # The "tools" are needed early, so put this first
  119. # Don't include stuff already done in $(LIBS)
  120. SUBDIRS = tools \
  121. examples/standalone \
  122. examples/api
  123. .PHONY : $(SUBDIRS)
  124. ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
  125. # Include autoconf.mk before config.mk so that the config options are available
  126. # to all top level build files. We need the dummy all: target to prevent the
  127. # dependency target in autoconf.mk.dep from being the default.
  128. all:
  129. sinclude $(obj)include/autoconf.mk.dep
  130. sinclude $(obj)include/autoconf.mk
  131. # load ARCH, BOARD, and CPU configuration
  132. include $(obj)include/config.mk
  133. export ARCH CPU BOARD VENDOR SOC
  134. # set default to nothing for native builds
  135. ifeq ($(HOSTARCH),$(ARCH))
  136. CROSS_COMPILE ?=
  137. endif
  138. # load other configuration
  139. include $(TOPDIR)/config.mk
  140. #########################################################################
  141. # U-Boot objects....order is important (i.e. start must be first)
  142. OBJS = $(CPUDIR)/start.o
  143. ifeq ($(CPU),x86)
  144. OBJS += $(CPUDIR)/start16.o
  145. OBJS += $(CPUDIR)/resetvec.o
  146. endif
  147. ifeq ($(CPU),ppc4xx)
  148. OBJS += $(CPUDIR)/resetvec.o
  149. endif
  150. ifeq ($(CPU),mpc85xx)
  151. OBJS += $(CPUDIR)/resetvec.o
  152. endif
  153. OBJS := $(addprefix $(obj),$(OBJS))
  154. LIBS = lib/libgeneric.o
  155. LIBS += lib/lzma/liblzma.o
  156. LIBS += lib/lzo/liblzo.o
  157. LIBS += lib/zlib/libz.o
  158. LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
  159. "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
  160. LIBS += $(CPUDIR)/lib$(CPU).o
  161. ifdef SOC
  162. LIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o
  163. endif
  164. ifeq ($(CPU),ixp)
  165. LIBS += arch/arm/cpu/ixp/npe/libnpe.o
  166. endif
  167. LIBS += arch/$(ARCH)/lib/lib$(ARCH).o
  168. LIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \
  169. fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \
  170. fs/ubifs/libubifs.o
  171. LIBS += net/libnet.o
  172. LIBS += disk/libdisk.o
  173. LIBS += drivers/bios_emulator/libatibiosemu.o
  174. LIBS += drivers/block/libblock.o
  175. LIBS += drivers/dma/libdma.o
  176. LIBS += drivers/fpga/libfpga.o
  177. LIBS += drivers/gpio/libgpio.o
  178. LIBS += drivers/hwmon/libhwmon.o
  179. LIBS += drivers/i2c/libi2c.o
  180. LIBS += drivers/input/libinput.o
  181. LIBS += drivers/misc/libmisc.o
  182. LIBS += drivers/mmc/libmmc.o
  183. LIBS += drivers/mtd/libmtd.o
  184. LIBS += drivers/mtd/nand/libnand.o
  185. LIBS += drivers/mtd/onenand/libonenand.o
  186. LIBS += drivers/mtd/ubi/libubi.o
  187. LIBS += drivers/mtd/spi/libspi_flash.o
  188. LIBS += drivers/net/libnet.o
  189. LIBS += drivers/net/phy/libphy.o
  190. LIBS += drivers/pci/libpci.o
  191. LIBS += drivers/pcmcia/libpcmcia.o
  192. LIBS += drivers/power/libpower.o
  193. LIBS += drivers/spi/libspi.o
  194. ifeq ($(CPU),mpc83xx)
  195. LIBS += drivers/qe/libqe.o
  196. LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
  197. endif
  198. ifeq ($(CPU),mpc85xx)
  199. LIBS += drivers/qe/libqe.o
  200. LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
  201. LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
  202. endif
  203. ifeq ($(CPU),mpc86xx)
  204. LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
  205. LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
  206. endif
  207. LIBS += drivers/rtc/librtc.o
  208. LIBS += drivers/serial/libserial.o
  209. LIBS += drivers/twserial/libtws.o
  210. LIBS += drivers/usb/eth/libusb_eth.a
  211. LIBS += drivers/usb/gadget/libusb_gadget.o
  212. LIBS += drivers/usb/host/libusb_host.o
  213. LIBS += drivers/usb/musb/libusb_musb.o
  214. LIBS += drivers/usb/phy/libusb_phy.o
  215. LIBS += drivers/video/libvideo.o
  216. LIBS += drivers/watchdog/libwatchdog.o
  217. LIBS += common/libcommon.o
  218. LIBS += lib/libfdt/libfdt.o
  219. LIBS += api/libapi.o
  220. LIBS += post/libpost.o
  221. ifeq ($(SOC),omap3)
  222. LIBS += $(CPUDIR)/omap-common/libomap-common.o
  223. endif
  224. ifeq ($(SOC),omap4)
  225. LIBS += $(CPUDIR)/omap-common/libomap-common.o
  226. endif
  227. ifeq ($(SOC),s5pc1xx)
  228. LIBS += $(CPUDIR)/s5p-common/libs5p-common.o
  229. endif
  230. ifeq ($(SOC),s5pc2xx)
  231. LIBS += $(CPUDIR)/s5p-common/libs5p-common.o
  232. endif
  233. LIBS := $(addprefix $(obj),$(sort $(LIBS)))
  234. .PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)
  235. LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
  236. LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
  237. # Add GCC lib
  238. ifdef USE_PRIVATE_LIBGCC
  239. ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
  240. PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
  241. else
  242. PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
  243. endif
  244. else
  245. PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
  246. endif
  247. PLATFORM_LIBS += $(PLATFORM_LIBGCC)
  248. export PLATFORM_LIBS
  249. # Special flags for CPP when processing the linker script.
  250. # Pass the version down so we can handle backwards compatibility
  251. # on the fly.
  252. LDPPFLAGS += \
  253. -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
  254. $(shell $(LD) --version | \
  255. sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
  256. __OBJS := $(subst $(obj),,$(OBJS))
  257. __LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
  258. #########################################################################
  259. #########################################################################
  260. ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
  261. BOARD_SIZE_CHECK = \
  262. @actual=`wc -c $@ | awk '{print $$1}'`; \
  263. limit=$(CONFIG_BOARD_SIZE_LIMIT); \
  264. if test $$actual -gt $$limit; then \
  265. echo "$@ exceeds file size limit:"; \
  266. echo " limit: $$limit bytes"; \
  267. echo " actual: $$actual bytes"; \
  268. echo " excess: $$((actual - limit)) bytes"; \
  269. exit 1; \
  270. fi
  271. else
  272. BOARD_SIZE_CHECK =
  273. endif
  274. # Always append ALL so that arch config.mk's can add custom ones
  275. ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
  276. ifeq ($(CONFIG_NAND_U_BOOT),y)
  277. ALL += $(obj)u-boot-nand.bin
  278. endif
  279. ifeq ($(CONFIG_ONENAND_U_BOOT),y)
  280. ALL += $(obj)u-boot-onenand.bin
  281. ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
  282. endif
  283. ifeq ($(CONFIG_MMC_U_BOOT),y)
  284. ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
  285. endif
  286. all: $(ALL)
  287. $(obj)u-boot.hex: $(obj)u-boot
  288. $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
  289. $(obj)u-boot.srec: $(obj)u-boot
  290. $(OBJCOPY) -O srec $< $@
  291. $(obj)u-boot.bin: $(obj)u-boot
  292. $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
  293. $(BOARD_SIZE_CHECK)
  294. $(obj)u-boot.ldr: $(obj)u-boot
  295. $(CREATE_LDR_ENV)
  296. $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
  297. $(BOARD_SIZE_CHECK)
  298. $(obj)u-boot.ldr.hex: $(obj)u-boot.ldr
  299. $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
  300. $(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
  301. $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
  302. $(obj)u-boot.img: $(obj)u-boot.bin
  303. $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  304. -a $(CONFIG_SYS_TEXT_BASE) -e 0 \
  305. -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
  306. sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
  307. -d $< $@
  308. $(obj)u-boot.imx: $(obj)u-boot.bin
  309. $(obj)tools/mkimage -n $(CONFIG_IMX_CONFIG) -T imximage \
  310. -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
  311. $(obj)u-boot.kwb: $(obj)u-boot.bin
  312. $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
  313. -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
  314. $(obj)u-boot.sha1: $(obj)u-boot.bin
  315. $(obj)tools/ubsha1 $(obj)u-boot.bin
  316. $(obj)u-boot.dis: $(obj)u-boot
  317. $(OBJDUMP) -d $< > $@
  318. GEN_UBOOT = \
  319. UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
  320. sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
  321. cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \
  322. --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
  323. -Map u-boot.map -o u-boot
  324. $(obj)u-boot: depend \
  325. $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
  326. $(GEN_UBOOT)
  327. ifeq ($(CONFIG_KALLSYMS),y)
  328. smap=`$(call SYSTEM_MAP,u-boot) | \
  329. awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
  330. $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
  331. -c common/system_map.c -o $(obj)common/system_map.o
  332. $(GEN_UBOOT) $(obj)common/system_map.o
  333. endif
  334. $(OBJS): depend
  335. $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
  336. $(LIBS): depend $(SUBDIRS)
  337. $(MAKE) -C $(dir $(subst $(obj),,$@))
  338. $(LIBBOARD): depend $(LIBS)
  339. $(MAKE) -C $(dir $(subst $(obj),,$@))
  340. $(SUBDIRS): depend
  341. $(MAKE) -C $@ all
  342. $(LDSCRIPT): depend
  343. $(MAKE) -C $(dir $@) $(notdir $@)
  344. $(obj)u-boot.lds: $(LDSCRIPT)
  345. $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  346. nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend
  347. $(MAKE) -C nand_spl/board/$(BOARDDIR) all
  348. $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
  349. cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
  350. onenand_ipl: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
  351. $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
  352. $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin
  353. cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
  354. mmc_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend
  355. $(MAKE) -C mmc_spl/board/$(BOARDDIR) all
  356. $(obj)mmc_spl/u-boot-mmc-spl.bin: mmc_spl
  357. $(VERSION_FILE):
  358. @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
  359. printf '#define PLAIN_VERSION "%s%s"\n' \
  360. "$(U_BOOT_VERSION)" "$${localvers}" ; \
  361. printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
  362. "$(U_BOOT_VERSION)" "$${localvers}" ; \
  363. ) > $@.tmp
  364. @( printf '#define CC_VERSION_STRING "%s"\n' \
  365. '$(shell $(CC) --version | head -n 1)' )>> $@.tmp
  366. @( printf '#define LD_VERSION_STRING "%s"\n' \
  367. '$(shell $(LD) -v | head -n 1)' )>> $@.tmp
  368. @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
  369. $(TIMESTAMP_FILE):
  370. @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
  371. @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
  372. updater:
  373. $(MAKE) -C tools/updater all
  374. # Explicitly make _depend in subdirs containing multiple targets to prevent
  375. # parallel sub-makes creating .depend files simultaneously.
  376. depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
  377. $(obj)include/autoconf.mk \
  378. $(obj)include/generated/generic-asm-offsets.h
  379. for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
  380. $(MAKE) -C $$dir _depend ; done
  381. TAG_SUBDIRS = $(SUBDIRS)
  382. TAG_SUBDIRS += $(dir $(__LIBS))
  383. TAG_SUBDIRS += include
  384. tags ctags:
  385. ctags -w -o $(obj)ctags `find $(TAG_SUBDIRS) \
  386. -name '*.[chS]' -print`
  387. etags:
  388. etags -a -o $(obj)etags `find $(TAG_SUBDIRS) \
  389. -name '*.[chS]' -print`
  390. cscope:
  391. find $(TAG_SUBDIRS) -name '*.[chS]' -print > cscope.files
  392. cscope -b -q -k
  393. SYSTEM_MAP = \
  394. $(NM) $1 | \
  395. grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
  396. LC_ALL=C sort
  397. $(obj)System.map: $(obj)u-boot
  398. @$(call SYSTEM_MAP,$<) > $(obj)System.map
  399. #
  400. # Auto-generate the autoconf.mk file (which is included by all makefiles)
  401. #
  402. # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
  403. # the dep file is only include in this top level makefile to determine when
  404. # to regenerate the autoconf.mk file.
  405. $(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
  406. @$(XECHO) Generating $@ ; \
  407. set -e ; \
  408. : Generate the dependancies ; \
  409. $(CC) -x c -DDO_DEPS_ONLY -M $(HOSTCFLAGS) $(CPPFLAGS) \
  410. -MQ $(obj)include/autoconf.mk include/common.h > $@
  411. $(obj)include/autoconf.mk: $(obj)include/config.h
  412. @$(XECHO) Generating $@ ; \
  413. set -e ; \
  414. : Extract the config macros ; \
  415. $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
  416. sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
  417. mv $@.tmp $@
  418. $(obj)include/generated/generic-asm-offsets.h: $(obj)include/autoconf.mk.dep \
  419. $(obj)lib/asm-offsets.s
  420. @$(XECHO) Generating $@
  421. tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
  422. $(obj)lib/asm-offsets.s: $(obj)include/autoconf.mk.dep \
  423. $(src)lib/asm-offsets.c
  424. @mkdir -p $(obj)lib
  425. $(CC) -DDO_DEPS_ONLY \
  426. $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
  427. -o $@ $(src)lib/asm-offsets.c -c -S
  428. #########################################################################
  429. else # !config.mk
  430. all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
  431. $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
  432. $(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) $(VERSION_FILE) \
  433. updater depend dep tags ctags etags cscope $(obj)System.map:
  434. @echo "System not configured - see README" >&2
  435. @ exit 1
  436. tools:
  437. $(MAKE) -C $@ all
  438. endif # config.mk
  439. easylogo env gdb:
  440. $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
  441. gdbtools: gdb
  442. tools-all: easylogo env gdb
  443. $(MAKE) -C tools HOST_TOOLS_ALL=y
  444. .PHONY : CHANGELOG
  445. CHANGELOG:
  446. git log --no-merges U-Boot-1_1_5.. | \
  447. unexpand -a | sed -e 's/\s\s*$$//' > $@
  448. include/license.h: tools/bin2header COPYING
  449. cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
  450. #########################################################################
  451. unconfig:
  452. @rm -f $(obj)include/config.h $(obj)include/config.mk \
  453. $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
  454. $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
  455. %_config:: unconfig
  456. @$(MKCONFIG) -A $(@:_config=)
  457. sinclude $(obj).boards.depend
  458. $(obj).boards.depend: boards.cfg
  459. awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
  460. #
  461. # Functions to generate common board directory names
  462. #
  463. lcname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/')
  464. ucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
  465. #########################################################################
  466. ## Coldfire
  467. #########################################################################
  468. astro_mcf5373l_config \
  469. astro_mcf5373l_RAM_config : unconfig
  470. @$(MKCONFIG) -n $@ -t $@ astro_mcf5373l m68k mcf532x mcf5373l astro
  471. M52277EVB_config \
  472. M52277EVB_spansion_config \
  473. M52277EVB_stmicro_config : unconfig
  474. @case "$@" in \
  475. M52277EVB_config) FLASH=SPANSION;; \
  476. M52277EVB_spansion_config) FLASH=SPANSION;; \
  477. M52277EVB_stmicro_config) FLASH=STMICRO;; \
  478. esac; \
  479. if [ "$${FLASH}" = "SPANSION" ] ; then \
  480. echo "#define CONFIG_SYS_SPANSION_BOOT" >> $(obj)include/config.h ; \
  481. echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m52277evb/config.tmp ; \
  482. cp $(obj)board/freescale/m52277evb/u-boot.spa $(obj)board/freescale/m52277evb/u-boot.lds ; \
  483. fi; \
  484. if [ "$${FLASH}" = "STMICRO" ] ; then \
  485. echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \
  486. echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \
  487. echo "CONFIG_SYS_TEXT_BASE = 0x43E00000" > $(obj)board/freescale/m52277evb/config.tmp ; \
  488. cp $(obj)board/freescale/m52277evb/u-boot.stm $(obj)board/freescale/m52277evb/u-boot.lds ; \
  489. fi
  490. @$(MKCONFIG) -n $@ -a M52277EVB m68k mcf5227x m52277evb freescale
  491. M5235EVB_config \
  492. M5235EVB_Flash16_config \
  493. M5235EVB_Flash32_config: unconfig
  494. @case "$@" in \
  495. M5235EVB_config) FLASH=16;; \
  496. M5235EVB_Flash16_config) FLASH=16;; \
  497. M5235EVB_Flash32_config) FLASH=32;; \
  498. esac; \
  499. if [ "$${FLASH}" != "16" ] ; then \
  500. echo "#define NORFLASH_PS32BIT 1" >> $(obj)include/config.h ; \
  501. echo "CONFIG_SYS_TEXT_BASE = 0xFFC00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
  502. cp $(obj)board/freescale/m5235evb/u-boot.32 $(obj)board/freescale/m5235evb/u-boot.lds ; \
  503. else \
  504. echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
  505. cp $(obj)board/freescale/m5235evb/u-boot.16 $(obj)board/freescale/m5235evb/u-boot.lds ; \
  506. fi
  507. @$(MKCONFIG) -n $@ -a M5235EVB m68k mcf523x m5235evb freescale
  508. cobra5272_config : unconfig
  509. @$(MKCONFIG) $@ m68k mcf52x2 cobra5272
  510. EB+MCF-EV123_config : unconfig
  511. @mkdir -p $(obj)include
  512. @mkdir -p $(obj)board/BuS/EB+MCF-EV123
  513. @echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
  514. @$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
  515. EB+MCF-EV123_internal_config : unconfig
  516. @mkdir -p $(obj)include
  517. @mkdir -p $(obj)board/BuS/EB+MCF-EV123
  518. @echo "CONFIG_SYS_TEXT_BASE = 0xF0000000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
  519. @$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
  520. M5329AFEE_config \
  521. M5329BFEE_config : unconfig
  522. @case "$@" in \
  523. M5329AFEE_config) NAND=0;; \
  524. M5329BFEE_config) NAND=16;; \
  525. esac; \
  526. if [ "$${NAND}" != "0" ] ; then \
  527. echo "#define NANDFLASH_SIZE $${NAND}" > $(obj)include/config.h ; \
  528. fi
  529. @$(MKCONFIG) -n $@ -a M5329EVB m68k mcf532x m5329evb freescale
  530. M5373EVB_config : unconfig
  531. @case "$@" in \
  532. M5373EVB_config) NAND=16;; \
  533. esac; \
  534. if [ "$${NAND}" != "0" ] ; then \
  535. echo "#define NANDFLASH_SIZE $${NAND}" > $(obj)include/config.h ; \
  536. fi
  537. @$(MKCONFIG) -a M5373EVB m68k mcf532x m5373evb freescale
  538. M54451EVB_config \
  539. M54451EVB_stmicro_config : unconfig
  540. @case "$@" in \
  541. M54451EVB_config) FLASH=NOR;; \
  542. M54451EVB_stmicro_config) FLASH=STMICRO;; \
  543. esac; \
  544. if [ "$${FLASH}" = "NOR" ] ; then \
  545. echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54451evb/config.tmp ; \
  546. cp $(obj)board/freescale/m54451evb/u-boot.spa $(obj)board/freescale/m54451evb/u-boot.lds ; \
  547. fi; \
  548. if [ "$${FLASH}" = "STMICRO" ] ; then \
  549. echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \
  550. echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \
  551. echo "CONFIG_SYS_TEXT_BASE = 0x47E00000" > $(obj)board/freescale/m54451evb/config.tmp ; \
  552. cp $(obj)board/freescale/m54451evb/u-boot.stm $(obj)board/freescale/m54451evb/u-boot.lds ; \
  553. fi; \
  554. echo "#define CONFIG_SYS_INPUT_CLKSRC 24000000" >> $(obj)include/config.h ;
  555. @$(MKCONFIG) -n $@ -a M54451EVB m68k mcf5445x m54451evb freescale
  556. M54455EVB_config \
  557. M54455EVB_atmel_config \
  558. M54455EVB_intel_config \
  559. M54455EVB_a33_config \
  560. M54455EVB_a66_config \
  561. M54455EVB_i33_config \
  562. M54455EVB_i66_config \
  563. M54455EVB_stm33_config : unconfig
  564. @case "$@" in \
  565. M54455EVB_config) FLASH=ATMEL; FREQ=33333333;; \
  566. M54455EVB_atmel_config) FLASH=ATMEL; FREQ=33333333;; \
  567. M54455EVB_intel_config) FLASH=INTEL; FREQ=33333333;; \
  568. M54455EVB_a33_config) FLASH=ATMEL; FREQ=33333333;; \
  569. M54455EVB_a66_config) FLASH=ATMEL; FREQ=66666666;; \
  570. M54455EVB_i33_config) FLASH=INTEL; FREQ=33333333;; \
  571. M54455EVB_i66_config) FLASH=INTEL; FREQ=66666666;; \
  572. M54455EVB_stm33_config) FLASH=STMICRO; FREQ=33333333;; \
  573. esac; \
  574. if [ "$${FLASH}" = "INTEL" ] ; then \
  575. echo "#define CONFIG_SYS_INTEL_BOOT" >> $(obj)include/config.h ; \
  576. echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
  577. cp $(obj)board/freescale/m54455evb/u-boot.int $(obj)board/freescale/m54455evb/u-boot.lds ; \
  578. fi; \
  579. if [ "$${FLASH}" = "ATMEL" ] ; then \
  580. echo "#define CONFIG_SYS_ATMEL_BOOT" >> $(obj)include/config.h ; \
  581. echo "CONFIG_SYS_TEXT_BASE = 0x04000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
  582. cp $(obj)board/freescale/m54455evb/u-boot.atm $(obj)board/freescale/m54455evb/u-boot.lds ; \
  583. fi; \
  584. if [ "$${FLASH}" = "STMICRO" ] ; then \
  585. echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \
  586. echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \
  587. echo "CONFIG_SYS_TEXT_BASE = 0x4FE00000" > $(obj)board/freescale/m54455evb/config.tmp ; \
  588. cp $(obj)board/freescale/m54455evb/u-boot.stm $(obj)board/freescale/m54455evb/u-boot.lds ; \
  589. fi; \
  590. echo "#define CONFIG_SYS_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \
  591. @$(MKCONFIG) -n $@ -a M54455EVB m68k mcf5445x m54455evb freescale
  592. M5475AFE_config \
  593. M5475BFE_config \
  594. M5475CFE_config \
  595. M5475DFE_config \
  596. M5475EFE_config \
  597. M5475FFE_config \
  598. M5475GFE_config : unconfig
  599. @case "$@" in \
  600. M5475AFE_config) BOOT=2;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
  601. M5475BFE_config) BOOT=2;CODE=16;VID=0;USB=0;RAM=64;RAM1=0;; \
  602. M5475CFE_config) BOOT=2;CODE=16;VID=1;USB=1;RAM=64;RAM1=0;; \
  603. M5475DFE_config) BOOT=2;CODE=0;VID=0;USB=1;RAM=64;RAM1=0;; \
  604. M5475EFE_config) BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
  605. M5475FFE_config) BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
  606. M5475GFE_config) BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
  607. esac; \
  608. echo "#define CONFIG_SYS_BUSCLK 133333333" > $(obj)include/config.h ; \
  609. echo "#define CONFIG_SYS_BOOTSZ $${BOOT}" >> $(obj)include/config.h ; \
  610. echo "#define CONFIG_SYS_DRAMSZ $${RAM}" >> $(obj)include/config.h ; \
  611. if [ "$${RAM1}" != "0" ] ; then \
  612. echo "#define CONFIG_SYS_DRAMSZ1 $${RAM1}" >> $(obj)include/config.h ; \
  613. fi; \
  614. if [ "$${CODE}" != "0" ] ; then \
  615. echo "#define CONFIG_SYS_NOR1SZ $${CODE}" >> $(obj)include/config.h ; \
  616. fi; \
  617. if [ "$${VID}" == "1" ] ; then \
  618. echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
  619. fi; \
  620. if [ "$${USB}" == "1" ] ; then \
  621. echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
  622. fi
  623. @$(MKCONFIG) -n $@ -a M5475EVB m68k mcf547x_8x m547xevb freescale
  624. M5485AFE_config \
  625. M5485BFE_config \
  626. M5485CFE_config \
  627. M5485DFE_config \
  628. M5485EFE_config \
  629. M5485FFE_config \
  630. M5485GFE_config \
  631. M5485HFE_config : unconfig
  632. @case "$@" in \
  633. M5485AFE_config) BOOT=2;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
  634. M5485BFE_config) BOOT=2;CODE=16;VID=0;USB=0;RAM=64;RAM1=0;; \
  635. M5485CFE_config) BOOT=2;CODE=16;VID=1;USB=1;RAM=64;RAM1=0;; \
  636. M5485DFE_config) BOOT=2;CODE=0;VID=0;USB=1;RAM=64;RAM1=0;; \
  637. M5485EFE_config) BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
  638. M5485FFE_config) BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
  639. M5485GFE_config) BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
  640. M5485HFE_config) BOOT=2;CODE=16;VID=1;USB=0;RAM=64;RAM1=0;; \
  641. esac; \
  642. echo "#define CONFIG_SYS_BUSCLK 100000000" > $(obj)include/config.h ; \
  643. echo "#define CONFIG_SYS_BOOTSZ $${BOOT}" >> $(obj)include/config.h ; \
  644. echo "#define CONFIG_SYS_DRAMSZ $${RAM}" >> $(obj)include/config.h ; \
  645. if [ "$${RAM1}" != "0" ] ; then \
  646. echo "#define CONFIG_SYS_DRAMSZ1 $${RAM1}" >> $(obj)include/config.h ; \
  647. fi; \
  648. if [ "$${CODE}" != "0" ] ; then \
  649. echo "#define CONFIG_SYS_NOR1SZ $${CODE}" >> $(obj)include/config.h ; \
  650. fi; \
  651. if [ "$${VID}" == "1" ] ; then \
  652. echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
  653. fi; \
  654. if [ "$${USB}" == "1" ] ; then \
  655. echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
  656. fi
  657. @$(MKCONFIG) -n $@ -a M5485EVB m68k mcf547x_8x m548xevb freescale
  658. #========================================================================
  659. # ARM
  660. #========================================================================
  661. #########################################################################
  662. ## ARM926EJ-S Systems
  663. #########################################################################
  664. at91sam9260ek_nandflash_config \
  665. at91sam9260ek_dataflash_cs0_config \
  666. at91sam9260ek_dataflash_cs1_config \
  667. at91sam9260ek_config \
  668. at91sam9g20ek_nandflash_config \
  669. at91sam9g20ek_dataflash_cs0_config \
  670. at91sam9g20ek_dataflash_cs1_config \
  671. at91sam9g20ek_config : unconfig
  672. @mkdir -p $(obj)include
  673. @if [ "$(findstring 9g20,$@)" ] ; then \
  674. echo "#define CONFIG_AT91SAM9G20EK 1" >>$(obj)include/config.h ; \
  675. else \
  676. echo "#define CONFIG_AT91SAM9260EK 1" >>$(obj)include/config.h ; \
  677. fi;
  678. @if [ "$(findstring _nandflash,$@)" ] ; then \
  679. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  680. elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
  681. echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \
  682. else \
  683. echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1" >>$(obj)include/config.h ; \
  684. fi;
  685. @$(MKCONFIG) -n $@ -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91
  686. at91sam9xeek_nandflash_config \
  687. at91sam9xeek_dataflash_cs0_config \
  688. at91sam9xeek_dataflash_cs1_config \
  689. at91sam9xeek_config : unconfig
  690. @mkdir -p $(obj)include
  691. @if [ "$(findstring _nandflash,$@)" ] ; then \
  692. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  693. elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
  694. echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \
  695. else \
  696. echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1" >>$(obj)include/config.h ; \
  697. fi;
  698. @$(MKCONFIG) -n $@ -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91
  699. at91sam9261ek_nandflash_config \
  700. at91sam9261ek_dataflash_cs0_config \
  701. at91sam9261ek_dataflash_cs3_config \
  702. at91sam9261ek_config \
  703. at91sam9g10ek_nandflash_config \
  704. at91sam9g10ek_dataflash_cs0_config \
  705. at91sam9g10ek_dataflash_cs3_config \
  706. at91sam9g10ek_config : unconfig
  707. @mkdir -p $(obj)include
  708. @if [ "$(findstring 9g10,$@)" ] ; then \
  709. echo "#define CONFIG_AT91SAM9G10EK 1" >>$(obj)include/config.h ; \
  710. else \
  711. echo "#define CONFIG_AT91SAM9261EK 1" >>$(obj)include/config.h ; \
  712. fi;
  713. @if [ "$(findstring _nandflash,$@)" ] ; then \
  714. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  715. elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
  716. echo "#define CONFIG_SYS_USE_DATAFLASH_CS3 1" >>$(obj)include/config.h ; \
  717. else \
  718. echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \
  719. fi;
  720. @$(MKCONFIG) -n $@ -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91
  721. at91sam9263ek_norflash_config \
  722. at91sam9263ek_norflash_boot_config \
  723. at91sam9263ek_nandflash_config \
  724. at91sam9263ek_dataflash_config \
  725. at91sam9263ek_dataflash_cs0_config \
  726. at91sam9263ek_config : unconfig
  727. @mkdir -p $(obj)include
  728. @if [ "$(findstring _nandflash,$@)" ] ; then \
  729. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  730. elif [ "$(findstring norflash,$@)" ] ; then \
  731. echo "#define CONFIG_SYS_USE_NORFLASH 1" >>$(obj)include/config.h ; \
  732. else \
  733. echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \
  734. fi;
  735. @if [ "$(findstring norflash_boot,$@)" ] ; then \
  736. echo "#define CONFIG_SYS_USE_BOOT_NORFLASH 1" >>$(obj)include/config.h ; \
  737. fi;
  738. @$(MKCONFIG) -n $@ -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91
  739. at91sam9rlek_nandflash_config \
  740. at91sam9rlek_dataflash_config \
  741. at91sam9rlek_dataflash_cs0_config \
  742. at91sam9rlek_config : unconfig
  743. @mkdir -p $(obj)include
  744. @if [ "$(findstring _nandflash,$@)" ] ; then \
  745. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  746. else \
  747. echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \
  748. fi;
  749. @$(MKCONFIG) -n $@ -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
  750. CPU9G20_128M_config \
  751. CPU9G20_config \
  752. CPU9260_128M_config \
  753. CPU9260_config : unconfig
  754. @mkdir -p $(obj)include
  755. @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
  756. @$(MKCONFIG) -n $@ -a cpu9260 arm arm926ejs cpu9260 eukrea at91
  757. at91sam9m10g45ek_nandflash_config \
  758. at91sam9m10g45ek_dataflash_config \
  759. at91sam9m10g45ek_dataflash_cs0_config \
  760. at91sam9m10g45ek_config \
  761. at91sam9g45ekes_nandflash_config \
  762. at91sam9g45ekes_dataflash_config \
  763. at91sam9g45ekes_dataflash_cs0_config \
  764. at91sam9g45ekes_config : unconfig
  765. @mkdir -p $(obj)include
  766. @if [ "$(findstring 9m10,$@)" ] ; then \
  767. echo "#define CONFIG_AT91SAM9M10G45EK 1" >>$(obj)include/config.h ; \
  768. else \
  769. echo "#define CONFIG_AT91SAM9G45EKES 1" >>$(obj)include/config.h ; \
  770. fi;
  771. @if [ "$(findstring _nandflash,$@)" ] ; then \
  772. echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
  773. else \
  774. echo "#define CONFIG_ATMEL_SPI 1" >>$(obj)include/config.h ; \
  775. fi;
  776. @$(MKCONFIG) -n $@ -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel at91
  777. pm9g45_config : unconfig
  778. @mkdir -p $(obj)include
  779. @$(MKCONFIG) -a pm9g45 arm arm926ejs pm9g45 ronetix at91
  780. SBC35_A9G20_NANDFLASH_config \
  781. SBC35_A9G20_EEPROM_config \
  782. SBC35_A9G20_config : unconfig
  783. @mkdir -p $(obj)include
  784. @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
  785. @$(MKCONFIG) -n $@ -a sbc35_a9g20 arm arm926ejs sbc35_a9g20 calao at91
  786. TNY_A9G20_NANDFLASH_config \
  787. TNY_A9G20_EEPROM_config \
  788. TNY_A9G20_config \
  789. TNY_A9260_NANDFLASH_config \
  790. TNY_A9260_EEPROM_config \
  791. TNY_A9260_config : unconfig
  792. @mkdir -p $(obj)include
  793. @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
  794. @$(MKCONFIG) -n $@ -a tny_a9260 arm arm926ejs tny_a9260 calao at91
  795. ########################################################################
  796. ## ARM Integrator boards - see doc/README-integrator for more info.
  797. integratorap_config \
  798. ap_config \
  799. ap966_config \
  800. ap922_config \
  801. ap922_XA10_config \
  802. ap7_config \
  803. ap720t_config \
  804. ap920t_config \
  805. ap926ejs_config \
  806. ap946es_config: unconfig
  807. @board/armltd/integrator/split_by_variant.sh ap $@
  808. integratorcp_config \
  809. cp_config \
  810. cp920t_config \
  811. cp926ejs_config \
  812. cp946es_config \
  813. cp1136_config \
  814. cp966_config \
  815. cp922_config \
  816. cp922_XA10_config \
  817. cp1026_config: unconfig
  818. @board/armltd/integrator/split_by_variant.sh cp $@
  819. xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
  820. omap1610inn_config \
  821. omap1610inn_cs0boot_config \
  822. omap1610inn_cs3boot_config \
  823. omap1610inn_cs_autoboot_config \
  824. omap1610h2_config \
  825. omap1610h2_cs0boot_config \
  826. omap1610h2_cs3boot_config \
  827. omap1610h2_cs_autoboot_config: unconfig
  828. @mkdir -p $(obj)include
  829. @if [ "$(findstring _cs0boot_, $@)" ] ; then \
  830. echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \
  831. elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
  832. echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \
  833. else \
  834. echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
  835. fi;
  836. @$(MKCONFIG) -n $@ -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn ti omap
  837. omap730p2_config \
  838. omap730p2_cs0boot_config \
  839. omap730p2_cs3boot_config : unconfig
  840. @mkdir -p $(obj)include
  841. @if [ "$(findstring _cs0boot_, $@)" ] ; then \
  842. echo "#define CONFIG_CS0_BOOT" >> $(obj)include/config.h ; \
  843. else \
  844. echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
  845. fi;
  846. @$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
  847. spear300_config \
  848. spear310_config \
  849. spear320_config : unconfig
  850. @$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
  851. spear600_config : unconfig
  852. @$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
  853. SX1_stdout_serial_config \
  854. SX1_config: unconfig
  855. @mkdir -p $(obj)include
  856. @if [ "$(findstring _stdout_serial_, $@)" ] ; then \
  857. echo "#undef CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
  858. else \
  859. echo "#define CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
  860. fi;
  861. @$(MKCONFIG) -n $@ SX1 arm arm925t sx1
  862. # TRAB default configuration: 8 MB Flash, 32 MB RAM
  863. trab_config \
  864. trab_bigram_config \
  865. trab_bigflash_config \
  866. trab_old_config: unconfig
  867. @mkdir -p $(obj)include
  868. @mkdir -p $(obj)board/trab
  869. @[ -z "$(findstring _bigram,$@)" ] || \
  870. { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \
  871. echo "#define CONFIG_RAM_32MB" >>$(obj)include/config.h ; \
  872. }
  873. @[ -z "$(findstring _bigflash,$@)" ] || \
  874. { echo "#define CONFIG_FLASH_16MB" >>$(obj)include/config.h ; \
  875. echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \
  876. echo "CONFIG_SYS_TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \
  877. }
  878. @[ -z "$(findstring _old,$@)" ] || \
  879. { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \
  880. echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \
  881. echo "CONFIG_SYS_TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \
  882. }
  883. @$(MKCONFIG) -n $@ -a trab arm arm920t trab - s3c24x0
  884. tx25_config : unconfig
  885. @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
  886. @$(MKCONFIG) $@ arm arm926ejs tx25 karo mx25
  887. edb9301_config \
  888. edb9302_config \
  889. edb9302a_config \
  890. edb9307_config \
  891. edb9307a_config \
  892. edb9312_config \
  893. edb9315_config \
  894. edb9315a_config: unconfig
  895. @$(MKCONFIG) -n $@ -t $(@:_config=) edb93xx arm arm920t edb93xx - ep93xx
  896. #########################################################################
  897. # ARM supplied Versatile development boards
  898. #########################################################################
  899. versatile_config \
  900. versatileab_config \
  901. versatilepb_config : unconfig
  902. @board/armltd/versatile/split_by_variant.sh $@
  903. #########################################################################
  904. ## XScale Systems
  905. #########################################################################
  906. pdnb3_config \
  907. scpu_config: unconfig
  908. @mkdir -p $(obj)include
  909. @if [ "$(findstring scpu_,$@)" ] ; then \
  910. echo "#define CONFIG_SCPU" >>$(obj)include/config.h ; \
  911. fi
  912. @$(MKCONFIG) -n $@ -a pdnb3 arm ixp pdnb3 prodrive
  913. #########################################################################
  914. ## ARM1136 Systems
  915. #########################################################################
  916. apollon_config : unconfig
  917. @mkdir -p $(obj)include
  918. @echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
  919. @echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
  920. @$(MKCONFIG) $@ arm arm1136 apollon - omap24xx
  921. imx31_phycore_eet_config \
  922. imx31_phycore_config : unconfig
  923. @mkdir -p $(obj)include
  924. @if [ -n "$(findstring _eet_,$@)" ]; then \
  925. echo "#define CONFIG_IMX31_PHYCORE_EET" >> $(obj)include/config.h; \
  926. fi
  927. @$(MKCONFIG) -n $@ -a imx31_phycore arm arm1136 imx31_phycore - mx31
  928. mx31pdk_config \
  929. mx31pdk_nand_config : unconfig
  930. @mkdir -p $(obj)include
  931. @if [ -n "$(findstring _nand_,$@)" ]; then \
  932. echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h; \
  933. else \
  934. echo "#define CONFIG_SKIP_LOWLEVEL_INIT" >> $(obj)include/config.h; \
  935. fi
  936. @$(MKCONFIG) -n $@ -a mx31pdk arm arm1136 mx31pdk freescale mx31
  937. #########################################################################
  938. ## ARM1176 Systems
  939. #########################################################################
  940. smdk6400_noUSB_config \
  941. smdk6400_config : unconfig
  942. @mkdir -p $(obj)include $(obj)board/samsung/smdk6400
  943. @mkdir -p $(obj)nand_spl/board/samsung/smdk6400
  944. @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
  945. @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
  946. @if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then \
  947. echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
  948. else \
  949. echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
  950. fi
  951. @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
  952. @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
  953. #========================================================================
  954. # Nios
  955. #========================================================================
  956. #########################################################################
  957. ## Nios-II
  958. #########################################################################
  959. # nios2 generic boards
  960. NIOS2_GENERIC = nios2-generic
  961. $(NIOS2_GENERIC:%=%_config) : unconfig
  962. @$(MKCONFIG) $@ nios2 nios2 nios2-generic altera
  963. #########################################################################
  964. #########################################################################
  965. clean:
  966. @rm -f $(obj)examples/standalone/82559_eeprom \
  967. $(obj)examples/standalone/atmel_df_pow2 \
  968. $(obj)examples/standalone/eepro100_eeprom \
  969. $(obj)examples/standalone/hello_world \
  970. $(obj)examples/standalone/interrupt \
  971. $(obj)examples/standalone/mem_to_mem_idma2intr \
  972. $(obj)examples/standalone/sched \
  973. $(obj)examples/standalone/smc911{11,x}_eeprom \
  974. $(obj)examples/standalone/test_burst \
  975. $(obj)examples/standalone/timer
  976. @rm -f $(obj)examples/api/demo{,.bin}
  977. @rm -f $(obj)tools/bmp_logo $(obj)tools/easylogo/easylogo \
  978. $(obj)tools/env/{fw_printenv,fw_setenv} \
  979. $(obj)tools/envcrc \
  980. $(obj)tools/gdb/{astest,gdbcont,gdbsend} \
  981. $(obj)tools/gen_eth_addr $(obj)tools/img2srec \
  982. $(obj)tools/mkimage $(obj)tools/mpc86x_clk \
  983. $(obj)tools/ncb $(obj)tools/ubsha1
  984. @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \
  985. $(obj)board/matrix_vision/*/bootscript.img \
  986. $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin} \
  987. $(obj)board/trab/trab_fkt $(obj)board/voiceblue/eeprom \
  988. $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds \
  989. $(obj)u-boot.lds \
  990. $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]
  991. @rm -f $(obj)include/bmp_logo.h
  992. @rm -f $(obj)lib/asm-offsets.s
  993. @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
  994. @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
  995. @rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
  996. @rm -f $(ONENAND_BIN)
  997. @rm -f $(obj)onenand_ipl/u-boot.lds
  998. @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
  999. @find $(OBJTREE) -type f \
  1000. \( -name 'core' -o -name '*.bak' -o -name '*~' \
  1001. -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \
  1002. | xargs rm -f
  1003. clobber: clean
  1004. @find $(OBJTREE) -type f \( -name '*.depend' \
  1005. -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
  1006. -print0 \
  1007. | xargs -0 rm -f
  1008. @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
  1009. $(obj)cscope.* $(obj)*.*~
  1010. @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
  1011. @rm -f $(obj)u-boot.kwb
  1012. @rm -f $(obj)u-boot.imx
  1013. @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
  1014. @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
  1015. @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
  1016. @rm -fr $(obj)include/generated
  1017. @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
  1018. @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
  1019. @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l -print | xargs rm -f
  1020. ifeq ($(OBJTREE),$(SRCTREE))
  1021. mrproper \
  1022. distclean: clobber unconfig
  1023. else
  1024. mrproper \
  1025. distclean: clobber unconfig
  1026. rm -rf $(obj)*
  1027. endif
  1028. backup:
  1029. F=`basename $(TOPDIR)` ; cd .. ; \
  1030. gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
  1031. #########################################################################