xref: /openbmc/u-boot/Makefile (revision c37980c3)
17ebf7443Swdenk#
244b333efSChander Kashyap# (C) Copyright 2000-2012
37ebf7443Swdenk# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
47ebf7443Swdenk#
57ebf7443Swdenk# See file CREDITS for list of people who contributed to this
67ebf7443Swdenk# project.
77ebf7443Swdenk#
87ebf7443Swdenk# This program is free software; you can redistribute it and/or
97ebf7443Swdenk# modify it under the terms of the GNU General Public License as
1045a212c4SWolfgang Denk# published by the Free Software Foundatio; either version 2 of
117ebf7443Swdenk# the License, or (at your option) any later version.
127ebf7443Swdenk#
137ebf7443Swdenk# This program is distributed in the hope that it will be useful,
147ebf7443Swdenk# but WITHOUT ANY WARRANTY; without even the implied warranty of
157ebf7443Swdenk# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
167ebf7443Swdenk# GNU General Public License for more details.
177ebf7443Swdenk#
187ebf7443Swdenk# You should have received a copy of the GNU General Public License
197ebf7443Swdenk# along with this program; if not, write to the Free Software
207ebf7443Swdenk# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
217ebf7443Swdenk# MA 02111-1307 USA
227ebf7443Swdenk#
237ebf7443Swdenk
243ae7b240STom RiniVERSION = 2013
252536850dSTom RiniPATCHLEVEL = 04
26211e4754SWolfgang DenkSUBLEVEL =
27d10f68aeSTom RiniEXTRAVERSION =
288b9e4787SWolfgang Denkifneq "$(SUBLEVEL)" ""
29881a87ecSWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
308b9e4787SWolfgang Denkelse
318b9e4787SWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
328b9e4787SWolfgang Denkendif
33efb2172eSSimon GlassTIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
34efb2172eSSimon GlassVERSION_FILE = $(obj)include/generated/version_autogenerated.h
35881a87ecSWolfgang Denk
367ebf7443SwdenkHOSTARCH := $(shell uname -m | \
37fea25720SGraeme Russ	sed -e s/i.86/x86/ \
387ebf7443Swdenk	    -e s/sun4u/sparc64/ \
397ebf7443Swdenk	    -e s/arm.*/arm/ \
407ebf7443Swdenk	    -e s/sa110/arm/ \
41d0179083SKumar Gala	    -e s/ppc64/powerpc/ \
42d0179083SKumar Gala	    -e s/ppc/powerpc/ \
438d1f6355SNobuhiro Iwamatsu	    -e s/macppc/powerpc/\
448d1f6355SNobuhiro Iwamatsu	    -e s/sh.*/sh/)
457ebf7443Swdenk
46f9d77ed3SWolfgang DenkHOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
477ebf7443Swdenk	    sed -e 's/\(cygwin\).*/cygwin/')
487ebf7443Swdenk
49120ae609SBenoît Thébaudeauexport	HOSTARCH HOSTOS
507ebf7443Swdenk
517ebf7443Swdenk# Deal with colliding definitions from tcsh etc.
527ebf7443SwdenkVENDOR=
537ebf7443Swdenk
547ebf7443Swdenk#########################################################################
55ae6d1056SWolfgang Denk# Allow for silent builds
56ae6d1056SWolfgang Denkifeq (,$(findstring s,$(MAKEFLAGS)))
57ae6d1056SWolfgang DenkXECHO = echo
58ae6d1056SWolfgang Denkelse
59ae6d1056SWolfgang DenkXECHO = :
60ae6d1056SWolfgang Denkendif
61ae6d1056SWolfgang Denk
62ae6d1056SWolfgang Denk#########################################################################
63f9328639SMarian Balakowicz#
64f9328639SMarian Balakowicz# U-boot build supports producing a object files to the separate external
65f9328639SMarian Balakowicz# directory. Two use cases are supported:
66f9328639SMarian Balakowicz#
67f9328639SMarian Balakowicz# 1) Add O= to the make command line
68f9328639SMarian Balakowicz# 'make O=/tmp/build all'
69f9328639SMarian Balakowicz#
70f9328639SMarian Balakowicz# 2) Set environement variable BUILD_DIR to point to the desired location
71f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
72f9328639SMarian Balakowicz# 'make'
73f9328639SMarian Balakowicz#
74f9328639SMarian Balakowicz# The second approach can also be used with a MAKEALL script
75f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
76f9328639SMarian Balakowicz# './MAKEALL'
77f9328639SMarian Balakowicz#
78f9328639SMarian Balakowicz# Command line 'O=' setting overrides BUILD_DIR environent variable.
79f9328639SMarian Balakowicz#
80f9328639SMarian Balakowicz# When none of the above methods is used the local build is performed and
81f9328639SMarian Balakowicz# the object files are placed in the source directory.
82f9328639SMarian Balakowicz#
837ebf7443Swdenk
84f9328639SMarian Balakowiczifdef O
85f9328639SMarian Balakowiczifeq ("$(origin O)", "command line")
86f9328639SMarian BalakowiczBUILD_DIR := $(O)
87f9328639SMarian Balakowiczendif
88f9328639SMarian Balakowiczendif
897ebf7443Swdenk
904ab64933SKim Phillips# Call a source code checker (by default, "sparse") as part of the
914ab64933SKim Phillips# C compilation.
924ab64933SKim Phillips#
934ab64933SKim Phillips# Use 'make C=1' to enable checking of re-compiled files.
944ab64933SKim Phillips#
954ab64933SKim Phillips# See the linux kernel file "Documentation/sparse.txt" for more details,
964ab64933SKim Phillips# including where to get the "sparse" utility.
974ab64933SKim Phillips
984ab64933SKim Phillipsifdef C
994ab64933SKim Phillipsifeq ("$(origin C)", "command line")
1004ab64933SKim PhillipsCHECKSRC := $(C)
1014ab64933SKim Phillipsendif
1024ab64933SKim Phillipsendif
1034ab64933SKim Phillipsifndef CHECKSRC
1044ab64933SKim Phillips  CHECKSRC = 0
1054ab64933SKim Phillipsendif
1064ab64933SKim Phillipsexport CHECKSRC
1074ab64933SKim Phillips
108f9328639SMarian Balakowiczifneq ($(BUILD_DIR),)
109f9328639SMarian Balakowiczsaved-output := $(BUILD_DIR)
1104f0645ebSMarian Balakowicz
1114f0645ebSMarian Balakowicz# Attempt to create a output directory.
1124f0645ebSMarian Balakowicz$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
1134f0645ebSMarian Balakowicz
1144f0645ebSMarian Balakowicz# Verify if it was successful.
115f9328639SMarian BalakowiczBUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
116f9328639SMarian Balakowicz$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
117f9328639SMarian Balakowiczendif # ifneq ($(BUILD_DIR),)
118f9328639SMarian Balakowicz
119f9328639SMarian BalakowiczOBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
120c8f9c302SDaniel SchwierzeckSPLTREE		:= $(OBJTREE)/spl
121f9328639SMarian BalakowiczSRCTREE		:= $(CURDIR)
122f9328639SMarian BalakowiczTOPDIR		:= $(SRCTREE)
123f9328639SMarian BalakowiczLNDIR		:= $(OBJTREE)
124c8f9c302SDaniel Schwierzeckexport	TOPDIR SRCTREE OBJTREE SPLTREE
125f9328639SMarian Balakowicz
126f9328639SMarian BalakowiczMKCONFIG	:= $(SRCTREE)/mkconfig
127f9328639SMarian Balakowiczexport MKCONFIG
128f9328639SMarian Balakowicz
129f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
130f9328639SMarian BalakowiczREMOTE_BUILD	:= 1
131f9328639SMarian Balakowiczexport REMOTE_BUILD
132f9328639SMarian Balakowiczendif
133f9328639SMarian Balakowicz
134f9328639SMarian Balakowicz# $(obj) and (src) are defined in config.mk but here in main Makefile
135f9328639SMarian Balakowicz# we also need them before config.mk is included which is the case for
136f9328639SMarian Balakowicz# some targets like unconfig, clean, clobber, distclean, etc.
137f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
138f9328639SMarian Balakowiczobj := $(OBJTREE)/
139f9328639SMarian Balakowiczsrc := $(SRCTREE)/
140f9328639SMarian Balakowiczelse
141f9328639SMarian Balakowiczobj :=
142f9328639SMarian Balakowiczsrc :=
143f9328639SMarian Balakowiczendif
144f9328639SMarian Balakowiczexport obj src
145f9328639SMarian Balakowicz
1465013c09fSWolfgang Denk# Make sure CDPATH settings don't interfere
1475013c09fSWolfgang Denkunexport CDPATH
1485013c09fSWolfgang Denk
149f9328639SMarian Balakowicz#########################################################################
150f9328639SMarian Balakowicz
1516d1ce387SMike Frysinger# The "tools" are needed early, so put this first
1526d1ce387SMike Frysinger# Don't include stuff already done in $(LIBS)
153349e83f0SChe-liang Chiou# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
154349e83f0SChe-liang Chiou# is "yes"), so compile examples after U-Boot is compiled.
155349e83f0SChe-liang ChiouSUBDIR_TOOLS = tools
156349e83f0SChe-liang ChiouSUBDIR_EXAMPLES = examples/standalone examples/api
157349e83f0SChe-liang ChiouSUBDIRS = $(SUBDIR_TOOLS)
1586d1ce387SMike Frysinger
159249b53a6SLoïc Minier.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
1606d1ce387SMike Frysinger
161ae6d1056SWolfgang Denkifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
162f9328639SMarian Balakowicz
1632632c008SMike Frysinger# Include autoconf.mk before config.mk so that the config options are available
1642632c008SMike Frysinger# to all top level build files.  We need the dummy all: target to prevent the
1652632c008SMike Frysinger# dependency target in autoconf.mk.dep from being the default.
1662632c008SMike Frysingerall:
1672632c008SMike Frysingersinclude $(obj)include/autoconf.mk.dep
1682632c008SMike Frysingersinclude $(obj)include/autoconf.mk
1692632c008SMike Frysinger
170b5728756SSimon Glassifndef CONFIG_SANDBOX
171b5728756SSimon GlassSUBDIRS += $(SUBDIR_EXAMPLES)
172b5728756SSimon Glassendif
173b5728756SSimon Glass
1747ebf7443Swdenk# load ARCH, BOARD, and CPU configuration
175ae6d1056SWolfgang Denkinclude $(obj)include/config.mk
1761d9f4105Swdenkexport	ARCH CPU BOARD VENDOR SOC
177f9328639SMarian Balakowicz
1781ea6bcd8SMike Frysinger# set default to nothing for native builds
179a5284efdSWolfgang Denkifeq ($(HOSTARCH),$(ARCH))
1801ea6bcd8SMike FrysingerCROSS_COMPILE ?=
1817ebf7443Swdenkendif
1827ebf7443Swdenk
18392b197f0SWolfgang Denk# load other configuration
18492b197f0SWolfgang Denkinclude $(TOPDIR)/config.mk
18592b197f0SWolfgang Denk
186fada9e20SSimon Glass# Targets which don't build the source code
187fada9e20SSimon GlassNON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig
188fada9e20SSimon Glass
189fada9e20SSimon Glass# Only do the generic board check when actually building, not configuring
190fada9e20SSimon Glassifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
191fada9e20SSimon Glassifeq ($(findstring _config,$(MAKECMDGOALS)),)
192fada9e20SSimon Glass$(CHECK_GENERIC_BOARD)
193fada9e20SSimon Glassendif
194fada9e20SSimon Glassendif
195fada9e20SSimon Glass
196d51dfff7SIlya Yanok# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
197d51dfff7SIlya Yanok# that (or fail if absent).  Otherwise, search for a linker script in a
198d51dfff7SIlya Yanok# standard location.
199d51dfff7SIlya Yanok
200ee60197eSSimon GlassLDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT))
201ee60197eSSimon Glass
202d51dfff7SIlya Yanokifndef LDSCRIPT
203d51dfff7SIlya Yanok	#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
204d51dfff7SIlya Yanok	ifdef CONFIG_SYS_LDSCRIPT
205d51dfff7SIlya Yanok		# need to strip off double quotes
206d51dfff7SIlya Yanok		LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
207d51dfff7SIlya Yanok	endif
208d51dfff7SIlya Yanokendif
209d51dfff7SIlya Yanok
210ee60197eSSimon Glass# If there is no specified link script, we look in a number of places for it
211d51dfff7SIlya Yanokifndef LDSCRIPT
212d51dfff7SIlya Yanok	ifeq ($(CONFIG_NAND_U_BOOT),y)
213d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
214d51dfff7SIlya Yanok		ifeq ($(wildcard $(LDSCRIPT)),)
215d51dfff7SIlya Yanok			LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
216d51dfff7SIlya Yanok		endif
217d51dfff7SIlya Yanok	endif
218d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
219d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
220d51dfff7SIlya Yanok	endif
221d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
222d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
223d51dfff7SIlya Yanok	endif
224d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
225ee60197eSSimon Glass		LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
226ee60197eSSimon Glass		# We don't expect a Makefile here
227ee60197eSSimon Glass		LDSCRIPT_MAKEFILE_DIR =
228ee60197eSSimon Glass	endif
229ee60197eSSimon Glass	ifeq ($(wildcard $(LDSCRIPT)),)
230d51dfff7SIlya Yanok$(error could not find linker script)
231d51dfff7SIlya Yanok	endif
232d51dfff7SIlya Yanokendif
233d51dfff7SIlya Yanok
2347ebf7443Swdenk#########################################################################
2357ebf7443Swdenk# U-Boot objects....order is important (i.e. start must be first)
2367ebf7443Swdenk
23703b7004dSPeter TyserOBJS  = $(CPUDIR)/start.o
2387ebf7443Swdenkifeq ($(CPU),ppc4xx)
23903b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
2407ebf7443Swdenkendif
24142d1f039Swdenkifeq ($(CPU),mpc85xx)
24203b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
24342d1f039Swdenkendif
2447ebf7443Swdenk
245a32e626fSSimon GlassOBJS := $(addprefix $(obj),$(OBJS))
246f9328639SMarian Balakowicz
2478b5a0264SDaniel SchwierzeckHAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
2488b5a0264SDaniel Schwierzeck
249f52d7b35SDaniel SchwierzeckLIBS-y += lib/libgeneric.o
250f52d7b35SDaniel SchwierzeckLIBS-y += lib/lzma/liblzma.o
251f52d7b35SDaniel SchwierzeckLIBS-y += lib/lzo/liblzo.o
252f52d7b35SDaniel SchwierzeckLIBS-y += lib/zlib/libz.o
2538b5a0264SDaniel SchwierzeckLIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o
2548b5a0264SDaniel SchwierzeckLIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
255f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/lib$(CPU).o
2561d9f4105Swdenkifdef SOC
257f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
2581d9f4105Swdenkendif
259323bfa8fSStefan Roeseifeq ($(CPU),ixp)
26061e12988SMarek VasutLIBS-y += drivers/net/npe/libnpe.o
261323bfa8fSStefan Roeseendif
2628b5a0264SDaniel SchwierzeckLIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
263f52d7b35SDaniel SchwierzeckLIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
264045fa1e1SStephen WarrenLIBS-y += fs/libfs.o \
265045fa1e1SStephen Warren	fs/cbfs/libcbfs.o \
26684cd9327SGabe Black	fs/cramfs/libcramfs.o \
267a1596438SUma Shankar	fs/ext4/libext4fs.o \
268a1596438SUma Shankar	fs/fat/libfat.o \
269a1596438SUma Shankar	fs/fdos/libfdos.o \
270a1596438SUma Shankar	fs/jffs2/libjffs2.o \
271a1596438SUma Shankar	fs/reiserfs/libreiserfs.o \
27292ccc96bSSimon Glass	fs/sandbox/libsandboxfs.o \
273a1596438SUma Shankar	fs/ubifs/libubifs.o \
274a1596438SUma Shankar	fs/yaffs2/libyaffs2.o \
275a1596438SUma Shankar	fs/zfs/libzfs.o
276f52d7b35SDaniel SchwierzeckLIBS-y += net/libnet.o
277f52d7b35SDaniel SchwierzeckLIBS-y += disk/libdisk.o
278f52d7b35SDaniel SchwierzeckLIBS-y += drivers/bios_emulator/libatibiosemu.o
279f52d7b35SDaniel SchwierzeckLIBS-y += drivers/block/libblock.o
2800044c42eSStefan RoeseLIBS-$(CONFIG_BOOTCOUNT_LIMIT) += drivers/bootcount/libbootcount.o
281acbb1eb7SAkshay SaraswatLIBS-y += drivers/crypto/libcrypto.o
282f52d7b35SDaniel SchwierzeckLIBS-y += drivers/dma/libdma.o
283f52d7b35SDaniel SchwierzeckLIBS-y += drivers/fpga/libfpga.o
284f52d7b35SDaniel SchwierzeckLIBS-y += drivers/gpio/libgpio.o
285f52d7b35SDaniel SchwierzeckLIBS-y += drivers/hwmon/libhwmon.o
286f52d7b35SDaniel SchwierzeckLIBS-y += drivers/i2c/libi2c.o
287f52d7b35SDaniel SchwierzeckLIBS-y += drivers/input/libinput.o
288f52d7b35SDaniel SchwierzeckLIBS-y += drivers/misc/libmisc.o
289f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mmc/libmmc.o
290f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/libmtd.o
291f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/nand/libnand.o
292f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/onenand/libonenand.o
293f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/ubi/libubi.o
294f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/spi/libspi_flash.o
295f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/libnet.o
296f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/phy/libphy.o
297f52d7b35SDaniel SchwierzeckLIBS-y += drivers/pci/libpci.o
298f52d7b35SDaniel SchwierzeckLIBS-y += drivers/pcmcia/libpcmcia.o
299e0a0cbf2SŁukasz MajewskiLIBS-y += drivers/power/libpower.o \
300b95aacd3SŁukasz Majewski	drivers/power/fuel_gauge/libfuel_gauge.o \
301eba42391SŁukasz Majewski	drivers/power/pmic/libpmic.o \
302eba42391SŁukasz Majewski	drivers/power/battery/libbattery.o
303f52d7b35SDaniel SchwierzeckLIBS-y += drivers/spi/libspi.o
304f22b11c1SLukasz MajewskiLIBS-y += drivers/dfu/libdfu.o
3057737d5c6SDave Liuifeq ($(CPU),mpc83xx)
306f52d7b35SDaniel SchwierzeckLIBS-y += drivers/qe/libqe.o
307f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
308f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
3097737d5c6SDave Liuendif
310da9d4610SAndy Flemingifeq ($(CPU),mpc85xx)
311f52d7b35SDaniel SchwierzeckLIBS-y += drivers/qe/libqe.o
312f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/fm/libfm.o
313f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
314f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
31558e5e9afSKumar Galaendif
31658e5e9afSKumar Galaifeq ($(CPU),mpc86xx)
317f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
318f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
319da9d4610SAndy Flemingendif
320f52d7b35SDaniel SchwierzeckLIBS-y += drivers/rtc/librtc.o
321f52d7b35SDaniel SchwierzeckLIBS-y += drivers/serial/libserial.o
322511ed5fdSRajeshwari ShindeLIBS-y += drivers/sound/libsound.o
323f6267998SRong ChangLIBS-y += drivers/tpm/libtpm.o
324f52d7b35SDaniel SchwierzeckLIBS-y += drivers/twserial/libtws.o
325f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/eth/libusb_eth.o
326f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/gadget/libusb_gadget.o
327f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/host/libusb_host.o
328f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/musb/libusb_musb.o
329eb81955bSIlya YanokLIBS-y += drivers/usb/musb-new/libusb_musb-new.o
330f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/phy/libusb_phy.o
331f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/ulpi/libusb_ulpi.o
332f52d7b35SDaniel SchwierzeckLIBS-y += drivers/video/libvideo.o
333f52d7b35SDaniel SchwierzeckLIBS-y += drivers/watchdog/libwatchdog.o
334f52d7b35SDaniel SchwierzeckLIBS-y += common/libcommon.o
335f52d7b35SDaniel SchwierzeckLIBS-y += lib/libfdt/libfdt.o
336f52d7b35SDaniel SchwierzeckLIBS-y += api/libapi.o
337f52d7b35SDaniel SchwierzeckLIBS-y += post/libpost.o
338f52d7b35SDaniel SchwierzeckLIBS-y += test/libtest.o
339f9328639SMarian Balakowicz
340ea7b96b6SMatt Porterifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TI814X),)
341f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/omap-common/libomap-common.o
342f0f4b5ffSChandan Nathendif
34318936ee2SJason Liu
34424e8bee5SAlison Wangifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
345ea00e59bSStefano BabicLIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
34618936ee2SJason Liuendif
34718936ee2SJason Liu
348852bd07cSMinkyu Kangifeq ($(SOC),s5pc1xx)
349f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
350852bd07cSMinkyu Kangendif
351393cb361SChander Kashyapifeq ($(SOC),exynos)
352f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
353852bd07cSMinkyu Kangendif
3546d6c0baeSTom Warrenifneq ($(CONFIG_TEGRA),)
355d9e73a87SAllen MartinLIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
3563064f322STom WarrenLIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
3573064f322STom WarrenLIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
358d9e73a87SAllen Martinendif
359852bd07cSMinkyu Kang
360f52d7b35SDaniel SchwierzeckLIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
361249b53a6SLoïc Minier.PHONY : $(LIBS)
362a8c7c708Swdenk
3636d8962e8SSebastien CarlierLIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
364de109d90SWolfgang DenkLIBBOARD := $(addprefix $(obj),$(LIBBOARD))
365de109d90SWolfgang Denk
3664f7cb08eSwdenk# Add GCC lib
36752b1bf2cSWolfgang Denkifdef USE_PRIVATE_LIBGCC
36852b1bf2cSWolfgang Denkifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
369635d1b3eSMatthias WeisserPLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
37052b1bf2cSWolfgang Denkelse
37152b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
37252b1bf2cSWolfgang Denkendif
37352b1bf2cSWolfgang Denkelse
374cca4e4aeSWolfgang DenkPLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
37552b1bf2cSWolfgang Denkendif
37652b1bf2cSWolfgang DenkPLATFORM_LIBS += $(PLATFORM_LIBGCC)
37752b1bf2cSWolfgang Denkexport PLATFORM_LIBS
3783d3befa7Swdenk
3796ac9f479SMike Frysinger# Special flags for CPP when processing the linker script.
3806ac9f479SMike Frysinger# Pass the version down so we can handle backwards compatibility
3816ac9f479SMike Frysinger# on the fly.
3826ac9f479SMike FrysingerLDPPFLAGS += \
3836ac9f479SMike Frysinger	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
3847e6403a6SSimon Glass	-DCPUDIR=$(CPUDIR) \
3856ac9f479SMike Frysinger	$(shell $(LD) --version | \
3866ac9f479SMike Frysinger	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
3876ac9f479SMike Frysinger
388f9328639SMarian Balakowicz__OBJS := $(subst $(obj),,$(OBJS))
389de109d90SWolfgang Denk__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
390f9328639SMarian Balakowicz
3917ebf7443Swdenk#########################################################################
392bdccc4feSwdenk#########################################################################
3937ebf7443Swdenk
394f3a14d37SMike Frysingerifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
395f3a14d37SMike FrysingerBOARD_SIZE_CHECK = \
396f3a14d37SMike Frysinger	@actual=`wc -c $@ | awk '{print $$1}'`; \
397d060e6f4SJoe Hershberger	limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \
398f3a14d37SMike Frysinger	if test $$actual -gt $$limit; then \
399d060e6f4SJoe Hershberger		echo "$@ exceeds file size limit:" >&2 ; \
400d060e6f4SJoe Hershberger		echo "  limit:  $$limit bytes" >&2 ; \
401d060e6f4SJoe Hershberger		echo "  actual: $$actual bytes" >&2 ; \
402d060e6f4SJoe Hershberger		echo "  excess: $$((actual - limit)) bytes" >&2; \
403f3a14d37SMike Frysinger		exit 1; \
404f3a14d37SMike Frysinger	fi
405f3a14d37SMike Frysingerelse
406f3a14d37SMike FrysingerBOARD_SIZE_CHECK =
407f3a14d37SMike Frysingerendif
408f3a14d37SMike Frysinger
4093e88337bSMike Frysinger# Always append ALL so that arch config.mk's can add custom ones
4104e0fbb98SDaniel SchwierzeckALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
411e935a374SHaiying Wang
4124e0fbb98SDaniel SchwierzeckALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
4134e0fbb98SDaniel SchwierzeckALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
4145df2ee27SDaniel SchwierzeckALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
4152c0f79e4SSimon GlassALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
416b343bbb5SVadim Bendeburyifneq ($(CONFIG_SPL_TARGET),)
417b343bbb5SVadim BendeburyALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET))
418b343bbb5SVadim Bendeburyendif
4197ebf7443Swdenk
42012b7b70cSAllen Martin# enable combined SPL/u-boot/dtb rules for tegra
4216d6c0baeSTom Warrenifneq ($(CONFIG_TEGRA),)
42212b7b70cSAllen Martinifeq ($(CONFIG_OF_SEPARATE),y)
42312b7b70cSAllen MartinALL-y += $(obj)u-boot-dtb-tegra.bin
42412b7b70cSAllen Martinelse
42512b7b70cSAllen MartinALL-y += $(obj)u-boot-nodtb-tegra.bin
42612b7b70cSAllen Martinendif
42712b7b70cSAllen Martinendif
42812b7b70cSAllen Martin
429349e83f0SChe-liang Chiouall:		$(ALL-y) $(SUBDIR_EXAMPLES)
4307ebf7443Swdenk
4312c0f79e4SSimon Glass$(obj)u-boot.dtb:	$(obj)u-boot
4322c0f79e4SSimon Glass		$(MAKE) -C dts binary
4332c0f79e4SSimon Glass		mv $(obj)dts/dt.dtb $@
4342c0f79e4SSimon Glass
4352c0f79e4SSimon Glass$(obj)u-boot-dtb.bin:	$(obj)u-boot.bin $(obj)u-boot.dtb
4362c0f79e4SSimon Glass		cat $^ >$@
4372c0f79e4SSimon Glass
438f9328639SMarian Balakowicz$(obj)u-boot.hex:	$(obj)u-boot
4396310eb9dSwdenk		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
4406310eb9dSwdenk
441f9328639SMarian Balakowicz$(obj)u-boot.srec:	$(obj)u-boot
4420817d688SRicardo Ribalda Delgado		$(OBJCOPY) -O srec $< $@
4437ebf7443Swdenk
444f9328639SMarian Balakowicz$(obj)u-boot.bin:	$(obj)u-boot
4457ebf7443Swdenk		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
446f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
4477ebf7443Swdenk
44894a91e24SMike Frysinger$(obj)u-boot.ldr:	$(obj)u-boot
44976d82187SMike Frysinger		$(CREATE_LDR_ENV)
45068e56324SMike Frysinger		$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
451f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
45294a91e24SMike Frysinger
45394a91e24SMike Frysinger$(obj)u-boot.ldr.hex:	$(obj)u-boot.ldr
45494a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
45594a91e24SMike Frysinger
45694a91e24SMike Frysinger$(obj)u-boot.ldr.srec:	$(obj)u-boot.ldr
45794a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
45894a91e24SMike Frysinger
459b40bda6bSStefan Roese#
460b40bda6bSStefan Roese# U-Boot entry point, needed for booting of full-blown U-Boot
461b40bda6bSStefan Roese# from the SPL U-Boot version.
462b40bda6bSStefan Roese#
463b40bda6bSStefan Roeseifndef CONFIG_SYS_UBOOT_START
464b40bda6bSStefan RoeseCONFIG_SYS_UBOOT_START := 0
465b40bda6bSStefan Roeseendif
466b40bda6bSStefan Roese
467f9328639SMarian Balakowicz$(obj)u-boot.img:	$(obj)u-boot.bin
468a2a0a717SWolfgang Denk		$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
469b40bda6bSStefan Roese		-O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
470b40bda6bSStefan Roese		-e $(CONFIG_SYS_UBOOT_START) \
471881a87ecSWolfgang Denk		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
472bdccc4feSwdenk			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
473bdccc4feSwdenk		-d $< $@
474bdccc4feSwdenk
475291b3dcdSOtavio Salvador$(obj)u-boot.imx: $(obj)u-boot.bin depend
476291b3dcdSOtavio Salvador		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
4778edcde5eSStefano Babic
478aa0c7a86SPrafulla Wadaskar$(obj)u-boot.kwb:       $(obj)u-boot.bin
47931d80c77SPrafulla Wadaskar		$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
4802ea88b06SEric Cooper		-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
481aa0c7a86SPrafulla Wadaskar
4825d898a00SShaohui Xie$(obj)u-boot.pbl:	$(obj)u-boot.bin
4835d898a00SShaohui Xie		$(obj)tools/mkimage -n $(CONFIG_PBLRCW_CONFIG) \
4845d898a00SShaohui Xie		-R $(CONFIG_PBLPBI_CONFIG) -T pblimage \
4855d898a00SShaohui Xie		-d $< $@
4865d898a00SShaohui Xie
487566a494fSHeiko Schocher$(obj)u-boot.sha1:	$(obj)u-boot.bin
48801159530SHeiko Schocher		$(obj)tools/ubsha1 $(obj)u-boot.bin
489566a494fSHeiko Schocher
490f9328639SMarian Balakowicz$(obj)u-boot.dis:	$(obj)u-boot
4917ebf7443Swdenk		$(OBJDUMP) -d $< > $@
4927ebf7443Swdenk
49374752baaSScott Wood
49474752baaSScott Wood
4955364add4SScott Wood$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
4966113d3f2SBenoît Thébaudeau		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
4976113d3f2SBenoît Thébaudeau			-I binary -O binary $< $(obj)spl/u-boot-spl-pad.bin
4985364add4SScott Wood		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
499435199f3SHeiko Schocher		rm $(obj)spl/u-boot-spl-pad.bin
5007816f2cfSHeiko Schocher
501ba597609SBenoît Thébaudeau$(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
502ba597609SBenoît Thébaudeau		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
503ba597609SBenoît Thébaudeau			$(OBJTREE)/u-boot-with-spl.imx
504ba597609SBenoît Thébaudeau
5057d5a5c79SBenoît Thébaudeau$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
5067d5a5c79SBenoît Thébaudeau		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
5077d5a5c79SBenoît Thébaudeau			$(OBJTREE)/u-boot-with-nand-spl.imx
5087d5a5c79SBenoît Thébaudeau
5095364add4SScott Wood$(obj)u-boot.ubl:       $(obj)u-boot-with-spl.bin
510277f00f5SJosé Miguel Gonçalves		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
5115364add4SScott Wood		-e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
512277f00f5SJosé Miguel Gonçalves
5133f7f2414STom Rini$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
5146d660e77SSughosh Ganu		$(obj)tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") \
5156d660e77SSughosh Ganu			-T aisimage \
516d36d8859SChristian Riesch			-e $(CONFIG_SPL_TEXT_BASE) \
517d36d8859SChristian Riesch			-d $(obj)spl/u-boot-spl.bin \
518d36d8859SChristian Riesch			$(obj)spl/u-boot-spl.ais
519d36d8859SChristian Riesch		$(OBJCOPY) ${OBJCFLAGS} -I binary \
520d36d8859SChristian Riesch			--pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
521d36d8859SChristian Riesch			$(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
5223f7f2414STom Rini		cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
523d36d8859SChristian Riesch			$(obj)u-boot.ais
524d36d8859SChristian Riesch
525a5453555SOtavio Salvador
52630b9b932SMarek Vasut$(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
527714dc001SMarek Vasut		$(MAKE) -C $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
52830b9b932SMarek Vasut
52994aebe6cSStefan Roese# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
53094aebe6cSStefan Roese# Both images are created using mkimage (crc etc), so that the ROM
53194aebe6cSStefan Roese# bootloader can check its integrity. Padding needs to be done to the
53294aebe6cSStefan Roese# SPL image (with mkimage header) and not the binary. Otherwise the resulting image
53394aebe6cSStefan Roese# which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
53494aebe6cSStefan Roese# The resulting image containing both U-Boot images is called u-boot.spr
53594aebe6cSStefan Roese$(obj)u-boot.spr:	$(obj)u-boot.img $(obj)spl/u-boot-spl.bin
53694aebe6cSStefan Roese		$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
53794aebe6cSStefan Roese		-a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
53894aebe6cSStefan Roese		-d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
53994aebe6cSStefan Roese		tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \
54094aebe6cSStefan Roese			of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null
54194aebe6cSStefan Roese		dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \
54294aebe6cSStefan Roese			conv=notrunc 2>/dev/null
54394aebe6cSStefan Roese		cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
54494aebe6cSStefan Roese
5456d6c0baeSTom Warrenifneq ($(CONFIG_TEGRA),)
5469972db5cSStephen Warren$(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
547e4ec9346SStephen Warren		$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
5489972db5cSStephen Warren		cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
549e4ec9346SStephen Warren		rm $(obj)spl/u-boot-spl-pad.bin
5509972db5cSStephen Warren
5519972db5cSStephen Warrenifeq ($(CONFIG_OF_SEPARATE),y)
5529972db5cSStephen Warren$(obj)u-boot-dtb-tegra.bin: $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb
5539972db5cSStephen Warren		cat $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb > $@
5549972db5cSStephen Warrenendif
555984df4ecSAllen Martinendif
556984df4ecSAllen Martin
557fb3d2b8aSStefan Roese$(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
558fb3d2b8aSStefan Roese		cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
559fb3d2b8aSStefan Roese
560ecddccd0SStefan Roese# PPC4xx needs the SPL at the end of the image, since the reset vector
561ecddccd0SStefan Roese# is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
562ecddccd0SStefan Roese# and need to introduce a new build target with the full blown U-Boot
563ecddccd0SStefan Roese# at the start padded up to the start of the SPL image. And then concat
564ecddccd0SStefan Roese# the SPL image to the end.
565ecddccd0SStefan Roese$(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
566ecddccd0SStefan Roese		tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_UBOOT_PAD_TO) \
567ecddccd0SStefan Roese			of=$(obj)u-boot-pad.img 2>/dev/null
568ecddccd0SStefan Roese		dd if=$(obj)u-boot.img of=$(obj)u-boot-pad.img \
569ecddccd0SStefan Roese			conv=notrunc 2>/dev/null
570ecddccd0SStefan Roese		cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@
571ecddccd0SStefan Roese
57286eb49b3SSimon Glassifeq ($(CONFIG_SANDBOX),y)
57386eb49b3SSimon GlassGEN_UBOOT = \
57486eb49b3SSimon Glass		cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
57586eb49b3SSimon Glass			-Wl,--start-group $(__LIBS) -Wl,--end-group \
57686eb49b3SSimon Glass			$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
57786eb49b3SSimon Glasselse
578ecb1dc89SMike FrysingerGEN_UBOOT = \
57997b24d3dSMarek Vasut		cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
580ef123c52SAlbert ARIBAUD			$(__OBJS) \
581f9328639SMarian Balakowicz			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
582b2184c31Swdenk			-Map u-boot.map -o u-boot
58386eb49b3SSimon Glassendif
58486eb49b3SSimon Glass
58516a354f9SWolfgang Denk$(obj)u-boot:	depend \
586349e83f0SChe-liang Chiou		$(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
587ecb1dc89SMike Frysinger		$(GEN_UBOOT)
588ecb1dc89SMike Frysingerifeq ($(CONFIG_KALLSYMS),y)
5898a156fb6SMike Frysinger		smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
5901aada9cdSWolfgang Denk			awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
5911aada9cdSWolfgang Denk		$(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
5921aada9cdSWolfgang Denk			-c common/system_map.c -o $(obj)common/system_map.o
593ecb1dc89SMike Frysinger		$(GEN_UBOOT) $(obj)common/system_map.o
594ecb1dc89SMike Frysingerendif
5957ebf7443Swdenk
596d0d6144eSPeter Tyser$(OBJS):	depend
59703b7004dSPeter Tyser		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
598f9328639SMarian Balakowicz
599349e83f0SChe-liang Chiou$(LIBS):	depend $(SUBDIR_TOOLS)
600f9328639SMarian Balakowicz		$(MAKE) -C $(dir $(subst $(obj),,$@))
601a8c7c708Swdenk
602d0d6144eSPeter Tyser$(LIBBOARD):	depend $(LIBS)
603de109d90SWolfgang Denk		$(MAKE) -C $(dir $(subst $(obj),,$@))
604de109d90SWolfgang Denk
605d0d6144eSPeter Tyser$(SUBDIRS):	depend
606b028f715Swdenk		$(MAKE) -C $@ all
6077ebf7443Swdenk
608349e83f0SChe-liang Chiou$(SUBDIR_EXAMPLES): $(obj)u-boot
609349e83f0SChe-liang Chiou
610d0d6144eSPeter Tyser$(LDSCRIPT):	depend
611f65c9812SMike Frysinger		$(MAKE) -C $(dir $@) $(notdir $@)
612f65c9812SMike Frysinger
613ef123c52SAlbert ARIBAUD$(obj)u-boot.lds: $(LDSCRIPT)
61497b24d3dSMarek Vasut		$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
6151aada9cdSWolfgang Denk
616e935a374SHaiying Wangnand_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
6178318fbf8SMarian Balakowicz		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
618887e2ec9SStefan Roese
619e935a374SHaiying Wang$(obj)u-boot-nand.bin:	nand_spl $(obj)u-boot.bin
6208318fbf8SMarian Balakowicz		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
621887e2ec9SStefan Roese
622bd25fdbaSAneesh V$(obj)spl/u-boot-spl.bin:	$(SUBDIR_TOOLS) depend
6235df2ee27SDaniel Schwierzeck		$(MAKE) -C spl all
6245df2ee27SDaniel Schwierzeck
625f9328639SMarian Balakowiczupdater:
6260358df42SMike Frysinger		$(MAKE) -C tools/updater all
6278f713fdfSdzu
6282a998793SDaniel Hobi# Explicitly make _depend in subdirs containing multiple targets to prevent
6292a998793SDaniel Hobi# parallel sub-makes creating .depend files simultaneously.
63016a354f9SWolfgang Denkdepend dep:	$(TIMESTAMP_FILE) $(VERSION_FILE) \
63116a354f9SWolfgang Denk		$(obj)include/autoconf.mk \
632a4814a69SStefano Babic		$(obj)include/generated/generic-asm-offsets.h \
633a4814a69SStefano Babic		$(obj)include/generated/asm-offsets.h
634ee60197eSSimon Glass		for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ; do \
6352a998793SDaniel Hobi			$(MAKE) -C $$dir _depend ; done
6367ebf7443Swdenk
637e5e4e705SLi YangTAG_SUBDIRS = $(SUBDIRS)
638e5e4e705SLi YangTAG_SUBDIRS += $(dir $(__LIBS))
639a340c325SJean-Christophe PLAGNIOL-VILLARDTAG_SUBDIRS += include
640a340c325SJean-Christophe PLAGNIOL-VILLARD
641857d9ea6SHorst KronstorferFIND := find
642857d9ea6SHorst KronstorferFINDFLAGS := -L
643857d9ea6SHorst Kronstorfer
6441064d980STom Rinicheckstack:
6451064d980STom Rini		$(CROSS_COMPILE)objdump -d $(obj)u-boot \
6461064d980STom Rini			`$(FIND) $(obj) -name u-boot-spl -print` | \
6471064d980STom Rini			perl $(src)tools/checkstack.pl $(ARCH)
6481064d980STom Rini
649f9328639SMarian Balakowicztags ctags:
650857d9ea6SHorst Kronstorfer		ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
651e5e4e705SLi Yang						-name '*.[chS]' -print`
6527ebf7443Swdenk
6537ebf7443Swdenketags:
654857d9ea6SHorst Kronstorfer		etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
655e5e4e705SLi Yang						-name '*.[chS]' -print`
656ffda586fSLi Yangcscope:
657857d9ea6SHorst Kronstorfer		$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
658857d9ea6SHorst Kronstorfer						cscope.files
659ffda586fSLi Yang		cscope -b -q -k
6607ebf7443Swdenk
661ecb1dc89SMike FrysingerSYSTEM_MAP = \
662ecb1dc89SMike Frysinger		$(NM) $1 | \
6637ebf7443Swdenk		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
664ecb1dc89SMike Frysinger		LC_ALL=C sort
665ecb1dc89SMike Frysinger$(obj)System.map:	$(obj)u-boot
666ecb1dc89SMike Frysinger		@$(call SYSTEM_MAP,$<) > $(obj)System.map
6677ebf7443Swdenk
66806a119a0STom Rinicheckthumb:
66906a119a0STom Rini	@if test $(call cc-version) -lt 0404; then \
67006a119a0STom Rini		echo -n '*** Your GCC does not produce working '; \
67106a119a0STom Rini		echo 'binaries in THUMB mode.'; \
67206a119a0STom Rini		echo '*** Your board is configured for THUMB mode.'; \
67306a119a0STom Rini		false; \
67406a119a0STom Rini	fi
6756ec63f41SScott Wood
6766ec63f41SScott Wood# GCC 3.x is reported to have problems generating the type of relocation
6776ec63f41SScott Wood# that U-Boot wants.
6786ec63f41SScott Wood# See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html
6796ec63f41SScott Woodcheckgcc4:
6806ec63f41SScott Wood	@if test $(call cc-version) -lt 0400; then \
6816ec63f41SScott Wood		echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \
6826ec63f41SScott Wood		false; \
6836ec63f41SScott Wood	fi
6846ec63f41SScott Wood
6852f155f6cSGrant Likely#
6862f155f6cSGrant Likely# Auto-generate the autoconf.mk file (which is included by all makefiles)
6872f155f6cSGrant Likely#
6882f155f6cSGrant Likely# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
6892f155f6cSGrant Likely# the dep file is only include in this top level makefile to determine when
6902f155f6cSGrant Likely# to regenerate the autoconf.mk file.
6911510b82dSWolfgang Denk$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
6921510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
69316fe7775SMike Frysinger	set -e ; \
694ae6d1056SWolfgang Denk	: Generate the dependancies ; \
6954c34b2a0SMike Frysinger	$(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
6961510b82dSWolfgang Denk		-MQ $(obj)include/autoconf.mk include/common.h > $@
6971510b82dSWolfgang Denk
6981510b82dSWolfgang Denk$(obj)include/autoconf.mk: $(obj)include/config.h
6991510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
7001510b82dSWolfgang Denk	set -e ; \
701ae6d1056SWolfgang Denk	: Extract the config macros ; \
7021510b82dSWolfgang Denk	$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
7034a0f7538SWolfgang Denk		sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
7044a0f7538SWolfgang Denk	mv $@.tmp $@
7052f155f6cSGrant Likely
70616a354f9SWolfgang Denk$(obj)include/generated/generic-asm-offsets.h:	$(obj)include/autoconf.mk.dep \
70716a354f9SWolfgang Denk	$(obj)lib/asm-offsets.s
70816a354f9SWolfgang Denk	@$(XECHO) Generating $@
70916a354f9SWolfgang Denk	tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
71016a354f9SWolfgang Denk
71116a354f9SWolfgang Denk$(obj)lib/asm-offsets.s:	$(obj)include/autoconf.mk.dep \
71216a354f9SWolfgang Denk	$(src)lib/asm-offsets.c
71316a354f9SWolfgang Denk	@mkdir -p $(obj)lib
71416a354f9SWolfgang Denk	$(CC) -DDO_DEPS_ONLY \
71516a354f9SWolfgang Denk		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
71616a354f9SWolfgang Denk		-o $@ $(src)lib/asm-offsets.c -c -S
71716a354f9SWolfgang Denk
718a4814a69SStefano Babic$(obj)include/generated/asm-offsets.h:	$(obj)include/autoconf.mk.dep \
719a4814a69SStefano Babic	$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
720b12734eeSWolfgang Denk	@$(XECHO) Generating $@
721a4814a69SStefano Babic	tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
722a4814a69SStefano Babic
723a4814a69SStefano Babic$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s:	$(obj)include/autoconf.mk.dep
724a4814a69SStefano Babic	@mkdir -p $(obj)$(CPUDIR)/$(SOC)
725a4814a69SStefano Babic	if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
726a4814a69SStefano Babic		$(CC) -DDO_DEPS_ONLY \
727a4814a69SStefano Babic		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
728a4814a69SStefano Babic			-o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
729a4814a69SStefano Babic	else \
730a4814a69SStefano Babic		touch $@; \
731a4814a69SStefano Babic	fi
732a4814a69SStefano Babic
7337ebf7443Swdenk#########################################################################
734ae6d1056SWolfgang Denkelse	# !config.mk
735f9328639SMarian Balakowiczall $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
736f9328639SMarian Balakowicz$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
737249b53a6SLoïc Minier$(filter-out tools,$(SUBDIRS)) \
7380358df42SMike Frysingerupdater depend dep tags ctags etags cscope $(obj)System.map:
7397ebf7443Swdenk	@echo "System not configured - see README" >&2
7407ebf7443Swdenk	@ exit 1
741c7c0d542SMike Frysinger
742249b53a6SLoïc Miniertools: $(VERSION_FILE) $(TIMESTAMP_FILE)
7430358df42SMike Frysinger	$(MAKE) -C $@ all
744ae6d1056SWolfgang Denkendif	# config.mk
7457ebf7443Swdenk
746*c37980c3SAlbert ARIBAUD# ARM relocations should all be R_ARM_RELATIVE.
747*c37980c3SAlbert ARIBAUDcheckarmreloc: $(obj)u-boot
748*c37980c3SAlbert ARIBAUD	@if test "R_ARM_RELATIVE" != \
749*c37980c3SAlbert ARIBAUD		"`readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \
750*c37980c3SAlbert ARIBAUD		then echo "$< contains relocations other than \
751*c37980c3SAlbert ARIBAUD		R_ARM_RELATIVE"; false; fi
752*c37980c3SAlbert ARIBAUD
75328abd48fSIlya Yanok$(VERSION_FILE):
75414ce91b1SMike Frysinger		@mkdir -p $(dir $(VERSION_FILE))
75528abd48fSIlya Yanok		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
75628abd48fSIlya Yanok		   printf '#define PLAIN_VERSION "%s%s"\n' \
75728abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
75828abd48fSIlya Yanok		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
75928abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
76028abd48fSIlya Yanok		) > $@.tmp
76128abd48fSIlya Yanok		@( printf '#define CC_VERSION_STRING "%s"\n' \
76228abd48fSIlya Yanok		 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp
76328abd48fSIlya Yanok		@( printf '#define LD_VERSION_STRING "%s"\n' \
76428abd48fSIlya Yanok		 '$(shell $(LD) -v | head -n 1)' )>>  $@.tmp
76528abd48fSIlya Yanok		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
76628abd48fSIlya Yanok
767249b53a6SLoïc Minier$(TIMESTAMP_FILE):
768249b53a6SLoïc Minier		@mkdir -p $(dir $(TIMESTAMP_FILE))
769a76406fbSLoïc Minier		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp
770a76406fbSLoïc Minier		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
771a76406fbSLoïc Minier		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
772249b53a6SLoïc Minier
7730358df42SMike Frysingereasylogo env gdb:
7740358df42SMike Frysinger	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
7750358df42SMike Frysingergdbtools: gdb
7760358df42SMike Frysinger
77730ff8918SMarek Vasutxmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
77830ff8918SMarek Vasut	$(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
77930ff8918SMarek Vasut
780249b53a6SLoïc Miniertools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
7810358df42SMike Frysinger	$(MAKE) -C tools HOST_TOOLS_ALL=y
7820358df42SMike Frysinger
7834e53a258SWolfgang Denk.PHONY : CHANGELOG
7844e53a258SWolfgang DenkCHANGELOG:
785b985b5d6SBen Warren	git log --no-merges U-Boot-1_1_5.. | \
786b985b5d6SBen Warren	unexpand -a | sed -e 's/\s\s*$$//' > $@
7874e53a258SWolfgang Denk
7880a823aa2SHarald Welteinclude/license.h: tools/bin2header COPYING
7890a823aa2SHarald Welte	cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
7907ebf7443Swdenk#########################################################################
7917ebf7443Swdenk
7927ebf7443Swdenkunconfig:
793887e2ec9SStefan Roese	@rm -f $(obj)include/config.h $(obj)include/config.mk \
7942f155f6cSGrant Likely		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
7952f155f6cSGrant Likely		$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
7967ebf7443Swdenk
797a6862bc1SWolfgang Denk%_config::	unconfig
798a6862bc1SWolfgang Denk	@$(MKCONFIG) -A $(@:_config=)
799a6862bc1SWolfgang Denk
800d6a5e6d5SLoïc Miniersinclude $(obj).boards.depend
801d6a5e6d5SLoïc Minier$(obj).boards.depend:	boards.cfg
80237d0e777SLauri Hintsala	@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
8039f4a4206SMike Frysinger
8048c994630SWolfgang Denk#
8058c994630SWolfgang Denk# Functions to generate common board directory names
8068c994630SWolfgang Denk#
8078c994630SWolfgang Denklcname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/')
8088c994630SWolfgang Denkucname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
8098c994630SWolfgang Denk
810699f0512SWolfgang Denk#########################################################################
8113e38691eSwdenk#########################################################################
8127ebf7443Swdenk
8137ebf7443Swdenkclean:
8141bc15386SPeter Tyser	@rm -f $(obj)examples/standalone/82559_eeprom			  \
815d640ac58SWolfgang Denk	       $(obj)examples/standalone/atmel_df_pow2			  \
8161bc15386SPeter Tyser	       $(obj)examples/standalone/eepro100_eeprom		  \
8171bc15386SPeter Tyser	       $(obj)examples/standalone/hello_world			  \
8181bc15386SPeter Tyser	       $(obj)examples/standalone/interrupt			  \
8191bc15386SPeter Tyser	       $(obj)examples/standalone/mem_to_mem_idma2intr		  \
8201bc15386SPeter Tyser	       $(obj)examples/standalone/sched				  \
821201a017cSMike Frysinger	       $(obj)examples/standalone/smc911{11,x}_eeprom		  \
8221bc15386SPeter Tyser	       $(obj)examples/standalone/test_burst			  \
8231bc15386SPeter Tyser	       $(obj)examples/standalone/timer
824d4abc757SPeter Tyser	@rm -f $(obj)examples/api/demo{,.bin}
825f9301e1cSWolfgang Denk	@rm -f $(obj)tools/bmp_logo	   $(obj)tools/easylogo/easylogo  \
826f9301e1cSWolfgang Denk	       $(obj)tools/env/{fw_printenv,fw_setenv}			  \
827f9301e1cSWolfgang Denk	       $(obj)tools/envcrc					  \
828f9301e1cSWolfgang Denk	       $(obj)tools/gdb/{astest,gdbcont,gdbsend}			  \
829f9301e1cSWolfgang Denk	       $(obj)tools/gen_eth_addr    $(obj)tools/img2srec		  \
8307717fe10SHorst Kronstorfer	       $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk	  \
83181e35203SChander Kashyap	       $(obj)tools/mk{smdk5250,}spl				  \
8328aa09026SMarek Vasut	       $(obj)tools/mxsboot					  \
83330ff8918SMarek Vasut	       $(obj)tools/ncb		   $(obj)tools/ubsha1		  \
83430ff8918SMarek Vasut	       $(obj)tools/kernel-doc/docproc
835f9301e1cSWolfgang Denk	@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}	  \
83674c7a95fSWolfgang Denk	       $(obj)board/matrix_vision/*/bootscript.img		  \
837566e5cf4SWolfgang Denk	       $(obj)board/voiceblue/eeprom 				  \
8381aada9cdSWolfgang Denk	       $(obj)u-boot.lds						  \
839fb5166ceSMike Frysinger	       $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]	  \
840fb5166ceSMike Frysinger	       $(obj)arch/blackfin/cpu/init.{lds,elf}
841dc7746d8SWolfgang Denk	@rm -f $(obj)include/bmp_logo.h
842c270730fSChe-Liang Chiou	@rm -f $(obj)include/bmp_logo_data.h
84316a354f9SWolfgang Denk	@rm -f $(obj)lib/asm-offsets.s
844a4814a69SStefano Babic	@rm -f $(obj)include/generated/asm-offsets.h
845a4814a69SStefano Babic	@rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
846d4abc757SPeter Tyser	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
847b3141fdbSAndreas Bießmann	@$(MAKE) -s -C doc/DocBook/ cleandocs
848ae6d1056SWolfgang Denk	@find $(OBJTREE) -type f \
8494a30f1e8STom Rini		\( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
85071a988aaSTroy Kisky		-o -name '*.o'	-o -name '*.a' -o -name '*.exe' \
85171a988aaSTroy Kisky		-o -name '*.cfgtmp' \) -print \
8527ebf7443Swdenk		| xargs rm -f
8537ebf7443Swdenk
854734329f9SAndy Fleming# Removes everything not needed for testing u-boot
855734329f9SAndy Flemingtidy:	clean
856734329f9SAndy Fleming	@find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
857734329f9SAndy Fleming
858734329f9SAndy Flemingclobber:	tidy
859734329f9SAndy Fleming	@find $(OBJTREE) -type f \( -name '*.srec' \
860734329f9SAndy Fleming		-o -name '*.bin' -o -name u-boot.img \) \
861734329f9SAndy Fleming		-print0 | xargs -0 rm -f
862ffda586fSLi Yang	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
8635013c09fSWolfgang Denk		$(obj)cscope.* $(obj)*.*~
8644e0fbb98SDaniel Schwierzeck	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
865aa0c7a86SPrafulla Wadaskar	@rm -f $(obj)u-boot.kwb
8665d898a00SShaohui Xie	@rm -f $(obj)u-boot.pbl
867c5fb70c9SStefano Babic	@rm -f $(obj)u-boot.imx
868ba597609SBenoît Thébaudeau	@rm -f $(obj)u-boot-with-spl.imx
8697d5a5c79SBenoît Thébaudeau	@rm -f $(obj)u-boot-with-nand-spl.imx
8707816f2cfSHeiko Schocher	@rm -f $(obj)u-boot.ubl
871d36d8859SChristian Riesch	@rm -f $(obj)u-boot.ais
872bbb0b128SSimon Glass	@rm -f $(obj)u-boot.dtb
87330b9b932SMarek Vasut	@rm -f $(obj)u-boot.sb
874714dc001SMarek Vasut	@rm -f $(obj)u-boot.bd
87594aebe6cSStefan Roese	@rm -f $(obj)u-boot.spr
87697b24d3dSMarek Vasut	@rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map}
87797b24d3dSMarek Vasut	@rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map}
87897b24d3dSMarek Vasut	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map}
879ef123c52SAlbert ARIBAUD	@rm -f $(obj)spl/u-boot-spl.lds
88094bcfe52SNishanth Menon	@rm -f $(obj)MLO MLO.byteswap
881a3cbc396SStefano Babic	@rm -f $(obj)SPL
8828b425b3fSDaniel Schwierzeck	@rm -f $(obj)tools/xway-swap-bytes
883a47a12beSStefan Roese	@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
8842d14e36aSYork Sun	@rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
885a9d8bc98SLoïc Minier	@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
88616a354f9SWolfgang Denk	@rm -fr $(obj)include/generated
887a958b663SJean-Christophe PLAGNIOL-VILLARD	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
888bbb0b128SSimon Glass	@rm -f $(obj)dts/*.tmp
8896d660e77SSughosh Ganu	@rm -f $(obj)spl/u-boot-spl{,-pad}.ais
8907ebf7443Swdenk
8917ebf7443Swdenkmrproper \
8927ebf7443Swdenkdistclean:	clobber unconfig
893afd077bdSMike Frysingerifneq ($(OBJTREE),$(SRCTREE))
894ae6d1056SWolfgang Denk	rm -rf $(obj)*
895f9328639SMarian Balakowiczendif
8967ebf7443Swdenk
8977ebf7443Swdenkbackup:
8987ebf7443Swdenk	F=`basename $(TOPDIR)` ; cd .. ; \
899d6b93714SIlya Yanok	gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
9007ebf7443Swdenk
9017ebf7443Swdenk#########################################################################
902