17ebf7443Swdenk# 2eca3aeb3SWolfgang Denk# (C) Copyright 2000-2013 37ebf7443Swdenk# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 47ebf7443Swdenk# 5eca3aeb3SWolfgang Denk# SPDX-License-Identifier: GPL-2.0+ 67ebf7443Swdenk# 77ebf7443Swdenk 83ae7b240STom RiniVERSION = 2013 940a60c6eSTom RiniPATCHLEVEL = 10 10211e4754SWolfgang DenkSUBLEVEL = 11183acb70STom RiniEXTRAVERSION = 128b9e4787SWolfgang Denkifneq "$(SUBLEVEL)" "" 13881a87ecSWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 148b9e4787SWolfgang Denkelse 158b9e4787SWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) 168b9e4787SWolfgang Denkendif 17efb2172eSSimon GlassTIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h 18efb2172eSSimon GlassVERSION_FILE = $(obj)include/generated/version_autogenerated.h 19881a87ecSWolfgang Denk 207ebf7443SwdenkHOSTARCH := $(shell uname -m | \ 21fea25720SGraeme Russ sed -e s/i.86/x86/ \ 227ebf7443Swdenk -e s/sun4u/sparc64/ \ 237ebf7443Swdenk -e s/arm.*/arm/ \ 247ebf7443Swdenk -e s/sa110/arm/ \ 25d0179083SKumar Gala -e s/ppc64/powerpc/ \ 26d0179083SKumar Gala -e s/ppc/powerpc/ \ 278d1f6355SNobuhiro Iwamatsu -e s/macppc/powerpc/\ 288d1f6355SNobuhiro Iwamatsu -e s/sh.*/sh/) 297ebf7443Swdenk 30f9d77ed3SWolfgang DenkHOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ 317ebf7443Swdenk sed -e 's/\(cygwin\).*/cygwin/') 327ebf7443Swdenk 33120ae609SBenoît Thébaudeauexport HOSTARCH HOSTOS 347ebf7443Swdenk 357ebf7443Swdenk# Deal with colliding definitions from tcsh etc. 367ebf7443SwdenkVENDOR= 377ebf7443Swdenk 387ebf7443Swdenk######################################################################### 39ae6d1056SWolfgang Denk# Allow for silent builds 40ae6d1056SWolfgang Denkifeq (,$(findstring s,$(MAKEFLAGS))) 41ae6d1056SWolfgang DenkXECHO = echo 42ae6d1056SWolfgang Denkelse 43ae6d1056SWolfgang DenkXECHO = : 44ae6d1056SWolfgang Denkendif 45ae6d1056SWolfgang Denk 46ae6d1056SWolfgang Denk######################################################################### 47f9328639SMarian Balakowicz# 481bce2aebSRobert P. J. Day# U-boot build supports generating object files in a separate external 49f9328639SMarian Balakowicz# directory. Two use cases are supported: 50f9328639SMarian Balakowicz# 51f9328639SMarian Balakowicz# 1) Add O= to the make command line 52f9328639SMarian Balakowicz# 'make O=/tmp/build all' 53f9328639SMarian Balakowicz# 541bce2aebSRobert P. J. Day# 2) Set environment variable BUILD_DIR to point to the desired location 55f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build' 56f9328639SMarian Balakowicz# 'make' 57f9328639SMarian Balakowicz# 58f9328639SMarian Balakowicz# The second approach can also be used with a MAKEALL script 59f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build' 60f9328639SMarian Balakowicz# './MAKEALL' 61f9328639SMarian Balakowicz# 621bce2aebSRobert P. J. Day# Command line 'O=' setting overrides BUILD_DIR environment variable. 63f9328639SMarian Balakowicz# 64f9328639SMarian Balakowicz# When none of the above methods is used the local build is performed and 65f9328639SMarian Balakowicz# the object files are placed in the source directory. 66f9328639SMarian Balakowicz# 677ebf7443Swdenk 68f9328639SMarian Balakowiczifdef O 69f9328639SMarian Balakowiczifeq ("$(origin O)", "command line") 70f9328639SMarian BalakowiczBUILD_DIR := $(O) 71f9328639SMarian Balakowiczendif 72f9328639SMarian Balakowiczendif 737ebf7443Swdenk 744ab64933SKim Phillips# Call a source code checker (by default, "sparse") as part of the 754ab64933SKim Phillips# C compilation. 764ab64933SKim Phillips# 774ab64933SKim Phillips# Use 'make C=1' to enable checking of re-compiled files. 784ab64933SKim Phillips# 794ab64933SKim Phillips# See the linux kernel file "Documentation/sparse.txt" for more details, 804ab64933SKim Phillips# including where to get the "sparse" utility. 814ab64933SKim Phillips 824ab64933SKim Phillipsifdef C 834ab64933SKim Phillipsifeq ("$(origin C)", "command line") 844ab64933SKim PhillipsCHECKSRC := $(C) 854ab64933SKim Phillipsendif 864ab64933SKim Phillipsendif 874ab64933SKim Phillipsifndef CHECKSRC 884ab64933SKim Phillips CHECKSRC = 0 894ab64933SKim Phillipsendif 904ab64933SKim Phillipsexport CHECKSRC 914ab64933SKim Phillips 92f9328639SMarian Balakowiczifneq ($(BUILD_DIR),) 93f9328639SMarian Balakowiczsaved-output := $(BUILD_DIR) 944f0645ebSMarian Balakowicz 954f0645ebSMarian Balakowicz# Attempt to create a output directory. 964f0645ebSMarian Balakowicz$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR}) 974f0645ebSMarian Balakowicz 984f0645ebSMarian Balakowicz# Verify if it was successful. 99f9328639SMarian BalakowiczBUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd) 100f9328639SMarian Balakowicz$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist)) 101f9328639SMarian Balakowiczendif # ifneq ($(BUILD_DIR),) 102f9328639SMarian Balakowicz 103f9328639SMarian BalakowiczOBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR)) 104c8f9c302SDaniel SchwierzeckSPLTREE := $(OBJTREE)/spl 1053aa29de0SYing ZhangTPLTREE := $(OBJTREE)/tpl 106f9328639SMarian BalakowiczSRCTREE := $(CURDIR) 107f9328639SMarian BalakowiczTOPDIR := $(SRCTREE) 108f9328639SMarian BalakowiczLNDIR := $(OBJTREE) 1093aa29de0SYing Zhangexport TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE 110f9328639SMarian Balakowicz 111f9328639SMarian BalakowiczMKCONFIG := $(SRCTREE)/mkconfig 112f9328639SMarian Balakowiczexport MKCONFIG 113f9328639SMarian Balakowicz 114f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE)) 115f9328639SMarian BalakowiczREMOTE_BUILD := 1 116f9328639SMarian Balakowiczexport REMOTE_BUILD 117f9328639SMarian Balakowiczendif 118f9328639SMarian Balakowicz 119f9328639SMarian Balakowicz# $(obj) and (src) are defined in config.mk but here in main Makefile 120f9328639SMarian Balakowicz# we also need them before config.mk is included which is the case for 121f9328639SMarian Balakowicz# some targets like unconfig, clean, clobber, distclean, etc. 122f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE)) 123f9328639SMarian Balakowiczobj := $(OBJTREE)/ 124f9328639SMarian Balakowiczsrc := $(SRCTREE)/ 125f9328639SMarian Balakowiczelse 126f9328639SMarian Balakowiczobj := 127f9328639SMarian Balakowiczsrc := 128f9328639SMarian Balakowiczendif 129f9328639SMarian Balakowiczexport obj src 130f9328639SMarian Balakowicz 1315013c09fSWolfgang Denk# Make sure CDPATH settings don't interfere 1325013c09fSWolfgang Denkunexport CDPATH 1335013c09fSWolfgang Denk 134f9328639SMarian Balakowicz######################################################################### 135f9328639SMarian Balakowicz 1366d1ce387SMike Frysinger# The "tools" are needed early, so put this first 1376d1ce387SMike Frysinger# Don't include stuff already done in $(LIBS) 138349e83f0SChe-liang Chiou# The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC 139349e83f0SChe-liang Chiou# is "yes"), so compile examples after U-Boot is compiled. 140349e83f0SChe-liang ChiouSUBDIR_TOOLS = tools 141349e83f0SChe-liang ChiouSUBDIR_EXAMPLES = examples/standalone examples/api 142349e83f0SChe-liang ChiouSUBDIRS = $(SUBDIR_TOOLS) 1436d1ce387SMike Frysinger 144249b53a6SLoïc Minier.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE) 1456d1ce387SMike Frysinger 146ae6d1056SWolfgang Denkifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk)) 147f9328639SMarian Balakowicz 1482632c008SMike Frysinger# Include autoconf.mk before config.mk so that the config options are available 1492632c008SMike Frysinger# to all top level build files. We need the dummy all: target to prevent the 1502632c008SMike Frysinger# dependency target in autoconf.mk.dep from being the default. 1512632c008SMike Frysingerall: 1522632c008SMike Frysingersinclude $(obj)include/autoconf.mk.dep 1532632c008SMike Frysingersinclude $(obj)include/autoconf.mk 1542632c008SMike Frysinger 155b5728756SSimon Glassifndef CONFIG_SANDBOX 156b5728756SSimon GlassSUBDIRS += $(SUBDIR_EXAMPLES) 157b5728756SSimon Glassendif 158b5728756SSimon Glass 1597ebf7443Swdenk# load ARCH, BOARD, and CPU configuration 160ae6d1056SWolfgang Denkinclude $(obj)include/config.mk 1611d9f4105Swdenkexport ARCH CPU BOARD VENDOR SOC 162f9328639SMarian Balakowicz 1631ea6bcd8SMike Frysinger# set default to nothing for native builds 164a5284efdSWolfgang Denkifeq ($(HOSTARCH),$(ARCH)) 1651ea6bcd8SMike FrysingerCROSS_COMPILE ?= 1667ebf7443Swdenkendif 1677ebf7443Swdenk 16892b197f0SWolfgang Denk# load other configuration 16992b197f0SWolfgang Denkinclude $(TOPDIR)/config.mk 17092b197f0SWolfgang Denk 171fada9e20SSimon Glass# Targets which don't build the source code 172fada9e20SSimon GlassNON_BUILD_TARGETS = backup clean clobber distclean mkproper tidy unconfig 173fada9e20SSimon Glass 174fada9e20SSimon Glass# Only do the generic board check when actually building, not configuring 175fada9e20SSimon Glassifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),) 176fada9e20SSimon Glassifeq ($(findstring _config,$(MAKECMDGOALS)),) 177fada9e20SSimon Glass$(CHECK_GENERIC_BOARD) 178fada9e20SSimon Glassendif 179fada9e20SSimon Glassendif 180fada9e20SSimon Glass 181d51dfff7SIlya Yanok# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use 182d51dfff7SIlya Yanok# that (or fail if absent). Otherwise, search for a linker script in a 183d51dfff7SIlya Yanok# standard location. 184d51dfff7SIlya Yanok 185ee60197eSSimon GlassLDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT)) 186ee60197eSSimon Glass 187d51dfff7SIlya Yanokifndef LDSCRIPT 188d51dfff7SIlya Yanok #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug 189d51dfff7SIlya Yanok ifdef CONFIG_SYS_LDSCRIPT 190d51dfff7SIlya Yanok # need to strip off double quotes 191d51dfff7SIlya Yanok LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) 192d51dfff7SIlya Yanok endif 193d51dfff7SIlya Yanokendif 194d51dfff7SIlya Yanok 195ee60197eSSimon Glass# If there is no specified link script, we look in a number of places for it 196d51dfff7SIlya Yanokifndef LDSCRIPT 197d51dfff7SIlya Yanok ifeq ($(CONFIG_NAND_U_BOOT),y) 198d51dfff7SIlya Yanok LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds 199d51dfff7SIlya Yanok ifeq ($(wildcard $(LDSCRIPT)),) 200d51dfff7SIlya Yanok LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds 201d51dfff7SIlya Yanok endif 202d51dfff7SIlya Yanok endif 203d51dfff7SIlya Yanok ifeq ($(wildcard $(LDSCRIPT)),) 204d51dfff7SIlya Yanok LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds 205d51dfff7SIlya Yanok endif 206d51dfff7SIlya Yanok ifeq ($(wildcard $(LDSCRIPT)),) 207d51dfff7SIlya Yanok LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds 208d51dfff7SIlya Yanok endif 209d51dfff7SIlya Yanok ifeq ($(wildcard $(LDSCRIPT)),) 210ee60197eSSimon Glass LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds 211ee60197eSSimon Glass # We don't expect a Makefile here 212ee60197eSSimon Glass LDSCRIPT_MAKEFILE_DIR = 213ee60197eSSimon Glass endif 214ee60197eSSimon Glass ifeq ($(wildcard $(LDSCRIPT)),) 215d51dfff7SIlya Yanok$(error could not find linker script) 216d51dfff7SIlya Yanok endif 217d51dfff7SIlya Yanokendif 218d51dfff7SIlya Yanok 2197ebf7443Swdenk######################################################################### 2207ebf7443Swdenk# U-Boot objects....order is important (i.e. start must be first) 2217ebf7443Swdenk 22203b7004dSPeter TyserOBJS = $(CPUDIR)/start.o 2237ebf7443Swdenkifeq ($(CPU),ppc4xx) 22403b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o 2257ebf7443Swdenkendif 22642d1f039Swdenkifeq ($(CPU),mpc85xx) 22703b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o 22842d1f039Swdenkendif 2297ebf7443Swdenk 230a32e626fSSimon GlassOBJS := $(addprefix $(obj),$(OBJS)) 231f9328639SMarian Balakowicz 2328b5a0264SDaniel SchwierzeckHAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n) 2338b5a0264SDaniel Schwierzeck 234f52d7b35SDaniel SchwierzeckLIBS-y += lib/libgeneric.o 23519c402afSSimon GlassLIBS-y += lib/rsa/librsa.o 236f52d7b35SDaniel SchwierzeckLIBS-y += lib/lzma/liblzma.o 237f52d7b35SDaniel SchwierzeckLIBS-y += lib/lzo/liblzo.o 238f52d7b35SDaniel SchwierzeckLIBS-y += lib/zlib/libz.o 2398b5a0264SDaniel SchwierzeckLIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o 2408b5a0264SDaniel SchwierzeckLIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o 241f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/lib$(CPU).o 2421d9f4105Swdenkifdef SOC 243f52d7b35SDaniel SchwierzeckLIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o 2441d9f4105Swdenkendif 245323bfa8fSStefan Roeseifeq ($(CPU),ixp) 24661e12988SMarek VasutLIBS-y += drivers/net/npe/libnpe.o 247323bfa8fSStefan Roeseendif 2488b5a0264SDaniel SchwierzeckLIBS-$(CONFIG_OF_EMBED) += dts/libdts.o 249f52d7b35SDaniel SchwierzeckLIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o 250045fa1e1SStephen WarrenLIBS-y += fs/libfs.o \ 251e82004bcSMasahiro Yamada fs/fat/libfat.o 252f52d7b35SDaniel SchwierzeckLIBS-y += net/libnet.o 253f52d7b35SDaniel SchwierzeckLIBS-y += disk/libdisk.o 2549c3f0bc5SMasahiro YamadaLIBS-y += drivers/libdrivers.o 255f52d7b35SDaniel SchwierzeckLIBS-y += drivers/dma/libdma.o 256f52d7b35SDaniel SchwierzeckLIBS-y += drivers/gpio/libgpio.o 257f52d7b35SDaniel SchwierzeckLIBS-y += drivers/i2c/libi2c.o 258f52d7b35SDaniel SchwierzeckLIBS-y += drivers/input/libinput.o 259f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mmc/libmmc.o 260f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/libmtd.o 261f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/nand/libnand.o 262f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/onenand/libonenand.o 263f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/ubi/libubi.o 264f52d7b35SDaniel SchwierzeckLIBS-y += drivers/mtd/spi/libspi_flash.o 265f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/libnet.o 266f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/phy/libphy.o 267f52d7b35SDaniel SchwierzeckLIBS-y += drivers/pci/libpci.o 268e0a0cbf2SŁukasz MajewskiLIBS-y += drivers/power/libpower.o \ 269b95aacd3SŁukasz Majewski drivers/power/fuel_gauge/libfuel_gauge.o \ 27004750447SPiotr Wilczek drivers/power/mfd/libmfd.o \ 271eba42391SŁukasz Majewski drivers/power/pmic/libpmic.o \ 272eba42391SŁukasz Majewski drivers/power/battery/libbattery.o 273f52d7b35SDaniel SchwierzeckLIBS-y += drivers/spi/libspi.o 2747737d5c6SDave Liuifeq ($(CPU),mpc83xx) 275f52d7b35SDaniel SchwierzeckLIBS-y += drivers/qe/libqe.o 276f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o 277f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o 2787737d5c6SDave Liuendif 279da9d4610SAndy Flemingifeq ($(CPU),mpc85xx) 280f52d7b35SDaniel SchwierzeckLIBS-y += drivers/qe/libqe.o 281f52d7b35SDaniel SchwierzeckLIBS-y += drivers/net/fm/libfm.o 282f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o 283f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o 28458e5e9afSKumar Galaendif 28558e5e9afSKumar Galaifeq ($(CPU),mpc86xx) 286f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o 287f52d7b35SDaniel SchwierzeckLIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o 288da9d4610SAndy Flemingendif 289f52d7b35SDaniel SchwierzeckLIBS-y += drivers/serial/libserial.o 290f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/eth/libusb_eth.o 291f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/gadget/libusb_gadget.o 292f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/host/libusb_host.o 293f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/musb/libusb_musb.o 294eb81955bSIlya YanokLIBS-y += drivers/usb/musb-new/libusb_musb-new.o 295f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/phy/libusb_phy.o 296f52d7b35SDaniel SchwierzeckLIBS-y += drivers/usb/ulpi/libusb_ulpi.o 297f52d7b35SDaniel SchwierzeckLIBS-y += common/libcommon.o 298f52d7b35SDaniel SchwierzeckLIBS-y += lib/libfdt/libfdt.o 299f52d7b35SDaniel SchwierzeckLIBS-y += api/libapi.o 300f52d7b35SDaniel SchwierzeckLIBS-y += post/libpost.o 301f52d7b35SDaniel SchwierzeckLIBS-y += test/libtest.o 302f9328639SMarian Balakowicz 30324e8bee5SAlison Wangifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) 304ea00e59bSStefano BabicLIBS-y += arch/$(ARCH)/imx-common/libimx-common.o 30518936ee2SJason Liuendif 30618936ee2SJason Liu 30737d82bebSMasahiro YamadaLIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o 308852bd07cSMinkyu Kang 309f52d7b35SDaniel SchwierzeckLIBS := $(addprefix $(obj),$(sort $(LIBS-y))) 310249b53a6SLoïc Minier.PHONY : $(LIBS) 311a8c7c708Swdenk 3126d8962e8SSebastien CarlierLIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o 313de109d90SWolfgang DenkLIBBOARD := $(addprefix $(obj),$(LIBBOARD)) 314de109d90SWolfgang Denk 3154f7cb08eSwdenk# Add GCC lib 31652b1bf2cSWolfgang Denkifdef USE_PRIVATE_LIBGCC 31752b1bf2cSWolfgang Denkifeq ("$(USE_PRIVATE_LIBGCC)", "yes") 318635d1b3eSMatthias WeisserPLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o 31952b1bf2cSWolfgang Denkelse 32052b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc 32152b1bf2cSWolfgang Denkendif 32252b1bf2cSWolfgang Denkelse 323cca4e4aeSWolfgang DenkPLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc 32452b1bf2cSWolfgang Denkendif 32552b1bf2cSWolfgang DenkPLATFORM_LIBS += $(PLATFORM_LIBGCC) 32652b1bf2cSWolfgang Denkexport PLATFORM_LIBS 3273d3befa7Swdenk 3286ac9f479SMike Frysinger# Special flags for CPP when processing the linker script. 3296ac9f479SMike Frysinger# Pass the version down so we can handle backwards compatibility 3306ac9f479SMike Frysinger# on the fly. 3316ac9f479SMike FrysingerLDPPFLAGS += \ 3326ac9f479SMike Frysinger -include $(TOPDIR)/include/u-boot/u-boot.lds.h \ 3337e6403a6SSimon Glass -DCPUDIR=$(CPUDIR) \ 3346ac9f479SMike Frysinger $(shell $(LD) --version | \ 3356ac9f479SMike Frysinger sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p') 3366ac9f479SMike Frysinger 337f9328639SMarian Balakowicz__OBJS := $(subst $(obj),,$(OBJS)) 338de109d90SWolfgang Denk__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD)) 339f9328639SMarian Balakowicz 3407ebf7443Swdenk######################################################################### 341bdccc4feSwdenk######################################################################### 3427ebf7443Swdenk 343f3a14d37SMike Frysingerifneq ($(CONFIG_BOARD_SIZE_LIMIT),) 344f3a14d37SMike FrysingerBOARD_SIZE_CHECK = \ 345f3a14d37SMike Frysinger @actual=`wc -c $@ | awk '{print $$1}'`; \ 346d060e6f4SJoe Hershberger limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \ 347f3a14d37SMike Frysinger if test $$actual -gt $$limit; then \ 348d060e6f4SJoe Hershberger echo "$@ exceeds file size limit:" >&2 ; \ 349d060e6f4SJoe Hershberger echo " limit: $$limit bytes" >&2 ; \ 350d060e6f4SJoe Hershberger echo " actual: $$actual bytes" >&2 ; \ 351d060e6f4SJoe Hershberger echo " excess: $$((actual - limit)) bytes" >&2; \ 352f3a14d37SMike Frysinger exit 1; \ 353f3a14d37SMike Frysinger fi 354f3a14d37SMike Frysingerelse 355f3a14d37SMike FrysingerBOARD_SIZE_CHECK = 356f3a14d37SMike Frysingerendif 357f3a14d37SMike Frysinger 3583e88337bSMike Frysinger# Always append ALL so that arch config.mk's can add custom ones 3594e0fbb98SDaniel SchwierzeckALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map 360e935a374SHaiying Wang 3614e0fbb98SDaniel SchwierzeckALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin 3624e0fbb98SDaniel SchwierzeckALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin 363262737f0SShaohui XieALL-$(CONFIG_RAMBOOT_PBL) += $(obj)u-boot.pbl 3645df2ee27SDaniel SchwierzeckALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin 3654c267374SHenrik NordströmALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img 3663aa29de0SYing ZhangALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin 3672c0f79e4SSimon GlassALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin 368b343bbb5SVadim Bendeburyifneq ($(CONFIG_SPL_TARGET),) 369b343bbb5SVadim BendeburyALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET)) 370b343bbb5SVadim Bendeburyendif 3717ebf7443Swdenk 37212b7b70cSAllen Martin# enable combined SPL/u-boot/dtb rules for tegra 3736d6c0baeSTom Warrenifneq ($(CONFIG_TEGRA),) 37412b7b70cSAllen Martinifeq ($(CONFIG_OF_SEPARATE),y) 37512b7b70cSAllen MartinALL-y += $(obj)u-boot-dtb-tegra.bin 37612b7b70cSAllen Martinelse 37712b7b70cSAllen MartinALL-y += $(obj)u-boot-nodtb-tegra.bin 37812b7b70cSAllen Martinendif 37912b7b70cSAllen Martinendif 38012b7b70cSAllen Martin 38171f84ef0SMasahiro Yamadabuild := -f $(TOPDIR)/scripts/Makefile.build -C 38271f84ef0SMasahiro Yamada 383349e83f0SChe-liang Chiouall: $(ALL-y) $(SUBDIR_EXAMPLES) 3847ebf7443Swdenk 385501ebdf2SStephen Warren$(obj)u-boot.dtb: checkdtc $(obj)u-boot 386bcfe8fdfSMasahiro Yamada $(MAKE) $(build) dts binary 3872c0f79e4SSimon Glass mv $(obj)dts/dt.dtb $@ 3882c0f79e4SSimon Glass 3892c0f79e4SSimon Glass$(obj)u-boot-dtb.bin: $(obj)u-boot.bin $(obj)u-boot.dtb 3902c0f79e4SSimon Glass cat $^ >$@ 3912c0f79e4SSimon Glass 392f9328639SMarian Balakowicz$(obj)u-boot.hex: $(obj)u-boot 3936310eb9dSwdenk $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ 3946310eb9dSwdenk 395f9328639SMarian Balakowicz$(obj)u-boot.srec: $(obj)u-boot 3960817d688SRicardo Ribalda Delgado $(OBJCOPY) -O srec $< $@ 3977ebf7443Swdenk 398f9328639SMarian Balakowicz$(obj)u-boot.bin: $(obj)u-boot 3997ebf7443Swdenk $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ 400f3a14d37SMike Frysinger $(BOARD_SIZE_CHECK) 4017ebf7443Swdenk 40294a91e24SMike Frysinger$(obj)u-boot.ldr: $(obj)u-boot 40376d82187SMike Frysinger $(CREATE_LDR_ENV) 40468e56324SMike Frysinger $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS) 405f3a14d37SMike Frysinger $(BOARD_SIZE_CHECK) 40694a91e24SMike Frysinger 40794a91e24SMike Frysinger$(obj)u-boot.ldr.hex: $(obj)u-boot.ldr 40894a91e24SMike Frysinger $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary 40994a91e24SMike Frysinger 41094a91e24SMike Frysinger$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr 41194a91e24SMike Frysinger $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary 41294a91e24SMike Frysinger 413b40bda6bSStefan Roese# 414b40bda6bSStefan Roese# U-Boot entry point, needed for booting of full-blown U-Boot 415b40bda6bSStefan Roese# from the SPL U-Boot version. 416b40bda6bSStefan Roese# 417b40bda6bSStefan Roeseifndef CONFIG_SYS_UBOOT_START 418b40bda6bSStefan RoeseCONFIG_SYS_UBOOT_START := 0 419b40bda6bSStefan Roeseendif 420b40bda6bSStefan Roese 421f9328639SMarian Balakowicz$(obj)u-boot.img: $(obj)u-boot.bin 422a2a0a717SWolfgang Denk $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \ 423b40bda6bSStefan Roese -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \ 424b40bda6bSStefan Roese -e $(CONFIG_SYS_UBOOT_START) \ 425881a87ecSWolfgang Denk -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \ 426bdccc4feSwdenk sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ 427bdccc4feSwdenk -d $< $@ 428bdccc4feSwdenk 429291b3dcdSOtavio Salvador$(obj)u-boot.imx: $(obj)u-boot.bin depend 43071f84ef0SMasahiro Yamada $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx 4318edcde5eSStefano Babic 432aa0c7a86SPrafulla Wadaskar$(obj)u-boot.kwb: $(obj)u-boot.bin 43331d80c77SPrafulla Wadaskar $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ 4342ea88b06SEric Cooper -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ 435aa0c7a86SPrafulla Wadaskar 4365d898a00SShaohui Xie$(obj)u-boot.pbl: $(obj)u-boot.bin 4375d898a00SShaohui Xie $(obj)tools/mkimage -n $(CONFIG_PBLRCW_CONFIG) \ 4385d898a00SShaohui Xie -R $(CONFIG_PBLPBI_CONFIG) -T pblimage \ 4395d898a00SShaohui Xie -d $< $@ 4405d898a00SShaohui Xie 441566a494fSHeiko Schocher$(obj)u-boot.sha1: $(obj)u-boot.bin 44201159530SHeiko Schocher $(obj)tools/ubsha1 $(obj)u-boot.bin 443566a494fSHeiko Schocher 444f9328639SMarian Balakowicz$(obj)u-boot.dis: $(obj)u-boot 4457ebf7443Swdenk $(OBJDUMP) -d $< > $@ 4467ebf7443Swdenk 4473aa29de0SYing Zhang# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate, 4483aa29de0SYing Zhang# $(4) is pad-to 4493aa29de0SYing ZhangSPL_PAD_APPEND = \ 4503aa29de0SYing Zhang $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \ 4513aa29de0SYing Zhang $(1) $(obj)$(3); \ 452b6df9b01SYork Sun cat $(obj)$(3) $(2) > $@; \ 4533aa29de0SYing Zhang rm $(obj)$(3) 45474752baaSScott Wood 4553aa29de0SYing Zhangifdef CONFIG_TPL 4563aa29de0SYing ZhangSPL_PAYLOAD := $(obj)tpl/u-boot-with-tpl.bin 4573aa29de0SYing Zhangelse 4583aa29de0SYing ZhangSPL_PAYLOAD := $(obj)u-boot.bin 4593aa29de0SYing Zhangendif 46074752baaSScott Wood 4613aa29de0SYing Zhang$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(SPL_PAYLOAD) 4623aa29de0SYing Zhang $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO)) 4633aa29de0SYing Zhang 4643aa29de0SYing Zhang$(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin 465b6df9b01SYork Sun $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) 4667816f2cfSHeiko Schocher 467ba597609SBenoît Thébaudeau$(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin 46871f84ef0SMasahiro Yamada $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ 469ba597609SBenoît Thébaudeau $(OBJTREE)/u-boot-with-spl.imx 470ba597609SBenoît Thébaudeau 4717d5a5c79SBenoît Thébaudeau$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin 47271f84ef0SMasahiro Yamada $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ 4737d5a5c79SBenoît Thébaudeau $(OBJTREE)/u-boot-with-nand-spl.imx 4747d5a5c79SBenoît Thébaudeau 4755364add4SScott Wood$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin 476277f00f5SJosé Miguel Gonçalves $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ 4775364add4SScott Wood -e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl 478277f00f5SJosé Miguel Gonçalves 4793f7f2414STom Rini$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img 4806d660e77SSughosh Ganu $(obj)tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") \ 4816d660e77SSughosh Ganu -T aisimage \ 482d36d8859SChristian Riesch -e $(CONFIG_SPL_TEXT_BASE) \ 483d36d8859SChristian Riesch -d $(obj)spl/u-boot-spl.bin \ 484d36d8859SChristian Riesch $(obj)spl/u-boot-spl.ais 485d36d8859SChristian Riesch $(OBJCOPY) ${OBJCFLAGS} -I binary \ 486d36d8859SChristian Riesch --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ 487d36d8859SChristian Riesch $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais 4883f7f2414STom Rini cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \ 489d36d8859SChristian Riesch $(obj)u-boot.ais 490d36d8859SChristian Riesch 491a5453555SOtavio Salvador 49230b9b932SMarek Vasut$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin 493*edabc1bcSMasahiro Yamada $(MAKE) $(build) $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb 49430b9b932SMarek Vasut 49594aebe6cSStefan Roese# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. 49694aebe6cSStefan Roese# Both images are created using mkimage (crc etc), so that the ROM 49794aebe6cSStefan Roese# bootloader can check its integrity. Padding needs to be done to the 49894aebe6cSStefan Roese# SPL image (with mkimage header) and not the binary. Otherwise the resulting image 49994aebe6cSStefan Roese# which is loaded/copied by the ROM bootloader to SRAM doesn't fit. 50094aebe6cSStefan Roese# The resulting image containing both U-Boot images is called u-boot.spr 50194aebe6cSStefan Roese$(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin 50294aebe6cSStefan Roese $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \ 50394aebe6cSStefan Roese -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \ 50494aebe6cSStefan Roese -d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img 50594aebe6cSStefan Roese tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \ 50694aebe6cSStefan Roese of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null 50794aebe6cSStefan Roese dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \ 50894aebe6cSStefan Roese conv=notrunc 2>/dev/null 50994aebe6cSStefan Roese cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@ 51094aebe6cSStefan Roese 5116d6c0baeSTom Warrenifneq ($(CONFIG_TEGRA),) 5129972db5cSStephen Warren$(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin 513e4ec9346SStephen Warren $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin 5149972db5cSStephen Warren cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@ 515e4ec9346SStephen Warren rm $(obj)spl/u-boot-spl-pad.bin 5169972db5cSStephen Warren 5179972db5cSStephen Warrenifeq ($(CONFIG_OF_SEPARATE),y) 5189972db5cSStephen Warren$(obj)u-boot-dtb-tegra.bin: $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb 5199972db5cSStephen Warren cat $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb > $@ 5209972db5cSStephen Warrenendif 521984df4ecSAllen Martinendif 522984df4ecSAllen Martin 523fb3d2b8aSStefan Roese$(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img 524fb3d2b8aSStefan Roese cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@ 525fb3d2b8aSStefan Roese 526ecddccd0SStefan Roese# PPC4xx needs the SPL at the end of the image, since the reset vector 527ecddccd0SStefan Roese# is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target 528ecddccd0SStefan Roese# and need to introduce a new build target with the full blown U-Boot 529ecddccd0SStefan Roese# at the start padded up to the start of the SPL image. And then concat 530ecddccd0SStefan Roese# the SPL image to the end. 531ecddccd0SStefan Roese$(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img 532ecddccd0SStefan Roese tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_UBOOT_PAD_TO) \ 533ecddccd0SStefan Roese of=$(obj)u-boot-pad.img 2>/dev/null 534ecddccd0SStefan Roese dd if=$(obj)u-boot.img of=$(obj)u-boot-pad.img \ 535ecddccd0SStefan Roese conv=notrunc 2>/dev/null 536ecddccd0SStefan Roese cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@ 537ecddccd0SStefan Roese 53886eb49b3SSimon Glassifeq ($(CONFIG_SANDBOX),y) 53986eb49b3SSimon GlassGEN_UBOOT = \ 54086eb49b3SSimon Glass cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ 54186eb49b3SSimon Glass -Wl,--start-group $(__LIBS) -Wl,--end-group \ 54286eb49b3SSimon Glass $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot 54386eb49b3SSimon Glasselse 544ecb1dc89SMike FrysingerGEN_UBOOT = \ 54597b24d3dSMarek Vasut cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \ 546ef123c52SAlbert ARIBAUD $(__OBJS) \ 547f9328639SMarian Balakowicz --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ 548b2184c31Swdenk -Map u-boot.map -o u-boot 54986eb49b3SSimon Glassendif 55086eb49b3SSimon Glass 55116a354f9SWolfgang Denk$(obj)u-boot: depend \ 552349e83f0SChe-liang Chiou $(SUBDIR_TOOLS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds 553ecb1dc89SMike Frysinger $(GEN_UBOOT) 554ecb1dc89SMike Frysingerifeq ($(CONFIG_KALLSYMS),y) 5558a156fb6SMike Frysinger smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \ 5561aada9cdSWolfgang Denk awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \ 5571aada9cdSWolfgang Denk $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \ 5581aada9cdSWolfgang Denk -c common/system_map.c -o $(obj)common/system_map.o 559ecb1dc89SMike Frysinger $(GEN_UBOOT) $(obj)common/system_map.o 560ecb1dc89SMike Frysingerendif 5617ebf7443Swdenk 5623bddafaaSMasahiro Yamada$(OBJS): 5633bddafaaSMasahiro Yamada @: 564f9328639SMarian Balakowicz 565349e83f0SChe-liang Chiou$(LIBS): depend $(SUBDIR_TOOLS) 5663bddafaaSMasahiro Yamada $(MAKE) $(build) $(dir $(subst $(obj),,$@)) 5673bddafaaSMasahiro Yamada mv $(dir $@)built-in.o $@ 568a8c7c708Swdenk 569d0d6144eSPeter Tyser$(LIBBOARD): depend $(LIBS) 5703bddafaaSMasahiro Yamada $(MAKE) $(build) $(dir $(subst $(obj),,$@)) 5713bddafaaSMasahiro Yamada mv $(dir $@)built-in.o $@ 572de109d90SWolfgang Denk 573d0d6144eSPeter Tyser$(SUBDIRS): depend 574b028f715Swdenk $(MAKE) -C $@ all 5757ebf7443Swdenk 576349e83f0SChe-liang Chiou$(SUBDIR_EXAMPLES): $(obj)u-boot 577349e83f0SChe-liang Chiou 578d0d6144eSPeter Tyser$(LDSCRIPT): depend 579f65c9812SMike Frysinger $(MAKE) -C $(dir $@) $(notdir $@) 580f65c9812SMike Frysinger 581ef123c52SAlbert ARIBAUD$(obj)u-boot.lds: $(LDSCRIPT) 58297b24d3dSMarek Vasut $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@ 5831aada9cdSWolfgang Denk 584e935a374SHaiying Wangnand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend 5858318fbf8SMarian Balakowicz $(MAKE) -C nand_spl/board/$(BOARDDIR) all 586887e2ec9SStefan Roese 587e935a374SHaiying Wang$(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin 5888318fbf8SMarian Balakowicz cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin 589887e2ec9SStefan Roese 590bd25fdbaSAneesh V$(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend 5915df2ee27SDaniel Schwierzeck $(MAKE) -C spl all 5925df2ee27SDaniel Schwierzeck 5933aa29de0SYing Zhang$(obj)tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend 5943aa29de0SYing Zhang $(MAKE) -C spl all CONFIG_TPL_BUILD=y 5953aa29de0SYing Zhang 596f9328639SMarian Balakowiczupdater: 5970358df42SMike Frysinger $(MAKE) -C tools/updater all 5988f713fdfSdzu 5992a998793SDaniel Hobi# Explicitly make _depend in subdirs containing multiple targets to prevent 6002a998793SDaniel Hobi# parallel sub-makes creating .depend files simultaneously. 60116a354f9SWolfgang Denkdepend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ 60239bc12ddSJoel Fernandes $(obj)include/spl-autoconf.mk \ 6033aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk \ 60416a354f9SWolfgang Denk $(obj)include/autoconf.mk \ 605a4814a69SStefano Babic $(obj)include/generated/generic-asm-offsets.h \ 606a4814a69SStefano Babic $(obj)include/generated/asm-offsets.h 6077ebf7443Swdenk 608e5e4e705SLi YangTAG_SUBDIRS = $(SUBDIRS) 609e5e4e705SLi YangTAG_SUBDIRS += $(dir $(__LIBS)) 610a340c325SJean-Christophe PLAGNIOL-VILLARDTAG_SUBDIRS += include 611a340c325SJean-Christophe PLAGNIOL-VILLARD 612857d9ea6SHorst KronstorferFIND := find 613857d9ea6SHorst KronstorferFINDFLAGS := -L 614857d9ea6SHorst Kronstorfer 6151064d980STom Rinicheckstack: 6161064d980STom Rini $(CROSS_COMPILE)objdump -d $(obj)u-boot \ 6171064d980STom Rini `$(FIND) $(obj) -name u-boot-spl -print` | \ 6181064d980STom Rini perl $(src)tools/checkstack.pl $(ARCH) 6191064d980STom Rini 620f9328639SMarian Balakowicztags ctags: 621857d9ea6SHorst Kronstorfer ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ 622e5e4e705SLi Yang -name '*.[chS]' -print` 6237ebf7443Swdenk 6247ebf7443Swdenketags: 625857d9ea6SHorst Kronstorfer etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ 626e5e4e705SLi Yang -name '*.[chS]' -print` 627ffda586fSLi Yangcscope: 628857d9ea6SHorst Kronstorfer $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \ 629857d9ea6SHorst Kronstorfer cscope.files 630ffda586fSLi Yang cscope -b -q -k 6317ebf7443Swdenk 632ecb1dc89SMike FrysingerSYSTEM_MAP = \ 633ecb1dc89SMike Frysinger $(NM) $1 | \ 6347ebf7443Swdenk grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ 635ecb1dc89SMike Frysinger LC_ALL=C sort 636ecb1dc89SMike Frysinger$(obj)System.map: $(obj)u-boot 637ecb1dc89SMike Frysinger @$(call SYSTEM_MAP,$<) > $(obj)System.map 6387ebf7443Swdenk 63906a119a0STom Rinicheckthumb: 64006a119a0STom Rini @if test $(call cc-version) -lt 0404; then \ 64106a119a0STom Rini echo -n '*** Your GCC does not produce working '; \ 64206a119a0STom Rini echo 'binaries in THUMB mode.'; \ 64306a119a0STom Rini echo '*** Your board is configured for THUMB mode.'; \ 64406a119a0STom Rini false; \ 64506a119a0STom Rini fi 6466ec63f41SScott Wood 6476ec63f41SScott Wood# GCC 3.x is reported to have problems generating the type of relocation 6486ec63f41SScott Wood# that U-Boot wants. 6496ec63f41SScott Wood# See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html 6506ec63f41SScott Woodcheckgcc4: 6516ec63f41SScott Wood @if test $(call cc-version) -lt 0400; then \ 6526ec63f41SScott Wood echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \ 6536ec63f41SScott Wood false; \ 6546ec63f41SScott Wood fi 6556ec63f41SScott Wood 656501ebdf2SStephen Warrencheckdtc: 657501ebdf2SStephen Warren @if test $(call dtc-version) -lt 0104; then \ 658501ebdf2SStephen Warren echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \ 659501ebdf2SStephen Warren false; \ 660501ebdf2SStephen Warren fi 661501ebdf2SStephen Warren 6622f155f6cSGrant Likely# 6632f155f6cSGrant Likely# Auto-generate the autoconf.mk file (which is included by all makefiles) 6642f155f6cSGrant Likely# 6652f155f6cSGrant Likely# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep. 6662f155f6cSGrant Likely# the dep file is only include in this top level makefile to determine when 6672f155f6cSGrant Likely# to regenerate the autoconf.mk file. 6681510b82dSWolfgang Denk$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h 6691510b82dSWolfgang Denk @$(XECHO) Generating $@ ; \ 67016fe7775SMike Frysinger set -e ; \ 671ae6d1056SWolfgang Denk : Generate the dependancies ; \ 6724c34b2a0SMike Frysinger $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \ 6731510b82dSWolfgang Denk -MQ $(obj)include/autoconf.mk include/common.h > $@ 6741510b82dSWolfgang Denk 6751510b82dSWolfgang Denk$(obj)include/autoconf.mk: $(obj)include/config.h 6761510b82dSWolfgang Denk @$(XECHO) Generating $@ ; \ 6771510b82dSWolfgang Denk set -e ; \ 678ae6d1056SWolfgang Denk : Extract the config macros ; \ 6791510b82dSWolfgang Denk $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \ 6804a0f7538SWolfgang Denk sed -n -f tools/scripts/define2mk.sed > $@.tmp && \ 6814a0f7538SWolfgang Denk mv $@.tmp $@ 6822f155f6cSGrant Likely 68339bc12ddSJoel Fernandes# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL) 6843aa29de0SYing Zhang$(obj)include/tpl-autoconf.mk: $(obj)include/config.h 6853aa29de0SYing Zhang @$(XECHO) Generating $@ ; \ 6863aa29de0SYing Zhang set -e ; \ 6873aa29de0SYing Zhang : Extract the config macros ; \ 6883aa29de0SYing Zhang $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\ 6893aa29de0SYing Zhang -DDO_DEPS_ONLY -dM include/common.h | \ 6903aa29de0SYing Zhang sed -n -f tools/scripts/define2mk.sed > $@.tmp && \ 6913aa29de0SYing Zhang mv $@.tmp $@ 6923aa29de0SYing Zhang 69339bc12ddSJoel Fernandes$(obj)include/spl-autoconf.mk: $(obj)include/config.h 69439bc12ddSJoel Fernandes @$(XECHO) Generating $@ ; \ 69539bc12ddSJoel Fernandes set -e ; \ 69639bc12ddSJoel Fernandes : Extract the config macros ; \ 69739bc12ddSJoel Fernandes $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h | \ 69839bc12ddSJoel Fernandes sed -n -f tools/scripts/define2mk.sed > $@.tmp && \ 69939bc12ddSJoel Fernandes mv $@.tmp $@ 70039bc12ddSJoel Fernandes 70116a354f9SWolfgang Denk$(obj)include/generated/generic-asm-offsets.h: $(obj)include/autoconf.mk.dep \ 70239bc12ddSJoel Fernandes $(obj)include/spl-autoconf.mk \ 7033aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk \ 70416a354f9SWolfgang Denk $(obj)lib/asm-offsets.s 70516a354f9SWolfgang Denk @$(XECHO) Generating $@ 70616a354f9SWolfgang Denk tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@ 70716a354f9SWolfgang Denk 70816a354f9SWolfgang Denk$(obj)lib/asm-offsets.s: $(obj)include/autoconf.mk.dep \ 70939bc12ddSJoel Fernandes $(obj)include/spl-autoconf.mk \ 7103aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk \ 71116a354f9SWolfgang Denk $(src)lib/asm-offsets.c 71216a354f9SWolfgang Denk @mkdir -p $(obj)lib 71316a354f9SWolfgang Denk $(CC) -DDO_DEPS_ONLY \ 71416a354f9SWolfgang Denk $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ 71516a354f9SWolfgang Denk -o $@ $(src)lib/asm-offsets.c -c -S 71616a354f9SWolfgang Denk 717a4814a69SStefano Babic$(obj)include/generated/asm-offsets.h: $(obj)include/autoconf.mk.dep \ 71839bc12ddSJoel Fernandes $(obj)include/spl-autoconf.mk \ 7193aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk \ 720a4814a69SStefano Babic $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s 721b12734eeSWolfgang Denk @$(XECHO) Generating $@ 722a4814a69SStefano Babic tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@ 723a4814a69SStefano Babic 72439bc12ddSJoel Fernandes$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/autoconf.mk.dep \ 7253aa29de0SYing Zhang $(obj)include/spl-autoconf.mk \ 7263aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk 727a4814a69SStefano Babic @mkdir -p $(obj)$(CPUDIR)/$(SOC) 728a4814a69SStefano Babic if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ 729a4814a69SStefano Babic $(CC) -DDO_DEPS_ONLY \ 730a4814a69SStefano Babic $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ 731a4814a69SStefano Babic -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \ 732a4814a69SStefano Babic else \ 733a4814a69SStefano Babic touch $@; \ 734a4814a69SStefano Babic fi 735a4814a69SStefano Babic 7367ebf7443Swdenk######################################################################### 737ae6d1056SWolfgang Denkelse # !config.mk 738f9328639SMarian Balakowiczall $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ 739f9328639SMarian Balakowicz$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \ 740249b53a6SLoïc Minier$(filter-out tools,$(SUBDIRS)) \ 7410358df42SMike Frysingerupdater depend dep tags ctags etags cscope $(obj)System.map: 7427ebf7443Swdenk @echo "System not configured - see README" >&2 7437ebf7443Swdenk @ exit 1 744c7c0d542SMike Frysinger 745249b53a6SLoïc Miniertools: $(VERSION_FILE) $(TIMESTAMP_FILE) 7460358df42SMike Frysinger $(MAKE) -C $@ all 747ae6d1056SWolfgang Denkendif # config.mk 7487ebf7443Swdenk 749c37980c3SAlbert ARIBAUD# ARM relocations should all be R_ARM_RELATIVE. 750c37980c3SAlbert ARIBAUDcheckarmreloc: $(obj)u-boot 751c37980c3SAlbert ARIBAUD @if test "R_ARM_RELATIVE" != \ 752c1273d71SAndreas Bießmann "`$(CROSS_COMPILE)readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \ 753c37980c3SAlbert ARIBAUD then echo "$< contains relocations other than \ 754c37980c3SAlbert ARIBAUD R_ARM_RELATIVE"; false; fi 755c37980c3SAlbert ARIBAUD 75628abd48fSIlya Yanok$(VERSION_FILE): 75714ce91b1SMike Frysinger @mkdir -p $(dir $(VERSION_FILE)) 75828abd48fSIlya Yanok @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ 75928abd48fSIlya Yanok printf '#define PLAIN_VERSION "%s%s"\n' \ 76028abd48fSIlya Yanok "$(U_BOOT_VERSION)" "$${localvers}" ; \ 76128abd48fSIlya Yanok printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ 76228abd48fSIlya Yanok "$(U_BOOT_VERSION)" "$${localvers}" ; \ 76328abd48fSIlya Yanok ) > $@.tmp 76428abd48fSIlya Yanok @( printf '#define CC_VERSION_STRING "%s"\n' \ 76528abd48fSIlya Yanok '$(shell $(CC) --version | head -n 1)' )>> $@.tmp 76628abd48fSIlya Yanok @( printf '#define LD_VERSION_STRING "%s"\n' \ 76728abd48fSIlya Yanok '$(shell $(LD) -v | head -n 1)' )>> $@.tmp 76828abd48fSIlya Yanok @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ 76928abd48fSIlya Yanok 770249b53a6SLoïc Minier$(TIMESTAMP_FILE): 771249b53a6SLoïc Minier @mkdir -p $(dir $(TIMESTAMP_FILE)) 772a76406fbSLoïc Minier @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp 773a76406fbSLoïc Minier @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp 774a76406fbSLoïc Minier @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ 775249b53a6SLoïc Minier 7760358df42SMike Frysingereasylogo env gdb: 7770358df42SMike Frysinger $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} 7780358df42SMike Frysingergdbtools: gdb 7790358df42SMike Frysinger 78030ff8918SMarek Vasutxmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc 78130ff8918SMarek Vasut $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@ 78230ff8918SMarek Vasut 783249b53a6SLoïc Miniertools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) 7840358df42SMike Frysinger $(MAKE) -C tools HOST_TOOLS_ALL=y 7850358df42SMike Frysinger 7864e53a258SWolfgang Denk.PHONY : CHANGELOG 7874e53a258SWolfgang DenkCHANGELOG: 788b985b5d6SBen Warren git log --no-merges U-Boot-1_1_5.. | \ 789b985b5d6SBen Warren unexpand -a | sed -e 's/\s\s*$$//' > $@ 7904e53a258SWolfgang Denk 7910a823aa2SHarald Welteinclude/license.h: tools/bin2header COPYING 7920a823aa2SHarald Welte cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h 7937ebf7443Swdenk######################################################################### 7947ebf7443Swdenk 7957ebf7443Swdenkunconfig: 796887e2ec9SStefan Roese @rm -f $(obj)include/config.h $(obj)include/config.mk \ 7972f155f6cSGrant Likely $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \ 79839bc12ddSJoel Fernandes $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep \ 7993aa29de0SYing Zhang $(obj)include/spl-autoconf.mk \ 8003aa29de0SYing Zhang $(obj)include/tpl-autoconf.mk 8017ebf7443Swdenk 802a6862bc1SWolfgang Denk%_config:: unconfig 803a6862bc1SWolfgang Denk @$(MKCONFIG) -A $(@:_config=) 804a6862bc1SWolfgang Denk 805d6a5e6d5SLoïc Miniersinclude $(obj).boards.depend 806d6a5e6d5SLoïc Minier$(obj).boards.depend: boards.cfg 80750c2a91bSMasahiro Yamada @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@ 8089f4a4206SMike Frysinger 8098c994630SWolfgang Denk# 8108c994630SWolfgang Denk# Functions to generate common board directory names 8118c994630SWolfgang Denk# 8128c994630SWolfgang Denklcname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/') 8138c994630SWolfgang Denkucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/') 8148c994630SWolfgang Denk 815699f0512SWolfgang Denk######################################################################### 8163e38691eSwdenk######################################################################### 8177ebf7443Swdenk 8187ebf7443Swdenkclean: 8191bc15386SPeter Tyser @rm -f $(obj)examples/standalone/82559_eeprom \ 820d640ac58SWolfgang Denk $(obj)examples/standalone/atmel_df_pow2 \ 8211bc15386SPeter Tyser $(obj)examples/standalone/eepro100_eeprom \ 8221bc15386SPeter Tyser $(obj)examples/standalone/hello_world \ 8231bc15386SPeter Tyser $(obj)examples/standalone/interrupt \ 8241bc15386SPeter Tyser $(obj)examples/standalone/mem_to_mem_idma2intr \ 8251bc15386SPeter Tyser $(obj)examples/standalone/sched \ 826201a017cSMike Frysinger $(obj)examples/standalone/smc911{11,x}_eeprom \ 8271bc15386SPeter Tyser $(obj)examples/standalone/test_burst \ 8281bc15386SPeter Tyser $(obj)examples/standalone/timer 829d4abc757SPeter Tyser @rm -f $(obj)examples/api/demo{,.bin} 830f9301e1cSWolfgang Denk @rm -f $(obj)tools/bmp_logo $(obj)tools/easylogo/easylogo \ 831f9301e1cSWolfgang Denk $(obj)tools/env/{fw_printenv,fw_setenv} \ 832f9301e1cSWolfgang Denk $(obj)tools/envcrc \ 833f9301e1cSWolfgang Denk $(obj)tools/gdb/{astest,gdbcont,gdbsend} \ 834f9301e1cSWolfgang Denk $(obj)tools/gen_eth_addr $(obj)tools/img2srec \ 8357717fe10SHorst Kronstorfer $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ 836ad403e71SChander Kashyap $(obj)tools/mk{$(BOARD),}spl \ 8378aa09026SMarek Vasut $(obj)tools/mxsboot \ 83830ff8918SMarek Vasut $(obj)tools/ncb $(obj)tools/ubsha1 \ 8396c887b2aSSimon Glass $(obj)tools/kernel-doc/docproc \ 8406c887b2aSSimon Glass $(obj)tools/proftool 841f9301e1cSWolfgang Denk @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ 84274c7a95fSWolfgang Denk $(obj)board/matrix_vision/*/bootscript.img \ 843566e5cf4SWolfgang Denk $(obj)board/voiceblue/eeprom \ 8441aada9cdSWolfgang Denk $(obj)u-boot.lds \ 845fb5166ceSMike Frysinger $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs] \ 846fb5166ceSMike Frysinger $(obj)arch/blackfin/cpu/init.{lds,elf} 847dc7746d8SWolfgang Denk @rm -f $(obj)include/bmp_logo.h 848c270730fSChe-Liang Chiou @rm -f $(obj)include/bmp_logo_data.h 84916a354f9SWolfgang Denk @rm -f $(obj)lib/asm-offsets.s 850a4814a69SStefano Babic @rm -f $(obj)include/generated/asm-offsets.h 851a4814a69SStefano Babic @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s 852d4abc757SPeter Tyser @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) 853b3141fdbSAndreas Bießmann @$(MAKE) -s -C doc/DocBook/ cleandocs 854ae6d1056SWolfgang Denk @find $(OBJTREE) -type f \ 8554a30f1e8STom Rini \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ 85671a988aaSTroy Kisky -o -name '*.o' -o -name '*.a' -o -name '*.exe' \ 85771a988aaSTroy Kisky -o -name '*.cfgtmp' \) -print \ 8587ebf7443Swdenk | xargs rm -f 8597ebf7443Swdenk 860734329f9SAndy Fleming# Removes everything not needed for testing u-boot 861734329f9SAndy Flemingtidy: clean 862734329f9SAndy Fleming @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f 863734329f9SAndy Fleming 864734329f9SAndy Flemingclobber: tidy 865734329f9SAndy Fleming @find $(OBJTREE) -type f \( -name '*.srec' \ 866734329f9SAndy Fleming -o -name '*.bin' -o -name u-boot.img \) \ 867734329f9SAndy Fleming -print0 | xargs -0 rm -f 868ffda586fSLi Yang @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \ 8695013c09fSWolfgang Denk $(obj)cscope.* $(obj)*.*~ 8704e0fbb98SDaniel Schwierzeck @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y) 871aa0c7a86SPrafulla Wadaskar @rm -f $(obj)u-boot.kwb 8725d898a00SShaohui Xie @rm -f $(obj)u-boot.pbl 873c5fb70c9SStefano Babic @rm -f $(obj)u-boot.imx 874ba597609SBenoît Thébaudeau @rm -f $(obj)u-boot-with-spl.imx 8757d5a5c79SBenoît Thébaudeau @rm -f $(obj)u-boot-with-nand-spl.imx 8767816f2cfSHeiko Schocher @rm -f $(obj)u-boot.ubl 877d36d8859SChristian Riesch @rm -f $(obj)u-boot.ais 878bbb0b128SSimon Glass @rm -f $(obj)u-boot.dtb 87930b9b932SMarek Vasut @rm -f $(obj)u-boot.sb 880714dc001SMarek Vasut @rm -f $(obj)u-boot.bd 88194aebe6cSStefan Roese @rm -f $(obj)u-boot.spr 88297b24d3dSMarek Vasut @rm -f $(obj)nand_spl/{u-boot.{lds,lst},System.map} 88397b24d3dSMarek Vasut @rm -f $(obj)nand_spl/{u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map} 88497b24d3dSMarek Vasut @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.map} 885ef123c52SAlbert ARIBAUD @rm -f $(obj)spl/u-boot-spl.lds 8863aa29de0SYing Zhang @rm -f $(obj)tpl/{u-boot-tpl,u-boot-tpl.bin,u-boot-tpl.map} 8873aa29de0SYing Zhang @rm -f $(obj)tpl/u-boot-spl.lds 88894bcfe52SNishanth Menon @rm -f $(obj)MLO MLO.byteswap 889a3cbc396SStefano Babic @rm -f $(obj)SPL 8908b425b3fSDaniel Schwierzeck @rm -f $(obj)tools/xway-swap-bytes 891a47a12beSStefan Roese @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c 8922d14e36aSYork Sun @rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c 893a9d8bc98SLoïc Minier @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm 89416a354f9SWolfgang Denk @rm -fr $(obj)include/generated 895a958b663SJean-Christophe PLAGNIOL-VILLARD @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f 896bbb0b128SSimon Glass @rm -f $(obj)dts/*.tmp 8976d660e77SSughosh Ganu @rm -f $(obj)spl/u-boot-spl{,-pad}.ais 8987ebf7443Swdenk 8997ebf7443Swdenkmrproper \ 9007ebf7443Swdenkdistclean: clobber unconfig 901afd077bdSMike Frysingerifneq ($(OBJTREE),$(SRCTREE)) 902ae6d1056SWolfgang Denk rm -rf $(obj)* 903f9328639SMarian Balakowiczendif 9047ebf7443Swdenk 9057ebf7443Swdenkbackup: 9067ebf7443Swdenk F=`basename $(TOPDIR)` ; cd .. ; \ 907d6b93714SIlya Yanok gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F 9087ebf7443Swdenk 9097ebf7443Swdenk######################################################################### 910