xref: /openbmc/u-boot/Makefile (revision bbb0b128c3956ac549471addc314702fbe0ace63)
17ebf7443Swdenk#
2b1af6f53SWolfgang Denk# (C) Copyright 2000-2011
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
2442d44f63SWolfgang DenkVERSION = 2011
256ceb0135SWolfgang DenkPATCHLEVEL = 09
268b9e4787SWolfgang DenkSUBLEVEL =
271d5e7fb4SWolfgang DenkEXTRAVERSION =
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
49cf7a7b99SPeter Tyser# Set shell to bash if possible, otherwise fall back to sh
50cf7a7b99SPeter TyserSHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
51cf7a7b99SPeter Tyser	else if [ -x /bin/bash ]; then echo /bin/bash; \
52cf7a7b99SPeter Tyser	else echo sh; fi; fi)
53cf7a7b99SPeter Tyser
54cf7a7b99SPeter Tyserexport	HOSTARCH HOSTOS SHELL
557ebf7443Swdenk
567ebf7443Swdenk# Deal with colliding definitions from tcsh etc.
577ebf7443SwdenkVENDOR=
587ebf7443Swdenk
597ebf7443Swdenk#########################################################################
60ae6d1056SWolfgang Denk# Allow for silent builds
61ae6d1056SWolfgang Denkifeq (,$(findstring s,$(MAKEFLAGS)))
62ae6d1056SWolfgang DenkXECHO = echo
63ae6d1056SWolfgang Denkelse
64ae6d1056SWolfgang DenkXECHO = :
65ae6d1056SWolfgang Denkendif
66ae6d1056SWolfgang Denk
67ae6d1056SWolfgang Denk#########################################################################
68f9328639SMarian Balakowicz#
69f9328639SMarian Balakowicz# U-boot build supports producing a object files to the separate external
70f9328639SMarian Balakowicz# directory. Two use cases are supported:
71f9328639SMarian Balakowicz#
72f9328639SMarian Balakowicz# 1) Add O= to the make command line
73f9328639SMarian Balakowicz# 'make O=/tmp/build all'
74f9328639SMarian Balakowicz#
75f9328639SMarian Balakowicz# 2) Set environement variable BUILD_DIR to point to the desired location
76f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
77f9328639SMarian Balakowicz# 'make'
78f9328639SMarian Balakowicz#
79f9328639SMarian Balakowicz# The second approach can also be used with a MAKEALL script
80f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
81f9328639SMarian Balakowicz# './MAKEALL'
82f9328639SMarian Balakowicz#
83f9328639SMarian Balakowicz# Command line 'O=' setting overrides BUILD_DIR environent variable.
84f9328639SMarian Balakowicz#
85f9328639SMarian Balakowicz# When none of the above methods is used the local build is performed and
86f9328639SMarian Balakowicz# the object files are placed in the source directory.
87f9328639SMarian Balakowicz#
887ebf7443Swdenk
89f9328639SMarian Balakowiczifdef O
90f9328639SMarian Balakowiczifeq ("$(origin O)", "command line")
91f9328639SMarian BalakowiczBUILD_DIR := $(O)
92f9328639SMarian Balakowiczendif
93f9328639SMarian Balakowiczendif
947ebf7443Swdenk
95f9328639SMarian Balakowiczifneq ($(BUILD_DIR),)
96f9328639SMarian Balakowiczsaved-output := $(BUILD_DIR)
974f0645ebSMarian Balakowicz
984f0645ebSMarian Balakowicz# Attempt to create a output directory.
994f0645ebSMarian Balakowicz$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
1004f0645ebSMarian Balakowicz
1014f0645ebSMarian Balakowicz# Verify if it was successful.
102f9328639SMarian BalakowiczBUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
103f9328639SMarian Balakowicz$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
104f9328639SMarian Balakowiczendif # ifneq ($(BUILD_DIR),)
105f9328639SMarian Balakowicz
106f9328639SMarian BalakowiczOBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
107c8f9c302SDaniel SchwierzeckSPLTREE		:= $(OBJTREE)/spl
108f9328639SMarian BalakowiczSRCTREE		:= $(CURDIR)
109f9328639SMarian BalakowiczTOPDIR		:= $(SRCTREE)
110f9328639SMarian BalakowiczLNDIR		:= $(OBJTREE)
111c8f9c302SDaniel Schwierzeckexport	TOPDIR SRCTREE OBJTREE SPLTREE
112f9328639SMarian Balakowicz
113f9328639SMarian BalakowiczMKCONFIG	:= $(SRCTREE)/mkconfig
114f9328639SMarian Balakowiczexport MKCONFIG
115f9328639SMarian Balakowicz
116f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
117f9328639SMarian BalakowiczREMOTE_BUILD	:= 1
118f9328639SMarian Balakowiczexport REMOTE_BUILD
119f9328639SMarian Balakowiczendif
120f9328639SMarian Balakowicz
121f9328639SMarian Balakowicz# $(obj) and (src) are defined in config.mk but here in main Makefile
122f9328639SMarian Balakowicz# we also need them before config.mk is included which is the case for
123f9328639SMarian Balakowicz# some targets like unconfig, clean, clobber, distclean, etc.
124f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
125f9328639SMarian Balakowiczobj := $(OBJTREE)/
126f9328639SMarian Balakowiczsrc := $(SRCTREE)/
127f9328639SMarian Balakowiczelse
128f9328639SMarian Balakowiczobj :=
129f9328639SMarian Balakowiczsrc :=
130f9328639SMarian Balakowiczendif
131f9328639SMarian Balakowiczexport obj src
132f9328639SMarian Balakowicz
1335013c09fSWolfgang Denk# Make sure CDPATH settings don't interfere
1345013c09fSWolfgang Denkunexport CDPATH
1355013c09fSWolfgang Denk
136f9328639SMarian Balakowicz#########################################################################
137f9328639SMarian Balakowicz
1386d1ce387SMike Frysinger# The "tools" are needed early, so put this first
1396d1ce387SMike Frysinger# Don't include stuff already done in $(LIBS)
140349e83f0SChe-liang Chiou# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
141349e83f0SChe-liang Chiou# is "yes"), so compile examples after U-Boot is compiled.
142349e83f0SChe-liang ChiouSUBDIR_TOOLS = tools
143349e83f0SChe-liang ChiouSUBDIR_EXAMPLES = examples/standalone examples/api
144349e83f0SChe-liang ChiouSUBDIRS = $(SUBDIR_TOOLS)
145349e83f0SChe-liang Chiouifndef CONFIG_SANDBOX
146349e83f0SChe-liang ChiouSUBDIRS += $(SUBDIR_EXAMPLES)
147349e83f0SChe-liang Chiouendif
1486d1ce387SMike Frysinger
149249b53a6SLoïc Minier.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
1506d1ce387SMike Frysinger
151ae6d1056SWolfgang Denkifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
152f9328639SMarian Balakowicz
1532632c008SMike Frysinger# Include autoconf.mk before config.mk so that the config options are available
1542632c008SMike Frysinger# to all top level build files.  We need the dummy all: target to prevent the
1552632c008SMike Frysinger# dependency target in autoconf.mk.dep from being the default.
1562632c008SMike Frysingerall:
1572632c008SMike Frysingersinclude $(obj)include/autoconf.mk.dep
1582632c008SMike Frysingersinclude $(obj)include/autoconf.mk
1592632c008SMike Frysinger
1607ebf7443Swdenk# load ARCH, BOARD, and CPU configuration
161ae6d1056SWolfgang Denkinclude $(obj)include/config.mk
1621d9f4105Swdenkexport	ARCH CPU BOARD VENDOR SOC
163f9328639SMarian Balakowicz
1641ea6bcd8SMike Frysinger# set default to nothing for native builds
165a5284efdSWolfgang Denkifeq ($(HOSTARCH),$(ARCH))
1661ea6bcd8SMike FrysingerCROSS_COMPILE ?=
1677ebf7443Swdenkendif
1687ebf7443Swdenk
16992b197f0SWolfgang Denk# load other configuration
17092b197f0SWolfgang Denkinclude $(TOPDIR)/config.mk
17192b197f0SWolfgang Denk
172d51dfff7SIlya Yanok# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
173d51dfff7SIlya Yanok# that (or fail if absent).  Otherwise, search for a linker script in a
174d51dfff7SIlya Yanok# standard location.
175d51dfff7SIlya Yanok
176d51dfff7SIlya Yanokifndef LDSCRIPT
177d51dfff7SIlya Yanok	#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
178d51dfff7SIlya Yanok	ifdef CONFIG_SYS_LDSCRIPT
179d51dfff7SIlya Yanok		# need to strip off double quotes
180d51dfff7SIlya Yanok		LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
181d51dfff7SIlya Yanok	endif
182d51dfff7SIlya Yanokendif
183d51dfff7SIlya Yanok
184d51dfff7SIlya Yanokifndef LDSCRIPT
185d51dfff7SIlya Yanok	ifeq ($(CONFIG_NAND_U_BOOT),y)
186d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
187d51dfff7SIlya Yanok		ifeq ($(wildcard $(LDSCRIPT)),)
188d51dfff7SIlya Yanok			LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
189d51dfff7SIlya Yanok		endif
190d51dfff7SIlya Yanok	endif
191d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
192d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
193d51dfff7SIlya Yanok	endif
194d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
195d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
196d51dfff7SIlya Yanok	endif
197d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
198d51dfff7SIlya Yanok$(error could not find linker script)
199d51dfff7SIlya Yanok	endif
200d51dfff7SIlya Yanokendif
201d51dfff7SIlya Yanok
2027ebf7443Swdenk#########################################################################
2037ebf7443Swdenk# U-Boot objects....order is important (i.e. start must be first)
2047ebf7443Swdenk
20503b7004dSPeter TyserOBJS  = $(CPUDIR)/start.o
206fea25720SGraeme Russifeq ($(CPU),x86)
20703b7004dSPeter TyserOBJS += $(CPUDIR)/start16.o
20803b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
2092262cfeeSwdenkendif
2107ebf7443Swdenkifeq ($(CPU),ppc4xx)
21103b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
2127ebf7443Swdenkendif
21342d1f039Swdenkifeq ($(CPU),mpc85xx)
21403b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
21542d1f039Swdenkendif
2167ebf7443Swdenk
217f9328639SMarian BalakowiczOBJS := $(addprefix $(obj),$(OBJS))
218f9328639SMarian Balakowicz
2196d8962e8SSebastien CarlierLIBS  = lib/libgeneric.o
2206d8962e8SSebastien CarlierLIBS += lib/lzma/liblzma.o
2216d8962e8SSebastien CarlierLIBS += lib/lzo/liblzo.o
222e89516f0SMike FrysingerLIBS += lib/zlib/libz.o
2237608d75fSKim PhillipsLIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
2246d8962e8SSebastien Carlier	"board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
2256d8962e8SSebastien CarlierLIBS += $(CPUDIR)/lib$(CPU).o
2261d9f4105Swdenkifdef SOC
2276d8962e8SSebastien CarlierLIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o
2281d9f4105Swdenkendif
229323bfa8fSStefan Roeseifeq ($(CPU),ixp)
2306d8962e8SSebastien CarlierLIBS += arch/arm/cpu/ixp/npe/libnpe.o
231323bfa8fSStefan Roeseendif
232*bbb0b128SSimon Glassifeq ($(CONFIG_OF_EMBED),y)
233*bbb0b128SSimon GlassLIBS += dts/libdts.o
234*bbb0b128SSimon Glassendif
2356d8962e8SSebastien CarlierLIBS += arch/$(ARCH)/lib/lib$(ARCH).o
2366d8962e8SSebastien CarlierLIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \
2376d8962e8SSebastien Carlier	fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \
2386d8962e8SSebastien Carlier	fs/ubifs/libubifs.o
2396d8962e8SSebastien CarlierLIBS += net/libnet.o
2406d8962e8SSebastien CarlierLIBS += disk/libdisk.o
2416d8962e8SSebastien CarlierLIBS += drivers/bios_emulator/libatibiosemu.o
2426d8962e8SSebastien CarlierLIBS += drivers/block/libblock.o
2436d8962e8SSebastien CarlierLIBS += drivers/dma/libdma.o
2446d8962e8SSebastien CarlierLIBS += drivers/fpga/libfpga.o
2456d8962e8SSebastien CarlierLIBS += drivers/gpio/libgpio.o
2466d8962e8SSebastien CarlierLIBS += drivers/hwmon/libhwmon.o
2476d8962e8SSebastien CarlierLIBS += drivers/i2c/libi2c.o
2486d8962e8SSebastien CarlierLIBS += drivers/input/libinput.o
2496d8962e8SSebastien CarlierLIBS += drivers/misc/libmisc.o
2506d8962e8SSebastien CarlierLIBS += drivers/mmc/libmmc.o
2516d8962e8SSebastien CarlierLIBS += drivers/mtd/libmtd.o
2526d8962e8SSebastien CarlierLIBS += drivers/mtd/nand/libnand.o
2536d8962e8SSebastien CarlierLIBS += drivers/mtd/onenand/libonenand.o
2546d8962e8SSebastien CarlierLIBS += drivers/mtd/ubi/libubi.o
2556d8962e8SSebastien CarlierLIBS += drivers/mtd/spi/libspi_flash.o
2566d8962e8SSebastien CarlierLIBS += drivers/net/libnet.o
2576d8962e8SSebastien CarlierLIBS += drivers/net/phy/libphy.o
2586d8962e8SSebastien CarlierLIBS += drivers/pci/libpci.o
2596d8962e8SSebastien CarlierLIBS += drivers/pcmcia/libpcmcia.o
2606d8962e8SSebastien CarlierLIBS += drivers/power/libpower.o
2616d8962e8SSebastien CarlierLIBS += drivers/spi/libspi.o
2627737d5c6SDave Liuifeq ($(CPU),mpc83xx)
2636d8962e8SSebastien CarlierLIBS += drivers/qe/libqe.o
264d29d17d7SYork SunLIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
2656d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
2667737d5c6SDave Liuendif
267da9d4610SAndy Flemingifeq ($(CPU),mpc85xx)
2686d8962e8SSebastien CarlierLIBS += drivers/qe/libqe.o
269c916d7c9SKumar GalaLIBS += drivers/net/fm/libfm.o
2706d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
2716d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
27258e5e9afSKumar Galaendif
27358e5e9afSKumar Galaifeq ($(CPU),mpc86xx)
2746d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
2756d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
276da9d4610SAndy Flemingendif
2776d8962e8SSebastien CarlierLIBS += drivers/rtc/librtc.o
2786d8962e8SSebastien CarlierLIBS += drivers/serial/libserial.o
2796d8962e8SSebastien CarlierLIBS += drivers/twserial/libtws.o
280181f565cSMike FrysingerLIBS += drivers/usb/eth/libusb_eth.o
2816d8962e8SSebastien CarlierLIBS += drivers/usb/gadget/libusb_gadget.o
2826d8962e8SSebastien CarlierLIBS += drivers/usb/host/libusb_host.o
2836d8962e8SSebastien CarlierLIBS += drivers/usb/musb/libusb_musb.o
2846d8962e8SSebastien CarlierLIBS += drivers/usb/phy/libusb_phy.o
2856d8962e8SSebastien CarlierLIBS += drivers/video/libvideo.o
2866d8962e8SSebastien CarlierLIBS += drivers/watchdog/libwatchdog.o
2876d8962e8SSebastien CarlierLIBS += common/libcommon.o
2886d8962e8SSebastien CarlierLIBS += lib/libfdt/libfdt.o
2896d8962e8SSebastien CarlierLIBS += api/libapi.o
2906d8962e8SSebastien CarlierLIBS += post/libpost.o
291f9328639SMarian Balakowicz
292d34efc76SSteve Sakomanifeq ($(SOC),omap3)
2936d8962e8SSebastien CarlierLIBS += $(CPUDIR)/omap-common/libomap-common.o
294d34efc76SSteve Sakomanendif
295d34efc76SSteve Sakomanifeq ($(SOC),omap4)
2966d8962e8SSebastien CarlierLIBS += $(CPUDIR)/omap-common/libomap-common.o
297d34efc76SSteve Sakomanendif
298d34efc76SSteve Sakoman
299852bd07cSMinkyu Kangifeq ($(SOC),s5pc1xx)
3006d8962e8SSebastien CarlierLIBS += $(CPUDIR)/s5p-common/libs5p-common.o
301852bd07cSMinkyu Kangendif
302852bd07cSMinkyu Kangifeq ($(SOC),s5pc2xx)
3036d8962e8SSebastien CarlierLIBS += $(CPUDIR)/s5p-common/libs5p-common.o
304852bd07cSMinkyu Kangendif
305852bd07cSMinkyu Kang
306566d49a3SWolfgang DenkLIBS := $(addprefix $(obj),$(sort $(LIBS)))
307249b53a6SLoïc Minier.PHONY : $(LIBS)
308a8c7c708Swdenk
3096d8962e8SSebastien CarlierLIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
310de109d90SWolfgang DenkLIBBOARD := $(addprefix $(obj),$(LIBBOARD))
311de109d90SWolfgang Denk
3124f7cb08eSwdenk# Add GCC lib
31352b1bf2cSWolfgang Denkifdef USE_PRIVATE_LIBGCC
31452b1bf2cSWolfgang Denkifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
315635d1b3eSMatthias WeisserPLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
31652b1bf2cSWolfgang Denkelse
31752b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
31852b1bf2cSWolfgang Denkendif
31952b1bf2cSWolfgang Denkelse
32052b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
32152b1bf2cSWolfgang Denkendif
32252b1bf2cSWolfgang DenkPLATFORM_LIBS += $(PLATFORM_LIBGCC)
32352b1bf2cSWolfgang Denkexport PLATFORM_LIBS
3243d3befa7Swdenk
3256ac9f479SMike Frysinger# Special flags for CPP when processing the linker script.
3266ac9f479SMike Frysinger# Pass the version down so we can handle backwards compatibility
3276ac9f479SMike Frysinger# on the fly.
3286ac9f479SMike FrysingerLDPPFLAGS += \
3296ac9f479SMike Frysinger	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
3306ac9f479SMike Frysinger	$(shell $(LD) --version | \
3316ac9f479SMike Frysinger	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
3326ac9f479SMike Frysinger
333f9328639SMarian Balakowicz__OBJS := $(subst $(obj),,$(OBJS))
334de109d90SWolfgang Denk__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
335f9328639SMarian Balakowicz
3367ebf7443Swdenk#########################################################################
337bdccc4feSwdenk#########################################################################
3387ebf7443Swdenk
339f3a14d37SMike Frysingerifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
340f3a14d37SMike FrysingerBOARD_SIZE_CHECK = \
341f3a14d37SMike Frysinger	@actual=`wc -c $@ | awk '{print $$1}'`; \
342f3a14d37SMike Frysinger	limit=$(CONFIG_BOARD_SIZE_LIMIT); \
343f3a14d37SMike Frysinger	if test $$actual -gt $$limit; then \
344f3a14d37SMike Frysinger		echo "$@ exceeds file size limit:"; \
345f3a14d37SMike Frysinger		echo "  limit:  $$limit bytes"; \
346f3a14d37SMike Frysinger		echo "  actual: $$actual bytes"; \
347f3a14d37SMike Frysinger		echo "  excess: $$((actual - limit)) bytes"; \
348f3a14d37SMike Frysinger		exit 1; \
349f3a14d37SMike Frysinger	fi
350f3a14d37SMike Frysingerelse
351f3a14d37SMike FrysingerBOARD_SIZE_CHECK =
352f3a14d37SMike Frysingerendif
353f3a14d37SMike Frysinger
3543e88337bSMike Frysinger# Always append ALL so that arch config.mk's can add custom ones
3554e0fbb98SDaniel SchwierzeckALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
356e935a374SHaiying Wang
3574e0fbb98SDaniel SchwierzeckALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
3584e0fbb98SDaniel SchwierzeckALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
359e935a374SHaiying WangONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
3604e0fbb98SDaniel SchwierzeckALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
3615df2ee27SDaniel SchwierzeckALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
3627ebf7443Swdenk
363349e83f0SChe-liang Chiouall:		$(ALL-y) $(SUBDIR_EXAMPLES)
3647ebf7443Swdenk
365f9328639SMarian Balakowicz$(obj)u-boot.hex:	$(obj)u-boot
3666310eb9dSwdenk		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
3676310eb9dSwdenk
368f9328639SMarian Balakowicz$(obj)u-boot.srec:	$(obj)u-boot
3690817d688SRicardo Ribalda Delgado		$(OBJCOPY) -O srec $< $@
3707ebf7443Swdenk
371f9328639SMarian Balakowicz$(obj)u-boot.bin:	$(obj)u-boot
3727ebf7443Swdenk		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
373f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
3747ebf7443Swdenk
37594a91e24SMike Frysinger$(obj)u-boot.ldr:	$(obj)u-boot
37676d82187SMike Frysinger		$(CREATE_LDR_ENV)
37768e56324SMike Frysinger		$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
378f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
37994a91e24SMike Frysinger
38094a91e24SMike Frysinger$(obj)u-boot.ldr.hex:	$(obj)u-boot.ldr
38194a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
38294a91e24SMike Frysinger
38394a91e24SMike Frysinger$(obj)u-boot.ldr.srec:	$(obj)u-boot.ldr
38494a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
38594a91e24SMike Frysinger
386f9328639SMarian Balakowicz$(obj)u-boot.img:	$(obj)u-boot.bin
387a2a0a717SWolfgang Denk		$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
3883857f8f5Saneeshv		-O u-boot -a $(CONFIG_SYS_TEXT_BASE) -e 0 \
389881a87ecSWolfgang Denk		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
390bdccc4feSwdenk			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
391bdccc4feSwdenk		-d $< $@
392bdccc4feSwdenk
3938edcde5eSStefano Babic$(obj)u-boot.imx:       $(obj)u-boot.bin
39445d7d72bSStefano Babic		$(obj)tools/mkimage -n  $(CONFIG_IMX_CONFIG) -T imximage \
39514d0a02aSWolfgang Denk		-e $(CONFIG_SYS_TEXT_BASE) -d $< $@
3968edcde5eSStefano Babic
397aa0c7a86SPrafulla Wadaskar$(obj)u-boot.kwb:       $(obj)u-boot.bin
39831d80c77SPrafulla Wadaskar		$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
3992ea88b06SEric Cooper		-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
400aa0c7a86SPrafulla Wadaskar
401566a494fSHeiko Schocher$(obj)u-boot.sha1:	$(obj)u-boot.bin
40201159530SHeiko Schocher		$(obj)tools/ubsha1 $(obj)u-boot.bin
403566a494fSHeiko Schocher
404f9328639SMarian Balakowicz$(obj)u-boot.dis:	$(obj)u-boot
4057ebf7443Swdenk		$(OBJDUMP) -d $< > $@
4067ebf7443Swdenk
4077816f2cfSHeiko Schocher$(obj)u-boot.ubl:       $(obj)u-boot-nand.bin
4087816f2cfSHeiko Schocher		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
4097816f2cfSHeiko Schocher		-e $(CONFIG_SYS_TEXT_BASE) -d $< $@
4107816f2cfSHeiko Schocher
41186eb49b3SSimon Glassifeq ($(CONFIG_SANDBOX),y)
41286eb49b3SSimon GlassGEN_UBOOT = \
41386eb49b3SSimon Glass		cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
41486eb49b3SSimon Glass			-Wl,--start-group $(__LIBS) -Wl,--end-group \
41586eb49b3SSimon Glass			$(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
41686eb49b3SSimon Glasselse
417ecb1dc89SMike FrysingerGEN_UBOOT = \
418de109d90SWolfgang Denk		UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
419de109d90SWolfgang Denk		sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
4208aba9dceSNobuhiro Iwamatsu		cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \
421f9328639SMarian Balakowicz			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
422b2184c31Swdenk			-Map u-boot.map -o u-boot
42386eb49b3SSimon Glassendif
42486eb49b3SSimon Glass
42516a354f9SWolfgang Denk$(obj)u-boot:	depend \
426349e83f0SChe-liang Chiou		$(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
427ecb1dc89SMike Frysinger		$(GEN_UBOOT)
428ecb1dc89SMike Frysingerifeq ($(CONFIG_KALLSYMS),y)
4291aada9cdSWolfgang Denk		smap=`$(call SYSTEM_MAP,u-boot) | \
4301aada9cdSWolfgang Denk			awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
4311aada9cdSWolfgang Denk		$(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
4321aada9cdSWolfgang Denk			-c common/system_map.c -o $(obj)common/system_map.o
433ecb1dc89SMike Frysinger		$(GEN_UBOOT) $(obj)common/system_map.o
434ecb1dc89SMike Frysingerendif
4357ebf7443Swdenk
436d0d6144eSPeter Tyser$(OBJS):	depend
43703b7004dSPeter Tyser		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
438f9328639SMarian Balakowicz
439349e83f0SChe-liang Chiou$(LIBS):	depend $(SUBDIR_TOOLS)
440f9328639SMarian Balakowicz		$(MAKE) -C $(dir $(subst $(obj),,$@))
441a8c7c708Swdenk
442d0d6144eSPeter Tyser$(LIBBOARD):	depend $(LIBS)
443de109d90SWolfgang Denk		$(MAKE) -C $(dir $(subst $(obj),,$@))
444de109d90SWolfgang Denk
445d0d6144eSPeter Tyser$(SUBDIRS):	depend
446b028f715Swdenk		$(MAKE) -C $@ all
4477ebf7443Swdenk
448349e83f0SChe-liang Chiou$(SUBDIR_EXAMPLES): $(obj)u-boot
449349e83f0SChe-liang Chiou
450d0d6144eSPeter Tyser$(LDSCRIPT):	depend
451f65c9812SMike Frysinger		$(MAKE) -C $(dir $@) $(notdir $@)
452f65c9812SMike Frysinger
4531aada9cdSWolfgang Denk$(obj)u-boot.lds: $(LDSCRIPT)
4541aada9cdSWolfgang Denk		$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
4551aada9cdSWolfgang Denk
456e935a374SHaiying Wangnand_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
4578318fbf8SMarian Balakowicz		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
458887e2ec9SStefan Roese
459e935a374SHaiying Wang$(obj)u-boot-nand.bin:	nand_spl $(obj)u-boot.bin
4608318fbf8SMarian Balakowicz		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
461887e2ec9SStefan Roese
462e935a374SHaiying Wangonenand_ipl:	$(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
463f2302d44SStefan Roese		$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
464751b9b51SKyungmin Park
465e935a374SHaiying Wang$(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
466ca6189dbSKyungmin Park		cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
467751b9b51SKyungmin Park
4680d3c62e4SChander Kashyapmmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
4690d3c62e4SChander Kashyap		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all
4700d3c62e4SChander Kashyap
4710d3c62e4SChander Kashyap$(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
4720d3c62e4SChander Kashyap
4735df2ee27SDaniel Schwierzeck$(obj)spl/u-boot-spl.bin:		depend
4745df2ee27SDaniel Schwierzeck		$(MAKE) -C spl all
4755df2ee27SDaniel Schwierzeck
476f9328639SMarian Balakowiczupdater:
4770358df42SMike Frysinger		$(MAKE) -C tools/updater all
4788f713fdfSdzu
4792a998793SDaniel Hobi# Explicitly make _depend in subdirs containing multiple targets to prevent
4802a998793SDaniel Hobi# parallel sub-makes creating .depend files simultaneously.
48116a354f9SWolfgang Denkdepend dep:	$(TIMESTAMP_FILE) $(VERSION_FILE) \
48216a354f9SWolfgang Denk		$(obj)include/autoconf.mk \
483a4814a69SStefano Babic		$(obj)include/generated/generic-asm-offsets.h \
484a4814a69SStefano Babic		$(obj)include/generated/asm-offsets.h
48503b7004dSPeter Tyser		for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
4862a998793SDaniel Hobi			$(MAKE) -C $$dir _depend ; done
4877ebf7443Swdenk
488e5e4e705SLi YangTAG_SUBDIRS = $(SUBDIRS)
489e5e4e705SLi YangTAG_SUBDIRS += $(dir $(__LIBS))
490a340c325SJean-Christophe PLAGNIOL-VILLARDTAG_SUBDIRS += include
491a340c325SJean-Christophe PLAGNIOL-VILLARD
492857d9ea6SHorst KronstorferFIND := find
493857d9ea6SHorst KronstorferFINDFLAGS := -L
494857d9ea6SHorst Kronstorfer
495f9328639SMarian Balakowicztags ctags:
496857d9ea6SHorst Kronstorfer		ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
497e5e4e705SLi Yang						-name '*.[chS]' -print`
4987ebf7443Swdenk
4997ebf7443Swdenketags:
500857d9ea6SHorst Kronstorfer		etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
501e5e4e705SLi Yang						-name '*.[chS]' -print`
502ffda586fSLi Yangcscope:
503857d9ea6SHorst Kronstorfer		$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
504857d9ea6SHorst Kronstorfer						cscope.files
505ffda586fSLi Yang		cscope -b -q -k
5067ebf7443Swdenk
507ecb1dc89SMike FrysingerSYSTEM_MAP = \
508ecb1dc89SMike Frysinger		$(NM) $1 | \
5097ebf7443Swdenk		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
510ecb1dc89SMike Frysinger		LC_ALL=C sort
511ecb1dc89SMike Frysinger$(obj)System.map:	$(obj)u-boot
512ecb1dc89SMike Frysinger		@$(call SYSTEM_MAP,$<) > $(obj)System.map
5137ebf7443Swdenk
5142f155f6cSGrant Likely#
5152f155f6cSGrant Likely# Auto-generate the autoconf.mk file (which is included by all makefiles)
5162f155f6cSGrant Likely#
5172f155f6cSGrant Likely# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
5182f155f6cSGrant Likely# the dep file is only include in this top level makefile to determine when
5192f155f6cSGrant Likely# to regenerate the autoconf.mk file.
5201510b82dSWolfgang Denk$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
5211510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
52216fe7775SMike Frysinger	set -e ; \
523ae6d1056SWolfgang Denk	: Generate the dependancies ; \
5244c34b2a0SMike Frysinger	$(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
5251510b82dSWolfgang Denk		-MQ $(obj)include/autoconf.mk include/common.h > $@
5261510b82dSWolfgang Denk
5271510b82dSWolfgang Denk$(obj)include/autoconf.mk: $(obj)include/config.h
5281510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
5291510b82dSWolfgang Denk	set -e ; \
530ae6d1056SWolfgang Denk	: Extract the config macros ; \
5311510b82dSWolfgang Denk	$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
5324a0f7538SWolfgang Denk		sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
5334a0f7538SWolfgang Denk	mv $@.tmp $@
5342f155f6cSGrant Likely
53516a354f9SWolfgang Denk$(obj)include/generated/generic-asm-offsets.h:	$(obj)include/autoconf.mk.dep \
53616a354f9SWolfgang Denk	$(obj)lib/asm-offsets.s
53716a354f9SWolfgang Denk	@$(XECHO) Generating $@
53816a354f9SWolfgang Denk	tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
53916a354f9SWolfgang Denk
54016a354f9SWolfgang Denk$(obj)lib/asm-offsets.s:	$(obj)include/autoconf.mk.dep \
54116a354f9SWolfgang Denk	$(src)lib/asm-offsets.c
54216a354f9SWolfgang Denk	@mkdir -p $(obj)lib
54316a354f9SWolfgang Denk	$(CC) -DDO_DEPS_ONLY \
54416a354f9SWolfgang Denk		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
54516a354f9SWolfgang Denk		-o $@ $(src)lib/asm-offsets.c -c -S
54616a354f9SWolfgang Denk
547a4814a69SStefano Babic$(obj)include/generated/asm-offsets.h:	$(obj)include/autoconf.mk.dep \
548a4814a69SStefano Babic	$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
549a4814a69SStefano Babic	@echo Generating $@
550a4814a69SStefano Babic	tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
551a4814a69SStefano Babic
552a4814a69SStefano Babic$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s:	$(obj)include/autoconf.mk.dep
553a4814a69SStefano Babic	@mkdir -p $(obj)$(CPUDIR)/$(SOC)
554a4814a69SStefano Babic	if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
555a4814a69SStefano Babic		$(CC) -DDO_DEPS_ONLY \
556a4814a69SStefano Babic		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
557a4814a69SStefano Babic			-o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
558a4814a69SStefano Babic	else \
559a4814a69SStefano Babic		touch $@; \
560a4814a69SStefano Babic	fi
561a4814a69SStefano Babic
5627ebf7443Swdenk#########################################################################
563ae6d1056SWolfgang Denkelse	# !config.mk
564f9328639SMarian Balakowiczall $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
565f9328639SMarian Balakowicz$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
566249b53a6SLoïc Minier$(filter-out tools,$(SUBDIRS)) \
5670358df42SMike Frysingerupdater depend dep tags ctags etags cscope $(obj)System.map:
5687ebf7443Swdenk	@echo "System not configured - see README" >&2
5697ebf7443Swdenk	@ exit 1
570c7c0d542SMike Frysinger
571249b53a6SLoïc Miniertools: $(VERSION_FILE) $(TIMESTAMP_FILE)
5720358df42SMike Frysinger	$(MAKE) -C $@ all
573ae6d1056SWolfgang Denkendif	# config.mk
5747ebf7443Swdenk
57528abd48fSIlya Yanok$(VERSION_FILE):
57614ce91b1SMike Frysinger		@mkdir -p $(dir $(VERSION_FILE))
57728abd48fSIlya Yanok		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
57828abd48fSIlya Yanok		   printf '#define PLAIN_VERSION "%s%s"\n' \
57928abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
58028abd48fSIlya Yanok		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
58128abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
58228abd48fSIlya Yanok		) > $@.tmp
58328abd48fSIlya Yanok		@( printf '#define CC_VERSION_STRING "%s"\n' \
58428abd48fSIlya Yanok		 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp
58528abd48fSIlya Yanok		@( printf '#define LD_VERSION_STRING "%s"\n' \
58628abd48fSIlya Yanok		 '$(shell $(LD) -v | head -n 1)' )>>  $@.tmp
58728abd48fSIlya Yanok		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
58828abd48fSIlya Yanok
589249b53a6SLoïc Minier$(TIMESTAMP_FILE):
590249b53a6SLoïc Minier		@mkdir -p $(dir $(TIMESTAMP_FILE))
591a76406fbSLoïc Minier		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp
592a76406fbSLoïc Minier		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
593a76406fbSLoïc Minier		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
594249b53a6SLoïc Minier
5950358df42SMike Frysingereasylogo env gdb:
5960358df42SMike Frysinger	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
5970358df42SMike Frysingergdbtools: gdb
5980358df42SMike Frysinger
599249b53a6SLoïc Miniertools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
6000358df42SMike Frysinger	$(MAKE) -C tools HOST_TOOLS_ALL=y
6010358df42SMike Frysinger
6024e53a258SWolfgang Denk.PHONY : CHANGELOG
6034e53a258SWolfgang DenkCHANGELOG:
604b985b5d6SBen Warren	git log --no-merges U-Boot-1_1_5.. | \
605b985b5d6SBen Warren	unexpand -a | sed -e 's/\s\s*$$//' > $@
6064e53a258SWolfgang Denk
6070a823aa2SHarald Welteinclude/license.h: tools/bin2header COPYING
6080a823aa2SHarald Welte	cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
6097ebf7443Swdenk#########################################################################
6107ebf7443Swdenk
6117ebf7443Swdenkunconfig:
612887e2ec9SStefan Roese	@rm -f $(obj)include/config.h $(obj)include/config.mk \
6132f155f6cSGrant Likely		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
6142f155f6cSGrant Likely		$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
6157ebf7443Swdenk
616a6862bc1SWolfgang Denk%_config::	unconfig
617a6862bc1SWolfgang Denk	@$(MKCONFIG) -A $(@:_config=)
618a6862bc1SWolfgang Denk
619d6a5e6d5SLoïc Miniersinclude $(obj).boards.depend
620d6a5e6d5SLoïc Minier$(obj).boards.depend:	boards.cfg
621727ebd9fSMike Frysinger	awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
6229f4a4206SMike Frysinger
6238c994630SWolfgang Denk#
6248c994630SWolfgang Denk# Functions to generate common board directory names
6258c994630SWolfgang Denk#
6268c994630SWolfgang Denklcname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/')
6278c994630SWolfgang Denkucname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
6288c994630SWolfgang Denk
6294e5ca3ebSwdenk#########################################################################
6304e5ca3ebSwdenk## Coldfire
6314e5ca3ebSwdenk#########################################################################
632a21d0c2cSTsiChung LiewM52277EVB_config \
633a21d0c2cSTsiChung LiewM52277EVB_spansion_config \
634a21d0c2cSTsiChung LiewM52277EVB_stmicro_config :	unconfig
635f6ef7428Sstany MARCEL	@mkdir -p $(obj)include
636f6ef7428Sstany MARCEL	@mkdir -p $(obj)board/freescale/m52277evb
637a21d0c2cSTsiChung Liew	@case "$@" in \
638a21d0c2cSTsiChung Liew	M52277EVB_config)		FLASH=SPANSION;; \
639a21d0c2cSTsiChung Liew	M52277EVB_spansion_config)	FLASH=SPANSION;; \
640a21d0c2cSTsiChung Liew	M52277EVB_stmicro_config)	FLASH=STMICRO;; \
641a21d0c2cSTsiChung Liew	esac; \
642a21d0c2cSTsiChung Liew	if [ "$${FLASH}" = "SPANSION" ] ; then \
643a21d0c2cSTsiChung Liew		echo "#define CONFIG_SYS_SPANSION_BOOT"	>> $(obj)include/config.h ; \
64414d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m52277evb/config.tmp ; \
645a21d0c2cSTsiChung Liew	fi; \
646a21d0c2cSTsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
647a21d0c2cSTsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
648a21d0c2cSTsiChung Liew		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
64914d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x43E00000" > $(obj)board/freescale/m52277evb/config.tmp ; \
650a21d0c2cSTsiChung Liew	fi
6510e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M52277EVB m68k mcf5227x m52277evb freescale
6521552af70STsiChungLiew
6534a442d31STsiChungLiewM5235EVB_config \
6544a442d31STsiChungLiewM5235EVB_Flash16_config \
6554a442d31STsiChungLiewM5235EVB_Flash32_config:	unconfig
656f6ef7428Sstany MARCEL	@mkdir -p $(obj)include
657f6ef7428Sstany MARCEL	@mkdir -p $(obj)board/freescale/m5235evb
6584a442d31STsiChungLiew	@case "$@" in \
6594a442d31STsiChungLiew	M5235EVB_config)		FLASH=16;; \
6604a442d31STsiChungLiew	M5235EVB_Flash16_config)	FLASH=16;; \
6614a442d31STsiChungLiew	M5235EVB_Flash32_config)	FLASH=32;; \
6624a442d31STsiChungLiew	esac; \
6634a442d31STsiChungLiew	if [ "$${FLASH}" != "16" ] ; then \
664ae6d1056SWolfgang Denk		echo "#define NORFLASH_PS32BIT	1" >> $(obj)include/config.h ; \
66514d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0xFFC00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
6664a442d31STsiChungLiew	else \
66714d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
6684a442d31STsiChungLiew	fi
6690e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M5235EVB m68k mcf523x m5235evb freescale
6704a442d31STsiChungLiew
6714176c799SWolfgang DenkEB+MCF-EV123_config :		unconfig
672f9328639SMarian Balakowicz	@mkdir -p $(obj)board/BuS/EB+MCF-EV123
67314d0a02aSWolfgang Denk	@echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
6740e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
6754176c799SWolfgang Denk
6764176c799SWolfgang DenkEB+MCF-EV123_internal_config :	unconfig
677f9328639SMarian Balakowicz	@mkdir -p $(obj)board/BuS/EB+MCF-EV123
67814d0a02aSWolfgang Denk	@echo "CONFIG_SYS_TEXT_BASE = 0xF0000000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
6790e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
6804176c799SWolfgang Denk
68105316f8eSTsiChung LiewM54451EVB_config \
68205316f8eSTsiChung LiewM54451EVB_stmicro_config :	unconfig
683f6ef7428Sstany MARCEL	@mkdir -p $(obj)include
684f6ef7428Sstany MARCEL	@mkdir -p $(obj)board/freescale/m54451evb
68505316f8eSTsiChung Liew	@case "$@" in \
686709b384bSTsiChung Liew	M54451EVB_config)		FLASH=NOR;; \
68705316f8eSTsiChung Liew	M54451EVB_stmicro_config)	FLASH=STMICRO;; \
68805316f8eSTsiChung Liew	esac; \
689709b384bSTsiChung Liew	if [ "$${FLASH}" = "NOR" ] ; then \
69014d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54451evb/config.tmp ; \
69105316f8eSTsiChung Liew	fi; \
69205316f8eSTsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
69305316f8eSTsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
6946d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
69514d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x47E00000" > $(obj)board/freescale/m54451evb/config.tmp ; \
69605316f8eSTsiChung Liew	fi; \
6976d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_INPUT_CLKSRC 24000000" >> $(obj)include/config.h ;
6980e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M54451EVB m68k mcf5445x m54451evb freescale
69905316f8eSTsiChung Liew
7008ae158cdSTsiChungLiewM54455EVB_config \
7018ae158cdSTsiChungLiewM54455EVB_atmel_config \
7028ae158cdSTsiChungLiewM54455EVB_intel_config \
7038ae158cdSTsiChungLiewM54455EVB_a33_config \
7048ae158cdSTsiChungLiewM54455EVB_a66_config \
7058ae158cdSTsiChungLiewM54455EVB_i33_config \
7069f751551STsiChung LiewM54455EVB_i66_config \
7079f751551STsiChung LiewM54455EVB_stm33_config :	unconfig
708f6ef7428Sstany MARCEL	@mkdir -p $(obj)include
709f6ef7428Sstany MARCEL	@mkdir -p $(obj)board/freescale/m54455evb
7108ae158cdSTsiChungLiew	@case "$@" in \
7118ae158cdSTsiChungLiew	M54455EVB_config)		FLASH=ATMEL; FREQ=33333333;; \
7128ae158cdSTsiChungLiew	M54455EVB_atmel_config)		FLASH=ATMEL; FREQ=33333333;; \
7138ae158cdSTsiChungLiew	M54455EVB_intel_config)		FLASH=INTEL; FREQ=33333333;; \
7148ae158cdSTsiChungLiew	M54455EVB_a33_config)		FLASH=ATMEL; FREQ=33333333;; \
7158ae158cdSTsiChungLiew	M54455EVB_a66_config)		FLASH=ATMEL; FREQ=66666666;; \
7168ae158cdSTsiChungLiew	M54455EVB_i33_config)		FLASH=INTEL; FREQ=33333333;; \
7178ae158cdSTsiChungLiew	M54455EVB_i66_config)		FLASH=INTEL; FREQ=66666666;; \
7189f751551STsiChung Liew	M54455EVB_stm33_config)		FLASH=STMICRO; FREQ=33333333;; \
7198ae158cdSTsiChungLiew	esac; \
7201aaab9bfSWolfgang Denk	if [ "$${FLASH}" = "INTEL" ] ; then \
7216d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_INTEL_BOOT" >> $(obj)include/config.h ; \
72214d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
7239f751551STsiChung Liew	fi; \
7249f751551STsiChung Liew	if [ "$${FLASH}" = "ATMEL" ] ; then \
7256d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_ATMEL_BOOT"	>> $(obj)include/config.h ; \
72614d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x04000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
7278ae158cdSTsiChungLiew	fi; \
7289f751551STsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
7299f751551STsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
7306d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
73114d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x4FE00000" > $(obj)board/freescale/m54455evb/config.tmp ; \
7329f751551STsiChung Liew	fi; \
7336d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \
734b823c8cdSJason Jin	$(XECHO) "... with $${FREQ}Hz input clock"
7350e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M54455EVB m68k mcf5445x m54455evb freescale
7368ae158cdSTsiChungLiew
7377ebf7443Swdenk#========================================================================
7387ebf7443Swdenk# ARM
7397ebf7443Swdenk#========================================================================
74043a5f0dfSPo-Yu Chuang
741a4b46ed6SUlf Samuelssonxtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
742a4b46ed6SUlf Samuelsson
74363e73c9aSwdenkomap1610inn_config \
74463e73c9aSwdenkomap1610inn_cs0boot_config \
74563e73c9aSwdenkomap1610inn_cs3boot_config \
7463ff02c27Swdenkomap1610inn_cs_autoboot_config \
74763e73c9aSwdenkomap1610h2_config \
74863e73c9aSwdenkomap1610h2_cs0boot_config \
7493ff02c27Swdenkomap1610h2_cs3boot_config \
7503ff02c27Swdenkomap1610h2_cs_autoboot_config:	unconfig
751f9328639SMarian Balakowicz	@mkdir -p $(obj)include
75263e73c9aSwdenk	@if [ "$(findstring _cs0boot_, $@)" ] ; then \
753cdd917a4SWolfgang Denk		echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \
7543ff02c27Swdenk	elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
755cdd917a4SWolfgang Denk		echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \
75663e73c9aSwdenk	else \
757cdd917a4SWolfgang Denk		echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
75863e73c9aSwdenk	fi;
7590e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn ti omap
7606f21347dSwdenk
761a56bd922Swdenkomap730p2_config \
762a56bd922Swdenkomap730p2_cs0boot_config \
763a56bd922Swdenkomap730p2_cs3boot_config :	unconfig
764f9328639SMarian Balakowicz	@mkdir -p $(obj)include
765a56bd922Swdenk	@if [ "$(findstring _cs0boot_, $@)" ] ; then \
766f9328639SMarian Balakowicz		echo "#define CONFIG_CS0_BOOT" >> $(obj)include/config.h ; \
767a56bd922Swdenk	else \
768f9328639SMarian Balakowicz		echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
769a56bd922Swdenk	fi;
770ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
771a56bd922Swdenk
772080cfee7SVipin KUMARspear300_config \
7737da69236SVipin KUMARspear310_config \
7747da69236SVipin KUMARspear320_config :	unconfig
775ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
7767e074158SVipin KUMAR
777566c9c16SVipin KUMARspear600_config :	unconfig
778ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
779566c9c16SVipin KUMAR
78047fd3bffSJean-Christophe PLAGNIOL-VILLARDSX1_stdout_serial_config \
7812d24a3a7SwdenkSX1_config:		unconfig
78247fd3bffSJean-Christophe PLAGNIOL-VILLARD	@mkdir -p $(obj)include
78347fd3bffSJean-Christophe PLAGNIOL-VILLARD	@if [ "$(findstring _stdout_serial_, $@)" ] ; then \
78447fd3bffSJean-Christophe PLAGNIOL-VILLARD		echo "#undef CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
78547fd3bffSJean-Christophe PLAGNIOL-VILLARD	else \
78647fd3bffSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
78747fd3bffSJean-Christophe PLAGNIOL-VILLARD	fi;
7880e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ SX1 arm arm925t sx1
7892d24a3a7Swdenk
790699f0512SWolfgang Denk#########################################################################
79143d9616cSwdenk## XScale Systems
7927ebf7443Swdenk#########################################################################
7937ebf7443Swdenk
7949d8d5a5bSStefan Roesepdnb3_config \
7959d8d5a5bSStefan Roesescpu_config:	unconfig
796cdd917a4SWolfgang Denk	@mkdir -p $(obj)include
7979d8d5a5bSStefan Roese	@if [ "$(findstring scpu_,$@)" ] ; then \
798cdd917a4SWolfgang Denk		echo "#define CONFIG_SCPU"	>>$(obj)include/config.h ; \
7999d8d5a5bSStefan Roese	fi
8000e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a pdnb3 arm ixp pdnb3 prodrive
801ba94a1bbSWolfgang Denk
8028ed96046Swdenk#########################################################################
8038ed96046Swdenk## ARM1136 Systems
8048ed96046Swdenk#########################################################################
8055ca9881aSPeter Pearse
8065ca9881aSPeter Pearseapollon_config		: unconfig
8078cbf4e4fSWolfgang Denk	@mkdir -p $(obj)include
808751b9b51SKyungmin Park	@echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
809751b9b51SKyungmin Park	@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
810a6862bc1SWolfgang Denk	@$(MKCONFIG) $@ arm arm1136 apollon - omap24xx
8118ed96046Swdenk
81211edcfe2SGuennadi Liakhovetski#########################################################################
81311edcfe2SGuennadi Liakhovetski## ARM1176 Systems
81411edcfe2SGuennadi Liakhovetski#########################################################################
81511edcfe2SGuennadi Liakhovetskismdk6400_noUSB_config	\
81611edcfe2SGuennadi Liakhovetskismdk6400_config	:	unconfig
81711edcfe2SGuennadi Liakhovetski	@mkdir -p $(obj)include $(obj)board/samsung/smdk6400
81811edcfe2SGuennadi Liakhovetski	@mkdir -p $(obj)nand_spl/board/samsung/smdk6400
81911edcfe2SGuennadi Liakhovetski	@echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
8200e42ada3SWolfgang Denk	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
82111edcfe2SGuennadi Liakhovetski	@if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then			\
82211edcfe2SGuennadi Liakhovetski		echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
82311edcfe2SGuennadi Liakhovetski	else										\
82411edcfe2SGuennadi Liakhovetski		echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
82511edcfe2SGuennadi Liakhovetski	fi
82654e19a7dSWolfgang Denk	@$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
82711edcfe2SGuennadi Liakhovetski	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
82811edcfe2SGuennadi Liakhovetski
8290afe519aSWolfgang Denk#########################################################################
8303e38691eSwdenk#########################################################################
8317ebf7443Swdenk
8327ebf7443Swdenkclean:
8331bc15386SPeter Tyser	@rm -f $(obj)examples/standalone/82559_eeprom			  \
834d640ac58SWolfgang Denk	       $(obj)examples/standalone/atmel_df_pow2			  \
8351bc15386SPeter Tyser	       $(obj)examples/standalone/eepro100_eeprom		  \
8361bc15386SPeter Tyser	       $(obj)examples/standalone/hello_world			  \
8371bc15386SPeter Tyser	       $(obj)examples/standalone/interrupt			  \
8381bc15386SPeter Tyser	       $(obj)examples/standalone/mem_to_mem_idma2intr		  \
8391bc15386SPeter Tyser	       $(obj)examples/standalone/sched				  \
840201a017cSMike Frysinger	       $(obj)examples/standalone/smc911{11,x}_eeprom		  \
8411bc15386SPeter Tyser	       $(obj)examples/standalone/test_burst			  \
8421bc15386SPeter Tyser	       $(obj)examples/standalone/timer
843d4abc757SPeter Tyser	@rm -f $(obj)examples/api/demo{,.bin}
844f9301e1cSWolfgang Denk	@rm -f $(obj)tools/bmp_logo	   $(obj)tools/easylogo/easylogo  \
845f9301e1cSWolfgang Denk	       $(obj)tools/env/{fw_printenv,fw_setenv}			  \
846f9301e1cSWolfgang Denk	       $(obj)tools/envcrc					  \
847f9301e1cSWolfgang Denk	       $(obj)tools/gdb/{astest,gdbcont,gdbsend}			  \
848f9301e1cSWolfgang Denk	       $(obj)tools/gen_eth_addr    $(obj)tools/img2srec		  \
849f9301e1cSWolfgang Denk	       $(obj)tools/mkimage	   $(obj)tools/mpc86x_clk	  \
850f9301e1cSWolfgang Denk	       $(obj)tools/ncb		   $(obj)tools/ubsha1
851f9301e1cSWolfgang Denk	@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}	  \
85274c7a95fSWolfgang Denk	       $(obj)board/matrix_vision/*/bootscript.img		  \
853566e5cf4SWolfgang Denk	       $(obj)board/voiceblue/eeprom 				  \
8541aada9cdSWolfgang Denk	       $(obj)u-boot.lds						  \
855fb5166ceSMike Frysinger	       $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]	  \
856fb5166ceSMike Frysinger	       $(obj)arch/blackfin/cpu/init.{lds,elf}
857dc7746d8SWolfgang Denk	@rm -f $(obj)include/bmp_logo.h
85816a354f9SWolfgang Denk	@rm -f $(obj)lib/asm-offsets.s
859a4814a69SStefano Babic	@rm -f $(obj)include/generated/asm-offsets.h
860a4814a69SStefano Babic	@rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
861ff6b47adSKumar Gala	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
862ca6189dbSKyungmin Park	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
8630d3c62e4SChander Kashyap	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
864ca6189dbSKyungmin Park	@rm -f $(ONENAND_BIN)
8651aada9cdSWolfgang Denk	@rm -f $(obj)onenand_ipl/u-boot.lds
8665df2ee27SDaniel Schwierzeck	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
8674e4b21bdSJoel A Fernandes	@rm -f $(obj)MLO
868d4abc757SPeter Tyser	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
869ae6d1056SWolfgang Denk	@find $(OBJTREE) -type f \
8707ebf7443Swdenk		\( -name 'core' -o -name '*.bak' -o -name '*~' \
8712b48f7d5SPeter Tyser		-o -name '*.o'	-o -name '*.a' -o -name '*.exe'	\) -print \
8727ebf7443Swdenk		| xargs rm -f
8737ebf7443Swdenk
8747ebf7443Swdenkclobber:	clean
87547508843SSimon Glass	@find $(OBJTREE) -type f \( -name '*.depend*' \
8764c0d4c3bSwdenk		-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
8774c0d4c3bSwdenk		-print0 \
8784c0d4c3bSwdenk		| xargs -0 rm -f
879ffda586fSLi Yang	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
8805013c09fSWolfgang Denk		$(obj)cscope.* $(obj)*.*~
8814e0fbb98SDaniel Schwierzeck	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
882aa0c7a86SPrafulla Wadaskar	@rm -f $(obj)u-boot.kwb
883c5fb70c9SStefano Babic	@rm -f $(obj)u-boot.imx
8847816f2cfSHeiko Schocher	@rm -f $(obj)u-boot.ubl
885*bbb0b128SSimon Glass	@rm -f $(obj)u-boot.dtb
886fb8b33c1SPeter Tyser	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
887a47a12beSStefan Roese	@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
888a9d8bc98SLoïc Minier	@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
88916a354f9SWolfgang Denk	@rm -fr $(obj)include/generated
890a958b663SJean-Christophe PLAGNIOL-VILLARD	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
891a958b663SJean-Christophe PLAGNIOL-VILLARD	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
8920d3c62e4SChander Kashyap	@[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l -print | xargs rm -f
893*bbb0b128SSimon Glass	@rm -f $(obj)dts/*.tmp
8947ebf7443Swdenk
8957ebf7443Swdenkmrproper \
8967ebf7443Swdenkdistclean:	clobber unconfig
897afd077bdSMike Frysingerifneq ($(OBJTREE),$(SRCTREE))
898ae6d1056SWolfgang Denk	rm -rf $(obj)*
899f9328639SMarian Balakowiczendif
9007ebf7443Swdenk
9017ebf7443Swdenkbackup:
9027ebf7443Swdenk	F=`basename $(TOPDIR)` ; cd .. ; \
903d6b93714SIlya Yanok	gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
9047ebf7443Swdenk
9057ebf7443Swdenk#########################################################################
906