Makefile 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1. #
  2. # (C) Copyright 2000-2013
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. #
  5. # SPDX-License-Identifier: GPL-2.0+
  6. #
  7. VERSION = 2014
  8. PATCHLEVEL = 01
  9. SUBLEVEL =
  10. EXTRAVERSION =
  11. ifneq "$(SUBLEVEL)" ""
  12. U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
  13. else
  14. U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
  15. endif
  16. TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
  17. VERSION_FILE = $(obj)include/generated/version_autogenerated.h
  18. HOSTARCH := $(shell uname -m | \
  19. sed -e s/i.86/x86/ \
  20. -e s/sun4u/sparc64/ \
  21. -e s/arm.*/arm/ \
  22. -e s/sa110/arm/ \
  23. -e s/ppc64/powerpc/ \
  24. -e s/ppc/powerpc/ \
  25. -e s/macppc/powerpc/\
  26. -e s/sh.*/sh/)
  27. HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
  28. sed -e 's/\(cygwin\).*/cygwin/')
  29. export HOSTARCH HOSTOS
  30. # Deal with colliding definitions from tcsh etc.
  31. VENDOR=
  32. #########################################################################
  33. # Allow for silent builds
  34. ifeq (,$(findstring s,$(MAKEFLAGS)))
  35. XECHO = echo
  36. else
  37. XECHO = :
  38. endif
  39. #########################################################################
  40. #
  41. # U-boot build supports generating object files in a separate external
  42. # directory. Two use cases are supported:
  43. #
  44. # 1) Add O= to the make command line
  45. # 'make O=/tmp/build all'
  46. #
  47. # 2) Set environment variable BUILD_DIR to point to the desired location
  48. # 'export BUILD_DIR=/tmp/build'
  49. # 'make'
  50. #
  51. # The second approach can also be used with a MAKEALL script
  52. # 'export BUILD_DIR=/tmp/build'
  53. # './MAKEALL'
  54. #
  55. # Command line 'O=' setting overrides BUILD_DIR environment variable.
  56. #
  57. # When none of the above methods is used the local build is performed and
  58. # the object files are placed in the source directory.
  59. #
  60. ifeq ("$(origin O)", "command line")
  61. BUILD_DIR := $(O)
  62. endif
  63. # Call a source code checker (by default, "sparse") as part of the
  64. # C compilation.
  65. #
  66. # Use 'make C=1' to enable checking of re-compiled files.
  67. #
  68. # See the linux kernel file "Documentation/sparse.txt" for more details,
  69. # including where to get the "sparse" utility.
  70. ifdef C
  71. ifeq ("$(origin C)", "command line")
  72. CHECKSRC := $(C)
  73. endif
  74. endif
  75. ifndef CHECKSRC
  76. CHECKSRC = 0
  77. endif
  78. export CHECKSRC
  79. ifneq ($(BUILD_DIR),)
  80. saved-output := $(BUILD_DIR)
  81. # Attempt to create a output directory.
  82. $(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
  83. # Verify if it was successful.
  84. BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
  85. $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
  86. endif # ifneq ($(BUILD_DIR),)
  87. OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
  88. SPLTREE := $(OBJTREE)/spl
  89. TPLTREE := $(OBJTREE)/tpl
  90. SRCTREE := $(CURDIR)
  91. srctree := $(SRCTREE)
  92. TOPDIR := $(SRCTREE)
  93. LNDIR := $(OBJTREE)
  94. export TOPDIR SRCTREE srctree OBJTREE SPLTREE TPLTREE
  95. MKCONFIG := $(SRCTREE)/mkconfig
  96. export MKCONFIG
  97. # $(obj) and (src) are defined in config.mk but here in main Makefile
  98. # we also need them before config.mk is included which is the case for
  99. # some targets like unconfig, clean, clobber, distclean, etc.
  100. ifneq ($(OBJTREE),$(SRCTREE))
  101. obj := $(OBJTREE)/
  102. src := $(SRCTREE)/
  103. else
  104. obj :=
  105. src :=
  106. endif
  107. export obj src
  108. # Make sure CDPATH settings don't interfere
  109. unexport CDPATH
  110. #########################################################################
  111. # The "tools" are needed early, so put this first
  112. # Don't include stuff already done in $(LIBS)
  113. # The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
  114. # is "yes"), so compile examples after U-Boot is compiled.
  115. SUBDIR_TOOLS = tools
  116. SUBDIRS = $(SUBDIR_TOOLS)
  117. .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
  118. ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
  119. # Include autoconf.mk before config.mk so that the config options are available
  120. # to all top level build files. We need the dummy all: target to prevent the
  121. # dependency target in autoconf.mk.dep from being the default.
  122. all:
  123. sinclude $(obj)include/autoconf.mk.dep
  124. sinclude $(obj)include/autoconf.mk
  125. SUBDIR_EXAMPLES-y := examples/standalone
  126. SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
  127. ifndef CONFIG_SANDBOX
  128. SUBDIRS += $(SUBDIR_EXAMPLES-y)
  129. endif
  130. # load ARCH, BOARD, and CPU configuration
  131. include $(obj)include/config.mk
  132. export ARCH CPU BOARD VENDOR SOC
  133. # set default to nothing for native builds
  134. ifeq ($(HOSTARCH),$(ARCH))
  135. CROSS_COMPILE ?=
  136. endif
  137. # SHELL used by kbuild
  138. CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
  139. else if [ -x /bin/bash ]; then echo /bin/bash; \
  140. else echo sh; fi ; fi)
  141. HOSTCC = gcc
  142. HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
  143. ifeq ($(HOSTOS),cygwin)
  144. HOSTCFLAGS += -ansi
  145. endif
  146. # Mac OS X / Darwin's C preprocessor is Apple specific. It
  147. # generates numerous errors and warnings. We want to bypass it
  148. # and use GNU C's cpp. To do this we pass the -traditional-cpp
  149. # option to the compiler. Note that the -traditional-cpp flag
  150. # DOES NOT have the same semantics as GNU C's flag, all it does
  151. # is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
  152. #
  153. # Apple's linker is similar, thanks to the new 2 stage linking
  154. # multiple symbol definitions are treated as errors, hence the
  155. # -multiply_defined suppress option to turn off this error.
  156. #
  157. ifeq ($(HOSTOS),darwin)
  158. # get major and minor product version (e.g. '10' and '6' for Snow Leopard)
  159. DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
  160. DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
  161. os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
  162. $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)
  163. # Snow Leopards build environment has no longer restrictions as described above
  164. HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc")
  165. HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
  166. HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
  167. endif
  168. # We need some generic definitions (do not try to remake the file).
  169. $(srctree)/scripts/Kbuild.include: ;
  170. include $(srctree)/scripts/Kbuild.include
  171. # Make variables (CC, etc...)
  172. AS = $(CROSS_COMPILE)as
  173. # Always use GNU ld
  174. ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2> /dev/null),)
  175. LD = $(CROSS_COMPILE)ld.bfd
  176. else
  177. LD = $(CROSS_COMPILE)ld
  178. endif
  179. CC = $(CROSS_COMPILE)gcc
  180. CPP = $(CC) -E
  181. AR = $(CROSS_COMPILE)ar
  182. NM = $(CROSS_COMPILE)nm
  183. LDR = $(CROSS_COMPILE)ldr
  184. STRIP = $(CROSS_COMPILE)strip
  185. OBJCOPY = $(CROSS_COMPILE)objcopy
  186. OBJDUMP = $(CROSS_COMPILE)objdump
  187. AWK = awk
  188. RANLIB = $(CROSS_COMPILE)RANLIB
  189. DTC = dtc
  190. CHECK = sparse
  191. CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  192. -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
  193. export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
  194. export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
  195. export MAKE AWK
  196. export DTC CHECK CHECKFLAGS
  197. # load other configuration
  198. include $(TOPDIR)/config.mk
  199. # Targets which don't build the source code
  200. NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig
  201. # Only do the generic board check when actually building, not configuring
  202. ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
  203. ifeq ($(findstring _config,$(MAKECMDGOALS)),)
  204. $(CHECK_GENERIC_BOARD)
  205. endif
  206. endif
  207. # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
  208. # that (or fail if absent). Otherwise, search for a linker script in a
  209. # standard location.
  210. LDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT))
  211. ifndef LDSCRIPT
  212. #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
  213. ifdef CONFIG_SYS_LDSCRIPT
  214. # need to strip off double quotes
  215. LDSCRIPT := $(CONFIG_SYS_LDSCRIPT:"%"=%)
  216. endif
  217. endif
  218. # If there is no specified link script, we look in a number of places for it
  219. ifndef LDSCRIPT
  220. ifeq ($(CONFIG_NAND_U_BOOT),y)
  221. LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
  222. ifeq ($(wildcard $(LDSCRIPT)),)
  223. LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
  224. endif
  225. endif
  226. ifeq ($(wildcard $(LDSCRIPT)),)
  227. LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
  228. endif
  229. ifeq ($(wildcard $(LDSCRIPT)),)
  230. LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
  231. endif
  232. ifeq ($(wildcard $(LDSCRIPT)),)
  233. LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
  234. # We don't expect a Makefile here
  235. LDSCRIPT_MAKEFILE_DIR =
  236. endif
  237. ifeq ($(wildcard $(LDSCRIPT)),)
  238. $(error could not find linker script)
  239. endif
  240. endif
  241. #########################################################################
  242. # U-Boot objects....order is important (i.e. start must be first)
  243. head-y := $(CPUDIR)/start.o
  244. head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
  245. head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
  246. OBJS := $(addprefix $(obj),$(head-y))
  247. HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
  248. LIBS-y += lib/
  249. LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
  250. LIBS-y += $(CPUDIR)/
  251. ifdef SOC
  252. LIBS-y += $(CPUDIR)/$(SOC)/
  253. endif
  254. LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
  255. LIBS-$(CONFIG_OF_EMBED) += dts/
  256. LIBS-y += arch/$(ARCH)/lib/
  257. LIBS-y += fs/
  258. LIBS-y += net/
  259. LIBS-y += disk/
  260. LIBS-y += drivers/
  261. LIBS-y += drivers/dma/
  262. LIBS-y += drivers/gpio/
  263. LIBS-y += drivers/i2c/
  264. LIBS-y += drivers/input/
  265. LIBS-y += drivers/mmc/
  266. LIBS-y += drivers/mtd/
  267. LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
  268. LIBS-y += drivers/mtd/onenand/
  269. LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
  270. LIBS-y += drivers/mtd/spi/
  271. LIBS-y += drivers/net/
  272. LIBS-y += drivers/net/phy/
  273. LIBS-y += drivers/pci/
  274. LIBS-y += drivers/power/ \
  275. drivers/power/fuel_gauge/ \
  276. drivers/power/mfd/ \
  277. drivers/power/pmic/ \
  278. drivers/power/battery/
  279. LIBS-y += drivers/spi/
  280. LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/
  281. LIBS-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
  282. LIBS-y += drivers/serial/
  283. LIBS-y += drivers/usb/eth/
  284. LIBS-y += drivers/usb/gadget/
  285. LIBS-y += drivers/usb/host/
  286. LIBS-y += drivers/usb/musb/
  287. LIBS-y += drivers/usb/musb-new/
  288. LIBS-y += drivers/usb/phy/
  289. LIBS-y += drivers/usb/ulpi/
  290. LIBS-y += common/
  291. LIBS-y += lib/libfdt/
  292. LIBS-$(CONFIG_API) += api/
  293. LIBS-$(CONFIG_HAS_POST) += post/
  294. LIBS-y += test/
  295. ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
  296. LIBS-y += arch/$(ARCH)/imx-common/
  297. endif
  298. LIBS-$(CONFIG_ARM) += arch/arm/cpu/
  299. LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
  300. LIBS-y += board/$(BOARDDIR)/
  301. LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
  302. LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
  303. .PHONY : $(LIBS)
  304. # Add GCC lib
  305. ifdef USE_PRIVATE_LIBGCC
  306. ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
  307. PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
  308. else
  309. PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
  310. endif
  311. else
  312. PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
  313. endif
  314. PLATFORM_LIBS += $(PLATFORM_LIBGCC)
  315. export PLATFORM_LIBS
  316. # Special flags for CPP when processing the linker script.
  317. # Pass the version down so we can handle backwards compatibility
  318. # on the fly.
  319. LDPPFLAGS += \
  320. -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
  321. -DCPUDIR=$(CPUDIR) \
  322. $(shell $(LD) --version | \
  323. sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
  324. __OBJS := $(subst $(obj),,$(OBJS))
  325. __LIBS := $(subst $(obj),,$(LIBS))
  326. #########################################################################
  327. #########################################################################
  328. ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
  329. BOARD_SIZE_CHECK = \
  330. @actual=`wc -c $@ | awk '{print $$1}'`; \
  331. limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \
  332. if test $$actual -gt $$limit; then \
  333. echo "$@ exceeds file size limit:" >&2 ; \
  334. echo " limit: $$limit bytes" >&2 ; \
  335. echo " actual: $$actual bytes" >&2 ; \
  336. echo " excess: $$((actual - limit)) bytes" >&2; \
  337. exit 1; \
  338. fi
  339. else
  340. BOARD_SIZE_CHECK =
  341. endif
  342. # Statically apply RELA-style relocations (currently arm64 only)
  343. ifneq ($(CONFIG_STATIC_RELA),)
  344. # $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base
  345. DO_STATIC_RELA = \
  346. start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \
  347. end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \
  348. $(obj)tools/relocate-rela $(2) $(3) $$start $$end
  349. else
  350. DO_STATIC_RELA =
  351. endif
  352. # Always append ALL so that arch config.mk's can add custom ones
  353. ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
  354. ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
  355. ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
  356. ALL-$(CONFIG_RAMBOOT_PBL) += $(obj)u-boot.pbl
  357. ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
  358. ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img
  359. ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
  360. ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
  361. ifneq ($(CONFIG_SPL_TARGET),)
  362. ALL-$(CONFIG_SPL) += $(obj)$(CONFIG_SPL_TARGET:"%"=%)
  363. endif
  364. ALL-$(CONFIG_REMAKE_ELF) += $(obj)u-boot.elf
  365. # enable combined SPL/u-boot/dtb rules for tegra
  366. ifneq ($(CONFIG_TEGRA),)
  367. ifeq ($(CONFIG_SPL),y)
  368. ifeq ($(CONFIG_OF_SEPARATE),y)
  369. ALL-y += $(obj)u-boot-dtb-tegra.bin
  370. else
  371. ALL-y += $(obj)u-boot-nodtb-tegra.bin
  372. endif
  373. endif
  374. endif
  375. all: $(ALL-y) $(SUBDIR_EXAMPLES-y)
  376. $(obj)u-boot.dtb: checkdtc $(obj)u-boot
  377. $(MAKE) $(build) dts binary
  378. mv $(obj)dts/dt.dtb $@
  379. $(obj)u-boot-dtb.bin: $(obj)u-boot.bin $(obj)u-boot.dtb
  380. cat $^ >$@
  381. $(obj)u-boot.hex: $(obj)u-boot
  382. $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
  383. $(obj)u-boot.srec: $(obj)u-boot
  384. $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
  385. $(obj)u-boot.bin: $(obj)u-boot
  386. $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
  387. $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
  388. $(BOARD_SIZE_CHECK)
  389. $(obj)u-boot.ldr: $(obj)u-boot
  390. $(CREATE_LDR_ENV)
  391. $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
  392. $(BOARD_SIZE_CHECK)
  393. $(obj)u-boot.ldr.hex: $(obj)u-boot.ldr
  394. $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
  395. $(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
  396. $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
  397. #
  398. # U-Boot entry point, needed for booting of full-blown U-Boot
  399. # from the SPL U-Boot version.
  400. #
  401. ifndef CONFIG_SYS_UBOOT_START
  402. CONFIG_SYS_UBOOT_START := 0
  403. endif
  404. $(obj)u-boot.img: $(obj)u-boot.bin
  405. $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  406. -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
  407. -e $(CONFIG_SYS_UBOOT_START) \
  408. -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
  409. sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
  410. -d $< $@
  411. $(obj)u-boot.imx: $(obj)u-boot.bin depend
  412. $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
  413. $(obj)u-boot.kwb: $(obj)u-boot.bin
  414. $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
  415. -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
  416. $(obj)u-boot.pbl: $(obj)u-boot.bin
  417. $(obj)tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
  418. -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \
  419. -d $< $@
  420. $(obj)u-boot.sha1: $(obj)u-boot.bin
  421. $(obj)tools/ubsha1 $(obj)u-boot.bin
  422. $(obj)u-boot.dis: $(obj)u-boot
  423. $(OBJDUMP) -d $< > $@
  424. # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
  425. # $(4) is pad-to
  426. SPL_PAD_APPEND = \
  427. $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \
  428. $(1) $(obj)$(3); \
  429. cat $(obj)$(3) $(2) > $@; \
  430. rm $(obj)$(3)
  431. ifdef CONFIG_TPL
  432. SPL_PAYLOAD := $(obj)tpl/u-boot-with-tpl.bin
  433. else
  434. SPL_PAYLOAD := $(obj)u-boot.bin
  435. endif
  436. $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(SPL_PAYLOAD)
  437. $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
  438. $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
  439. $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
  440. $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
  441. $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
  442. $(OBJTREE)/u-boot-with-spl.imx
  443. $(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
  444. $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
  445. $(OBJTREE)/u-boot-with-nand-spl.imx
  446. $(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
  447. $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
  448. -e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
  449. $(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
  450. $(obj)tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") \
  451. -T aisimage \
  452. -e $(CONFIG_SPL_TEXT_BASE) \
  453. -d $(obj)spl/u-boot-spl.bin \
  454. $(obj)spl/u-boot-spl.ais
  455. $(OBJCOPY) ${OBJCFLAGS} -I binary \
  456. --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
  457. $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
  458. cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
  459. $(obj)u-boot.ais
  460. $(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
  461. $(MAKE) $(build) $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
  462. # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
  463. # Both images are created using mkimage (crc etc), so that the ROM
  464. # bootloader can check its integrity. Padding needs to be done to the
  465. # SPL image (with mkimage header) and not the binary. Otherwise the resulting image
  466. # which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
  467. # The resulting image containing both U-Boot images is called u-boot.spr
  468. $(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
  469. $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  470. -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
  471. -d $(obj)spl/u-boot-spl.bin $@
  472. $(OBJCOPY) -I binary -O binary \
  473. --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
  474. cat $(obj)u-boot.img >> $@
  475. ifneq ($(CONFIG_TEGRA),)
  476. $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
  477. $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
  478. cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
  479. rm $(obj)spl/u-boot-spl-pad.bin
  480. ifeq ($(CONFIG_OF_SEPARATE),y)
  481. $(obj)u-boot-dtb-tegra.bin: $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb
  482. cat $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb > $@
  483. endif
  484. endif
  485. $(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
  486. cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
  487. # PPC4xx needs the SPL at the end of the image, since the reset vector
  488. # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
  489. # and need to introduce a new build target with the full blown U-Boot
  490. # at the start padded up to the start of the SPL image. And then concat
  491. # the SPL image to the end.
  492. $(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
  493. $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \
  494. --gap-fill=0xff $(obj)u-boot.img $@
  495. cat $(obj)spl/u-boot-spl.bin >> $@
  496. # Create a new ELF from a raw binary file. This is useful for arm64
  497. # where static relocation needs to be performed on the raw binary,
  498. # but certain simulators only accept an ELF file (but don't do the
  499. # relocation).
  500. # FIXME refactor dts/Makefile to share target/arch detection
  501. $(obj)u-boot.elf: $(obj)u-boot.bin
  502. @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \
  503. $< $(obj)u-boot-elf.o
  504. @$(LD) $(obj)u-boot-elf.o -o $@ \
  505. --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
  506. -Ttext=$(CONFIG_SYS_TEXT_BASE)
  507. ifeq ($(CONFIG_SANDBOX),y)
  508. GEN_UBOOT = \
  509. cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
  510. -Wl,--start-group $(__LIBS) -Wl,--end-group \
  511. $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
  512. else
  513. GEN_UBOOT = \
  514. cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
  515. $(__OBJS) \
  516. --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
  517. -Map u-boot.map -o u-boot
  518. endif
  519. $(obj)u-boot: depend \
  520. $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(obj)u-boot.lds
  521. $(GEN_UBOOT)
  522. ifeq ($(CONFIG_KALLSYMS),y)
  523. smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
  524. awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
  525. $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
  526. -c common/system_map.c -o $(obj)common/system_map.o
  527. $(GEN_UBOOT) $(obj)common/system_map.o
  528. endif
  529. $(OBJS):
  530. @:
  531. $(LIBS): depend $(SUBDIR_TOOLS)
  532. $(MAKE) $(build) $(dir $(subst $(obj),,$@))
  533. $(SUBDIRS): depend
  534. $(MAKE) $(build) $@ all
  535. $(SUBDIR_EXAMPLES-y): $(obj)u-boot
  536. $(obj)u-boot.lds: $(LDSCRIPT) depend
  537. $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
  538. nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend
  539. $(MAKE) $(build) nand_spl/board/$(BOARDDIR) all
  540. $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
  541. cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
  542. $(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend
  543. $(MAKE) -C spl all
  544. $(obj)tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend
  545. $(MAKE) -C spl all CONFIG_TPL_BUILD=y
  546. # Explicitly make _depend in subdirs containing multiple targets to prevent
  547. # parallel sub-makes creating .depend files simultaneously.
  548. depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
  549. $(obj)include/spl-autoconf.mk \
  550. $(obj)include/tpl-autoconf.mk \
  551. $(obj)include/autoconf.mk \
  552. $(obj)include/generated/generic-asm-offsets.h \
  553. $(obj)include/generated/asm-offsets.h
  554. TAG_SUBDIRS = $(SUBDIRS)
  555. TAG_SUBDIRS += $(dir $(__LIBS))
  556. TAG_SUBDIRS += include
  557. FIND := find
  558. FINDFLAGS := -L
  559. checkstack:
  560. $(CROSS_COMPILE)objdump -d $(obj)u-boot \
  561. `$(FIND) $(obj) -name u-boot-spl -print` | \
  562. perl $(src)scripts/checkstack.pl $(ARCH)
  563. tags ctags:
  564. ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
  565. -name '*.[chS]' -print`
  566. etags:
  567. etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
  568. -name '*.[chS]' -print`
  569. cscope:
  570. $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
  571. cscope.files
  572. cscope -b -q -k
  573. SYSTEM_MAP = \
  574. $(NM) $1 | \
  575. grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
  576. LC_ALL=C sort
  577. $(obj)System.map: $(obj)u-boot
  578. @$(call SYSTEM_MAP,$<) > $@
  579. checkthumb:
  580. @if test $(call cc-version) -lt 0404; then \
  581. echo -n '*** Your GCC does not produce working '; \
  582. echo 'binaries in THUMB mode.'; \
  583. echo '*** Your board is configured for THUMB mode.'; \
  584. false; \
  585. fi
  586. # GCC 3.x is reported to have problems generating the type of relocation
  587. # that U-Boot wants.
  588. # See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html
  589. checkgcc4:
  590. @if test $(call cc-version) -lt 0400; then \
  591. echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \
  592. false; \
  593. fi
  594. checkdtc:
  595. @if test $(call dtc-version) -lt 0104; then \
  596. echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \
  597. false; \
  598. fi
  599. #
  600. # Auto-generate the autoconf.mk file (which is included by all makefiles)
  601. #
  602. # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
  603. # the dep file is only include in this top level makefile to determine when
  604. # to regenerate the autoconf.mk file.
  605. $(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
  606. @$(XECHO) Generating $@ ; \
  607. : Generate the dependancies ; \
  608. $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
  609. -MQ $(obj)include/autoconf.mk include/common.h > $@ || \
  610. rm $@
  611. $(obj)include/autoconf.mk: $(obj)include/config.h
  612. @$(XECHO) Generating $@ ; \
  613. : Extract the config macros ; \
  614. $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
  615. sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  616. rm $@.tmp
  617. # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
  618. $(obj)include/tpl-autoconf.mk: $(obj)include/config.h
  619. @$(XECHO) Generating $@ ; \
  620. : Extract the config macros ; \
  621. $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\
  622. -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
  623. sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  624. rm $@.tmp
  625. $(obj)include/spl-autoconf.mk: $(obj)include/config.h
  626. @$(XECHO) Generating $@ ; \
  627. : Extract the config macros ; \
  628. $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
  629. sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  630. rm $@.tmp
  631. $(obj)include/generated/generic-asm-offsets.h: $(obj)lib/asm-offsets.s
  632. @$(XECHO) Generating $@
  633. tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
  634. $(obj)lib/asm-offsets.s: $(obj)include/config.h $(src)lib/asm-offsets.c
  635. @mkdir -p $(obj)lib
  636. $(CC) -DDO_DEPS_ONLY \
  637. $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
  638. -o $@ $(src)lib/asm-offsets.c -c -S
  639. $(obj)include/generated/asm-offsets.h: $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
  640. @$(XECHO) Generating $@
  641. tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
  642. $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/config.h
  643. @mkdir -p $(obj)$(CPUDIR)/$(SOC)
  644. if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
  645. $(CC) -DDO_DEPS_ONLY \
  646. $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
  647. -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
  648. else \
  649. touch $@; \
  650. fi
  651. #########################################################################
  652. else # !config.mk
  653. all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
  654. $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
  655. $(filter-out tools,$(SUBDIRS)) \
  656. depend dep tags ctags etags cscope $(obj)System.map:
  657. @echo "System not configured - see README" >&2
  658. @ exit 1
  659. tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
  660. $(MAKE) $(build) $@ all
  661. endif # config.mk
  662. # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
  663. # R_AARCH64_RELATIVE (64-bit).
  664. checkarmreloc: $(obj)u-boot
  665. @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \
  666. grep R_A | sort -u`"; \
  667. if test "$$RELOC" != "R_ARM_RELATIVE" -a \
  668. "$$RELOC" != "R_AARCH64_RELATIVE"; then \
  669. echo "$< contains unexpected relocations: $$RELOC"; \
  670. false; \
  671. fi
  672. $(VERSION_FILE):
  673. @mkdir -p $(dir $(VERSION_FILE))
  674. @( localvers='$(shell $(TOPDIR)/scripts/setlocalversion $(TOPDIR))' ; \
  675. printf '#define PLAIN_VERSION "%s%s"\n' \
  676. "$(U_BOOT_VERSION)" "$${localvers}" ; \
  677. printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
  678. "$(U_BOOT_VERSION)" "$${localvers}" ; \
  679. ) > $@.tmp
  680. @( printf '#define CC_VERSION_STRING "%s"\n' \
  681. '$(shell $(CC) --version | head -n 1)' )>> $@.tmp
  682. @( printf '#define LD_VERSION_STRING "%s"\n' \
  683. '$(shell $(LD) -v | head -n 1)' )>> $@.tmp
  684. @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
  685. $(TIMESTAMP_FILE):
  686. @mkdir -p $(dir $(TIMESTAMP_FILE))
  687. @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp
  688. @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
  689. @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
  690. easylogo env gdb:
  691. $(MAKE) $(build) tools/$@ MTD_VERSION=${MTD_VERSION}
  692. gdbtools: gdb
  693. xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
  694. $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
  695. tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
  696. $(MAKE) $(build) tools HOST_TOOLS_ALL=y
  697. .PHONY : CHANGELOG
  698. CHANGELOG:
  699. git log --no-merges U-Boot-1_1_5.. | \
  700. unexpand -a | sed -e 's/\s\s*$$//' > $@
  701. include/license.h: tools/bin2header COPYING
  702. cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
  703. #########################################################################
  704. unconfig:
  705. @rm -f $(obj)include/config.h $(obj)include/config.mk \
  706. $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
  707. $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep \
  708. $(obj)include/spl-autoconf.mk \
  709. $(obj)include/tpl-autoconf.mk
  710. %_config:: unconfig
  711. @$(MKCONFIG) -A $(@:_config=)
  712. sinclude $(obj).boards.depend
  713. $(obj).boards.depend: boards.cfg
  714. @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@
  715. #########################################################################
  716. #########################################################################
  717. clean:
  718. @rm -f $(obj)examples/standalone/atmel_df_pow2 \
  719. $(obj)examples/standalone/hello_world \
  720. $(obj)examples/standalone/interrupt \
  721. $(obj)examples/standalone/mem_to_mem_idma2intr \
  722. $(obj)examples/standalone/sched \
  723. $(addprefix $(obj)examples/standalone/, smc91111_eeprom smc911x_eeprom) \
  724. $(obj)examples/standalone/test_burst \
  725. $(obj)examples/standalone/timer
  726. @rm -f $(addprefix $(obj)examples/api/, demo demo.bin)
  727. @rm -f $(obj)tools/bmp_logo $(obj)tools/easylogo/easylogo \
  728. $(obj)tools/env/fw_printenv \
  729. $(obj)tools/envcrc \
  730. $(addprefix $(obj)tools/gdb/, gdbcont gdbsend) \
  731. $(obj)tools/gen_eth_addr $(obj)tools/img2srec \
  732. $(obj)tools/dumpimage \
  733. $(addprefix $(obj)tools/, mkenvimage mkimage) \
  734. $(obj)tools/mpc86x_clk \
  735. $(addprefix $(obj)tools/, mk$(BOARD)spl mkexynosspl) \
  736. $(obj)tools/mxsboot \
  737. $(obj)tools/ncb $(obj)tools/ubsha1 \
  738. $(obj)tools/kernel-doc/docproc \
  739. $(obj)tools/proftool
  740. @rm -f $(addprefix $(obj)board/cray/L1/, bootscript.c bootscript.image) \
  741. $(obj)board/matrix_vision/*/bootscript.img \
  742. $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl \
  743. $(obj)u-boot.lds \
  744. $(addprefix $(obj)arch/blackfin/cpu/, init.lds init.elf)
  745. @rm -f $(obj)include/bmp_logo.h
  746. @rm -f $(obj)include/bmp_logo_data.h
  747. @rm -f $(obj)lib/asm-offsets.s
  748. @rm -f $(obj)include/generated/asm-offsets.h
  749. @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
  750. @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
  751. @$(MAKE) -s -C doc/DocBook/ cleandocs
  752. @find $(OBJTREE) -type f \
  753. \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
  754. -o -name '*.o' -o -name '*.a' -o -name '*.exe' \
  755. -o -name '*.cfgtmp' \) -print \
  756. | xargs rm -f
  757. # Removes everything not needed for testing u-boot
  758. tidy: clean
  759. @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
  760. clobber: tidy
  761. @find $(OBJTREE) -type f \( -name '*.srec' \
  762. -o -name '*.bin' -o -name u-boot.img \) \
  763. -print0 | xargs -0 rm -f
  764. @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
  765. $(obj)cscope.* $(obj)*.*~
  766. @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
  767. @rm -f $(obj)u-boot.kwb
  768. @rm -f $(obj)u-boot.pbl
  769. @rm -f $(obj)u-boot.imx
  770. @rm -f $(obj)u-boot-with-spl.imx
  771. @rm -f $(obj)u-boot-with-nand-spl.imx
  772. @rm -f $(obj)u-boot.ubl
  773. @rm -f $(obj)u-boot.ais
  774. @rm -f $(obj)u-boot.dtb
  775. @rm -f $(obj)u-boot.sb
  776. @rm -f $(obj)u-boot.spr
  777. @rm -f $(addprefix $(obj)nand_spl/, u-boot.lds u-boot.lst System.map)
  778. @rm -f $(addprefix $(obj)nand_spl/, u-boot-nand_spl.lds u-boot-spl u-boot-spl.map)
  779. @rm -f $(addprefix $(obj)spl/, u-boot-spl u-boot-spl.bin u-boot-spl.map)
  780. @rm -f $(obj)spl/u-boot-spl.lds
  781. @rm -f $(addprefix $(obj)tpl/, u-boot-tpl u-boot-tpl.bin u-boot-tpl.map)
  782. @rm -f $(obj)tpl/u-boot-spl.lds
  783. @rm -f $(obj)MLO MLO.byteswap
  784. @rm -f $(obj)SPL
  785. @rm -f $(obj)tools/xway-swap-bytes
  786. @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
  787. @rm -fr $(obj)include/generated
  788. @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
  789. @rm -f $(obj)dts/*.tmp
  790. @rm -f $(addprefix $(obj)spl/, u-boot-spl.ais, u-boot-spl-pad.ais)
  791. mrproper \
  792. distclean: clobber unconfig
  793. ifneq ($(OBJTREE),$(SRCTREE))
  794. rm -rf $(obj)*
  795. endif
  796. backup:
  797. F=`basename $(TOPDIR)` ; cd .. ; \
  798. gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
  799. #########################################################################