wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1 | # |
Wolfgang Denk | eca3aeb | 2013-06-21 10:22:36 +0200 | [diff] [blame] | 2 | # (C) Copyright 2000-2013 |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | eca3aeb | 2013-06-21 10:22:36 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 6 | # |
| 7 | |
Tom Rini | d19ad72 | 2013-11-25 16:49:32 -0500 | [diff] [blame] | 8 | VERSION = 2014 |
| 9 | PATCHLEVEL = 01 |
Wolfgang Denk | 211e475 | 2012-07-10 09:21:12 +0200 | [diff] [blame] | 10 | SUBLEVEL = |
Tom Rini | b44bd2c | 2014-01-20 17:52:59 -0500 | [diff] [blame] | 11 | EXTRAVERSION = |
Wolfgang Denk | 8b9e478 | 2008-09-09 23:55:18 +0200 | [diff] [blame] | 12 | ifneq "$(SUBLEVEL)" "" |
Wolfgang Denk | 881a87e | 2006-02-21 17:33:04 +0100 | [diff] [blame] | 13 | U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
Wolfgang Denk | 8b9e478 | 2008-09-09 23:55:18 +0200 | [diff] [blame] | 14 | else |
| 15 | U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) |
| 16 | endif |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 17 | TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h |
| 18 | VERSION_FILE = include/generated/version_autogenerated.h |
Wolfgang Denk | 881a87e | 2006-02-21 17:33:04 +0100 | [diff] [blame] | 19 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 20 | HOSTARCH := $(shell uname -m | \ |
Graeme Russ | fea2572 | 2011-04-13 19:43:28 +1000 | [diff] [blame] | 21 | sed -e s/i.86/x86/ \ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 22 | -e s/sun4u/sparc64/ \ |
| 23 | -e s/arm.*/arm/ \ |
| 24 | -e s/sa110/arm/ \ |
Kumar Gala | d017908 | 2010-04-28 02:52:02 -0500 | [diff] [blame] | 25 | -e s/ppc64/powerpc/ \ |
| 26 | -e s/ppc/powerpc/ \ |
Nobuhiro Iwamatsu | 8d1f635 | 2010-06-16 07:59:17 +0900 | [diff] [blame] | 27 | -e s/macppc/powerpc/\ |
| 28 | -e s/sh.*/sh/) |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 29 | |
Wolfgang Denk | f9d77ed | 2005-08-12 23:23:46 +0200 | [diff] [blame] | 30 | HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 31 | sed -e 's/\(cygwin\).*/cygwin/') |
| 32 | |
Benoît Thébaudeau | 120ae60 | 2013-04-11 09:35:54 +0000 | [diff] [blame] | 33 | export HOSTARCH HOSTOS |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 34 | |
| 35 | # Deal with colliding definitions from tcsh etc. |
| 36 | VENDOR= |
| 37 | |
| 38 | ######################################################################### |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 39 | # Allow for silent builds |
| 40 | ifeq (,$(findstring s,$(MAKEFLAGS))) |
| 41 | XECHO = echo |
| 42 | else |
| 43 | XECHO = : |
| 44 | endif |
| 45 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 46 | # kbuild supports saving output files in a separate directory. |
| 47 | # To locate output files in a separate directory two syntaxes are supported. |
| 48 | # In both cases the working directory must be the root of the kernel src. |
| 49 | # 1) O= |
| 50 | # Use "make O=dir/to/store/output/files/" |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 51 | # |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 52 | # 2) Set KBUILD_OUTPUT |
| 53 | # Set the environment variable KBUILD_OUTPUT to point to the directory |
| 54 | # where the output files shall be placed. |
| 55 | # export KBUILD_OUTPUT=dir/to/store/output/files/ |
| 56 | # make |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 57 | # |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 58 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment |
| 59 | # variable. |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 60 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 61 | |
| 62 | # KBUILD_SRC is set on invocation of make in OBJ directory |
| 63 | # KBUILD_SRC is not intended to be used by the regular user (for now) |
| 64 | ifeq ($(KBUILD_SRC),) |
| 65 | |
| 66 | # OK, Make called in directory where kernel src resides |
| 67 | # Do we want to locate output files in a separate directory? |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 68 | ifeq ("$(origin O)", "command line") |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 69 | KBUILD_OUTPUT := $(O) |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 70 | endif |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 71 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 72 | ifeq ("$(origin W)", "command line") |
| 73 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) |
| 74 | endif |
| 75 | |
| 76 | # That's our default target when none is given on the command line |
| 77 | PHONY := _all |
| 78 | _all: |
| 79 | |
| 80 | # Cancel implicit rules on top Makefile |
| 81 | $(CURDIR)/Makefile Makefile: ; |
| 82 | |
| 83 | ifneq ($(KBUILD_OUTPUT),) |
| 84 | # Invoke a second make in the output directory, passing relevant variables |
| 85 | # check that the output directory actually exists |
| 86 | saved-output := $(KBUILD_OUTPUT) |
| 87 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
| 88 | $(if $(KBUILD_OUTPUT),, \ |
| 89 | $(error output directory "$(saved-output)" does not exist)) |
| 90 | |
| 91 | PHONY += $(MAKECMDGOALS) sub-make |
| 92 | |
| 93 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
| 94 | @: |
| 95 | |
| 96 | sub-make: FORCE |
| 97 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
| 98 | KBUILD_SRC=$(CURDIR) \ |
| 99 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ |
| 100 | $(filter-out _all sub-make,$(MAKECMDGOALS)) |
| 101 | |
| 102 | # Leave processing to above invocation of make |
| 103 | skip-makefile := 1 |
| 104 | endif # ifneq ($(KBUILD_OUTPUT),) |
| 105 | endif # ifeq ($(KBUILD_SRC),) |
| 106 | |
| 107 | # We process the rest of the Makefile if this is the final invocation of make |
| 108 | ifeq ($(skip-makefile),) |
| 109 | |
| 110 | PHONY += all |
| 111 | _all: all |
| 112 | |
| 113 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
| 114 | objtree := $(CURDIR) |
| 115 | src := $(srctree) |
| 116 | obj := $(objtree) |
| 117 | |
| 118 | VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) |
| 119 | |
| 120 | export srctree objtree VPATH |
| 121 | |
Kim Phillips | 4ab6493 | 2012-09-21 12:28:17 +0000 | [diff] [blame] | 122 | # Call a source code checker (by default, "sparse") as part of the |
| 123 | # C compilation. |
| 124 | # |
| 125 | # Use 'make C=1' to enable checking of re-compiled files. |
| 126 | # |
| 127 | # See the linux kernel file "Documentation/sparse.txt" for more details, |
| 128 | # including where to get the "sparse" utility. |
| 129 | |
| 130 | ifdef C |
| 131 | ifeq ("$(origin C)", "command line") |
| 132 | CHECKSRC := $(C) |
| 133 | endif |
| 134 | endif |
| 135 | ifndef CHECKSRC |
| 136 | CHECKSRC = 0 |
| 137 | endif |
| 138 | export CHECKSRC |
| 139 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 140 | OBJTREE := $(objtree) |
Daniel Schwierzeck | c8f9c30 | 2011-07-18 06:09:15 +0000 | [diff] [blame] | 141 | SPLTREE := $(OBJTREE)/spl |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 142 | TPLTREE := $(OBJTREE)/tpl |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 143 | SRCTREE := $(srctree) |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 144 | TOPDIR := $(SRCTREE) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 145 | export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 146 | |
| 147 | MKCONFIG := $(SRCTREE)/mkconfig |
| 148 | export MKCONFIG |
| 149 | |
Wolfgang Denk | 5013c09 | 2008-03-02 22:45:33 +0100 | [diff] [blame] | 150 | # Make sure CDPATH settings don't interfere |
| 151 | unexport CDPATH |
| 152 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 153 | ######################################################################### |
| 154 | |
Mike Frysinger | 6d1ce38 | 2009-05-30 01:02:03 -0400 | [diff] [blame] | 155 | # The "tools" are needed early, so put this first |
| 156 | # Don't include stuff already done in $(LIBS) |
Che-liang Chiou | 349e83f | 2011-10-17 21:04:15 +0000 | [diff] [blame] | 157 | # The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC |
| 158 | # is "yes"), so compile examples after U-Boot is compiled. |
| 159 | SUBDIR_TOOLS = tools |
Che-liang Chiou | 349e83f | 2011-10-17 21:04:15 +0000 | [diff] [blame] | 160 | SUBDIRS = $(SUBDIR_TOOLS) |
Mike Frysinger | 6d1ce38 | 2009-05-30 01:02:03 -0400 | [diff] [blame] | 161 | |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 162 | .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE) |
Mike Frysinger | 6d1ce38 | 2009-05-30 01:02:03 -0400 | [diff] [blame] | 163 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 164 | ifeq (include/config.mk,$(wildcard include/config.mk)) |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 165 | |
Mike Frysinger | 2632c00 | 2009-07-21 22:59:36 -0400 | [diff] [blame] | 166 | # Include autoconf.mk before config.mk so that the config options are available |
| 167 | # to all top level build files. We need the dummy all: target to prevent the |
| 168 | # dependency target in autoconf.mk.dep from being the default. |
| 169 | all: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 170 | sinclude include/autoconf.mk.dep |
| 171 | sinclude include/autoconf.mk |
Mike Frysinger | 2632c00 | 2009-07-21 22:59:36 -0400 | [diff] [blame] | 172 | |
Masahiro Yamada | 8a7e7d5 | 2013-11-18 11:08:35 +0900 | [diff] [blame] | 173 | SUBDIR_EXAMPLES-y := examples/standalone |
| 174 | SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api |
Simon Glass | b572875 | 2011-10-25 11:29:28 +0000 | [diff] [blame] | 175 | ifndef CONFIG_SANDBOX |
Masahiro Yamada | 8a7e7d5 | 2013-11-18 11:08:35 +0900 | [diff] [blame] | 176 | SUBDIRS += $(SUBDIR_EXAMPLES-y) |
Simon Glass | b572875 | 2011-10-25 11:29:28 +0000 | [diff] [blame] | 177 | endif |
| 178 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 179 | # load ARCH, BOARD, and CPU configuration |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 180 | include include/config.mk |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 181 | export ARCH CPU BOARD VENDOR SOC |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 182 | |
Mike Frysinger | 1ea6bcd | 2009-06-14 23:33:14 -0400 | [diff] [blame] | 183 | # set default to nothing for native builds |
Wolfgang Denk | a5284ef | 2007-03-06 18:01:47 +0100 | [diff] [blame] | 184 | ifeq ($(HOSTARCH),$(ARCH)) |
Mike Frysinger | 1ea6bcd | 2009-06-14 23:33:14 -0400 | [diff] [blame] | 185 | CROSS_COMPILE ?= |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 186 | endif |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 187 | |
Masahiro Yamada | f6322eb | 2014-02-04 17:24:15 +0900 | [diff] [blame] | 188 | # SHELL used by kbuild |
| 189 | CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
| 190 | else if [ -x /bin/bash ]; then echo /bin/bash; \ |
| 191 | else echo sh; fi ; fi) |
| 192 | |
| 193 | HOSTCC = gcc |
| 194 | HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer |
| 195 | |
| 196 | ifeq ($(HOSTOS),cygwin) |
| 197 | HOSTCFLAGS += -ansi |
| 198 | endif |
| 199 | |
| 200 | # Mac OS X / Darwin's C preprocessor is Apple specific. It |
| 201 | # generates numerous errors and warnings. We want to bypass it |
| 202 | # and use GNU C's cpp. To do this we pass the -traditional-cpp |
| 203 | # option to the compiler. Note that the -traditional-cpp flag |
| 204 | # DOES NOT have the same semantics as GNU C's flag, all it does |
| 205 | # is invoke the GNU preprocessor in stock ANSI/ISO C fashion. |
| 206 | # |
| 207 | # Apple's linker is similar, thanks to the new 2 stage linking |
| 208 | # multiple symbol definitions are treated as errors, hence the |
| 209 | # -multiply_defined suppress option to turn off this error. |
| 210 | # |
| 211 | ifeq ($(HOSTOS),darwin) |
| 212 | # get major and minor product version (e.g. '10' and '6' for Snow Leopard) |
| 213 | DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.') |
| 214 | DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.') |
| 215 | |
| 216 | os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ |
| 217 | $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;) |
| 218 | |
| 219 | # Snow Leopards build environment has no longer restrictions as described above |
| 220 | HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") |
| 221 | HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") |
| 222 | HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") |
| 223 | endif |
| 224 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 225 | # Look for make include files relative to root of kernel src |
| 226 | MAKEFLAGS += --include-dir=$(srctree) |
| 227 | |
Masahiro Yamada | bf4b3de | 2014-02-04 17:24:18 +0900 | [diff] [blame] | 228 | # We need some generic definitions (do not try to remake the file). |
| 229 | $(srctree)/scripts/Kbuild.include: ; |
| 230 | include $(srctree)/scripts/Kbuild.include |
| 231 | |
Masahiro Yamada | f6322eb | 2014-02-04 17:24:15 +0900 | [diff] [blame] | 232 | # Make variables (CC, etc...) |
| 233 | |
| 234 | AS = $(CROSS_COMPILE)as |
| 235 | # Always use GNU ld |
| 236 | ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2> /dev/null),) |
| 237 | LD = $(CROSS_COMPILE)ld.bfd |
| 238 | else |
| 239 | LD = $(CROSS_COMPILE)ld |
| 240 | endif |
| 241 | CC = $(CROSS_COMPILE)gcc |
| 242 | CPP = $(CC) -E |
| 243 | AR = $(CROSS_COMPILE)ar |
| 244 | NM = $(CROSS_COMPILE)nm |
| 245 | LDR = $(CROSS_COMPILE)ldr |
| 246 | STRIP = $(CROSS_COMPILE)strip |
| 247 | OBJCOPY = $(CROSS_COMPILE)objcopy |
| 248 | OBJDUMP = $(CROSS_COMPILE)objdump |
| 249 | AWK = awk |
| 250 | RANLIB = $(CROSS_COMPILE)RANLIB |
| 251 | DTC = dtc |
| 252 | CHECK = sparse |
| 253 | |
| 254 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
| 255 | -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF) |
| 256 | |
Masahiro Yamada | fea1ca8 | 2014-02-04 17:24:20 +0900 | [diff] [blame] | 257 | # Use UBOOTINCLUDE when you must reference the include/ directory. |
| 258 | # Needed to be compatible with the O= option |
| 259 | UBOOTINCLUDE := |
| 260 | ifneq ($(OBJTREE),$(SRCTREE)) |
| 261 | UBOOTINCLUDE += -I$(OBJTREE)/include |
| 262 | endif |
| 263 | UBOOTINCLUDE += -I$(srctree)/include \ |
| 264 | -I$(srctree)/arch/$(ARCH)/include |
| 265 | |
Masahiro Yamada | 2b3c9d3 | 2014-02-04 17:24:19 +0900 | [diff] [blame] | 266 | KBUILD_CPPFLAGS := -D__KERNEL__ |
| 267 | |
| 268 | KBUILD_CFLAGS := -Wall -Wstrict-prototypes \ |
| 269 | -Wno-format-security \ |
| 270 | -fno-builtin -ffreestanding |
| 271 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
| 272 | |
Masahiro Yamada | f6322eb | 2014-02-04 17:24:15 +0900 | [diff] [blame] | 273 | export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC |
| 274 | export CPP AR NM LDR STRIP OBJCOPY OBJDUMP |
| 275 | export MAKE AWK |
| 276 | export DTC CHECK CHECKFLAGS |
| 277 | |
Masahiro Yamada | fea1ca8 | 2014-02-04 17:24:20 +0900 | [diff] [blame] | 278 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE |
Masahiro Yamada | 2b3c9d3 | 2014-02-04 17:24:19 +0900 | [diff] [blame] | 279 | export KBUILD_CFLAGS KBUILD_AFLAGS |
| 280 | |
| 281 | KBUILD_CFLAGS += -Os #-fomit-frame-pointer |
| 282 | |
| 283 | ifdef BUILD_TAG |
| 284 | KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"' |
| 285 | endif |
| 286 | |
| 287 | KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) |
| 288 | |
| 289 | KBUILD_CFLAGS += -g |
| 290 | # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format> |
| 291 | # option to the assembler. |
| 292 | KBUILD_AFLAGS += -g |
| 293 | |
Masahiro Yamada | fea1ca8 | 2014-02-04 17:24:20 +0900 | [diff] [blame] | 294 | NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) |
| 295 | CHECKFLAGS += $(NOSTDINC_FLAGS) |
| 296 | |
Masahiro Yamada | 2b3c9d3 | 2014-02-04 17:24:19 +0900 | [diff] [blame] | 297 | # Report stack usage if supported |
| 298 | KBUILD_CFLAGS += $(call cc-option,-fstack-usage) |
| 299 | |
| 300 | KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral) |
| 301 | |
| 302 | # turn jbsr into jsr for m68k |
| 303 | ifeq ($(ARCH),m68k) |
| 304 | ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4) |
| 305 | KBUILD_AFLAGS += -Wa,-gstabs,-S |
| 306 | endif |
| 307 | endif |
| 308 | |
Wolfgang Denk | 92b197f | 2006-03-12 01:37:50 +0100 | [diff] [blame] | 309 | # load other configuration |
| 310 | include $(TOPDIR)/config.mk |
| 311 | |
Masahiro Yamada | ced0715 | 2014-02-04 17:24:21 +0900 | [diff] [blame] | 312 | ifneq ($(CONFIG_SYS_TEXT_BASE),) |
| 313 | KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) |
| 314 | endif |
| 315 | |
| 316 | export CONFIG_SYS_TEXT_BASE |
| 317 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 318 | LDFLAGS_u-boot += -T u-boot.lds $(LDFLAGS_FINAL) |
Masahiro Yamada | ced0715 | 2014-02-04 17:24:21 +0900 | [diff] [blame] | 319 | ifneq ($(CONFIG_SYS_TEXT_BASE),) |
| 320 | LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) |
| 321 | endif |
| 322 | |
Simon Glass | fada9e2 | 2013-04-20 08:42:36 +0000 | [diff] [blame] | 323 | # Targets which don't build the source code |
Masahiro Yamada | ced0715 | 2014-02-04 17:24:21 +0900 | [diff] [blame] | 324 | NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig %_config |
Simon Glass | fada9e2 | 2013-04-20 08:42:36 +0000 | [diff] [blame] | 325 | |
| 326 | # Only do the generic board check when actually building, not configuring |
| 327 | ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),) |
Masahiro Yamada | ced0715 | 2014-02-04 17:24:21 +0900 | [diff] [blame] | 328 | ifeq ($(__HAVE_ARCH_GENERIC_BOARD),) |
| 329 | ifneq ($(CONFIG_SYS_GENERIC_BOARD),) |
| 330 | CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \ |
| 331 | Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file) |
| 332 | endif |
Simon Glass | fada9e2 | 2013-04-20 08:42:36 +0000 | [diff] [blame] | 333 | endif |
| 334 | endif |
| 335 | |
Ilya Yanok | d51dfff | 2011-06-20 12:45:37 +0000 | [diff] [blame] | 336 | # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use |
| 337 | # that (or fail if absent). Otherwise, search for a linker script in a |
| 338 | # standard location. |
| 339 | |
Simon Glass | ee60197 | 2011-11-21 10:49:37 +0000 | [diff] [blame] | 340 | LDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT)) |
| 341 | |
Ilya Yanok | d51dfff | 2011-06-20 12:45:37 +0000 | [diff] [blame] | 342 | ifndef LDSCRIPT |
| 343 | #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug |
| 344 | ifdef CONFIG_SYS_LDSCRIPT |
| 345 | # need to strip off double quotes |
Masahiro Yamada | a8c0754 | 2013-12-05 15:08:31 +0900 | [diff] [blame] | 346 | LDSCRIPT := $(CONFIG_SYS_LDSCRIPT:"%"=%) |
Ilya Yanok | d51dfff | 2011-06-20 12:45:37 +0000 | [diff] [blame] | 347 | endif |
| 348 | endif |
| 349 | |
Simon Glass | ee60197 | 2011-11-21 10:49:37 +0000 | [diff] [blame] | 350 | # If there is no specified link script, we look in a number of places for it |
Ilya Yanok | d51dfff | 2011-06-20 12:45:37 +0000 | [diff] [blame] | 351 | ifndef LDSCRIPT |
| 352 | ifeq ($(CONFIG_NAND_U_BOOT),y) |
| 353 | LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds |
| 354 | ifeq ($(wildcard $(LDSCRIPT)),) |
| 355 | LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds |
| 356 | endif |
| 357 | endif |
| 358 | ifeq ($(wildcard $(LDSCRIPT)),) |
| 359 | LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds |
| 360 | endif |
| 361 | ifeq ($(wildcard $(LDSCRIPT)),) |
| 362 | LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds |
| 363 | endif |
| 364 | ifeq ($(wildcard $(LDSCRIPT)),) |
Simon Glass | ee60197 | 2011-11-21 10:49:37 +0000 | [diff] [blame] | 365 | LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds |
| 366 | # We don't expect a Makefile here |
| 367 | LDSCRIPT_MAKEFILE_DIR = |
| 368 | endif |
| 369 | ifeq ($(wildcard $(LDSCRIPT)),) |
Ilya Yanok | d51dfff | 2011-06-20 12:45:37 +0000 | [diff] [blame] | 370 | $(error could not find linker script) |
| 371 | endif |
| 372 | endif |
| 373 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 374 | ######################################################################### |
| 375 | # U-Boot objects....order is important (i.e. start must be first) |
| 376 | |
Masahiro Yamada | e8a8b82 | 2013-11-28 12:09:59 +0900 | [diff] [blame] | 377 | head-y := $(CPUDIR)/start.o |
| 378 | head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o |
| 379 | head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 380 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 381 | OBJS := $(head-y) |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 382 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 383 | HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) |
Daniel Schwierzeck | 8b5a026 | 2012-07-19 13:39:58 +0000 | [diff] [blame] | 384 | |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 385 | LIBS-y += lib/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 386 | LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ |
| 387 | LIBS-y += $(CPUDIR)/ |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 388 | ifdef SOC |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 389 | LIBS-y += $(CPUDIR)/$(SOC)/ |
wdenk | 1d9f410 | 2004-10-09 22:21:29 +0000 | [diff] [blame] | 390 | endif |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 391 | LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/ |
| 392 | LIBS-$(CONFIG_OF_EMBED) += dts/ |
| 393 | LIBS-y += arch/$(ARCH)/lib/ |
Masahiro Yamada | 57c3e5f | 2013-11-11 14:36:09 +0900 | [diff] [blame] | 394 | LIBS-y += fs/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 395 | LIBS-y += net/ |
| 396 | LIBS-y += disk/ |
| 397 | LIBS-y += drivers/ |
| 398 | LIBS-y += drivers/dma/ |
| 399 | LIBS-y += drivers/gpio/ |
| 400 | LIBS-y += drivers/i2c/ |
| 401 | LIBS-y += drivers/input/ |
| 402 | LIBS-y += drivers/mmc/ |
| 403 | LIBS-y += drivers/mtd/ |
Masahiro Yamada | 392ba52 | 2013-11-28 12:22:17 +0900 | [diff] [blame] | 404 | LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 405 | LIBS-y += drivers/mtd/onenand/ |
Masahiro Yamada | 392ba52 | 2013-11-28 12:22:17 +0900 | [diff] [blame] | 406 | LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 407 | LIBS-y += drivers/mtd/spi/ |
| 408 | LIBS-y += drivers/net/ |
| 409 | LIBS-y += drivers/net/phy/ |
| 410 | LIBS-y += drivers/pci/ |
| 411 | LIBS-y += drivers/power/ \ |
| 412 | drivers/power/fuel_gauge/ \ |
| 413 | drivers/power/mfd/ \ |
| 414 | drivers/power/pmic/ \ |
| 415 | drivers/power/battery/ |
| 416 | LIBS-y += drivers/spi/ |
| 417 | LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/ |
York Sun | 5614e71 | 2013-09-30 09:22:09 -0700 | [diff] [blame] | 418 | LIBS-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 419 | LIBS-y += drivers/serial/ |
| 420 | LIBS-y += drivers/usb/eth/ |
| 421 | LIBS-y += drivers/usb/gadget/ |
| 422 | LIBS-y += drivers/usb/host/ |
| 423 | LIBS-y += drivers/usb/musb/ |
| 424 | LIBS-y += drivers/usb/musb-new/ |
| 425 | LIBS-y += drivers/usb/phy/ |
| 426 | LIBS-y += drivers/usb/ulpi/ |
| 427 | LIBS-y += common/ |
| 428 | LIBS-y += lib/libfdt/ |
Masahiro Yamada | 8a7e7d5 | 2013-11-18 11:08:35 +0900 | [diff] [blame] | 429 | LIBS-$(CONFIG_API) += api/ |
Masahiro Yamada | 755e08f | 2013-11-28 12:09:58 +0900 | [diff] [blame] | 430 | LIBS-$(CONFIG_HAS_POST) += post/ |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 431 | LIBS-y += test/ |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 432 | |
Alison Wang | 24e8bee | 2013-05-27 22:55:42 +0000 | [diff] [blame] | 433 | ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 434 | LIBS-y += arch/$(ARCH)/imx-common/ |
Jason Liu | 18936ee | 2011-11-25 00:18:01 +0000 | [diff] [blame] | 435 | endif |
| 436 | |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 437 | LIBS-$(CONFIG_ARM) += arch/arm/cpu/ |
| 438 | LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/ |
Minkyu Kang | 852bd07 | 2010-08-19 13:48:11 +0900 | [diff] [blame] | 439 | |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 440 | LIBS-y += board/$(BOARDDIR)/ |
Masahiro Yamada | 08e39a8 | 2013-11-11 14:35:55 +0900 | [diff] [blame] | 441 | |
Masahiro Yamada | e2906a5 | 2013-11-11 14:36:00 +0900 | [diff] [blame] | 442 | LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y)) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 443 | LIBS := $(sort $(LIBS-y)) |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 444 | .PHONY : $(LIBS) |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 445 | |
wdenk | 4f7cb08 | 2003-09-11 23:06:34 +0000 | [diff] [blame] | 446 | # Add GCC lib |
Wolfgang Denk | 52b1bf2 | 2009-07-23 13:15:59 +0200 | [diff] [blame] | 447 | ifdef USE_PRIVATE_LIBGCC |
| 448 | ifeq ("$(USE_PRIVATE_LIBGCC)", "yes") |
Matthias Weisser | 635d1b3 | 2010-11-18 09:35:09 +0100 | [diff] [blame] | 449 | PLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o |
Wolfgang Denk | 52b1bf2 | 2009-07-23 13:15:59 +0200 | [diff] [blame] | 450 | else |
| 451 | PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc |
| 452 | endif |
| 453 | else |
Wolfgang Denk | cca4e4a | 2011-11-01 20:54:02 +0000 | [diff] [blame] | 454 | PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc |
Wolfgang Denk | 52b1bf2 | 2009-07-23 13:15:59 +0200 | [diff] [blame] | 455 | endif |
| 456 | PLATFORM_LIBS += $(PLATFORM_LIBGCC) |
| 457 | export PLATFORM_LIBS |
wdenk | 3d3befa | 2004-03-14 15:06:13 +0000 | [diff] [blame] | 458 | |
Mike Frysinger | 6ac9f47 | 2009-08-23 02:47:59 -0400 | [diff] [blame] | 459 | # Special flags for CPP when processing the linker script. |
| 460 | # Pass the version down so we can handle backwards compatibility |
| 461 | # on the fly. |
| 462 | LDPPFLAGS += \ |
| 463 | -include $(TOPDIR)/include/u-boot/u-boot.lds.h \ |
Simon Glass | 7e6403a | 2011-11-21 10:49:40 +0000 | [diff] [blame] | 464 | -DCPUDIR=$(CPUDIR) \ |
Mike Frysinger | 6ac9f47 | 2009-08-23 02:47:59 -0400 | [diff] [blame] | 465 | $(shell $(LD) --version | \ |
| 466 | sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p') |
| 467 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 468 | ######################################################################### |
wdenk | bdccc4f | 2003-08-05 17:43:17 +0000 | [diff] [blame] | 469 | ######################################################################### |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 470 | |
Mike Frysinger | f3a14d3 | 2010-10-13 22:58:23 -0400 | [diff] [blame] | 471 | ifneq ($(CONFIG_BOARD_SIZE_LIMIT),) |
| 472 | BOARD_SIZE_CHECK = \ |
| 473 | @actual=`wc -c $@ | awk '{print $$1}'`; \ |
Joe Hershberger | d060e6f | 2012-11-08 10:19:09 +0000 | [diff] [blame] | 474 | limit=`printf "%d" $(CONFIG_BOARD_SIZE_LIMIT)`; \ |
Mike Frysinger | f3a14d3 | 2010-10-13 22:58:23 -0400 | [diff] [blame] | 475 | if test $$actual -gt $$limit; then \ |
Joe Hershberger | d060e6f | 2012-11-08 10:19:09 +0000 | [diff] [blame] | 476 | echo "$@ exceeds file size limit:" >&2 ; \ |
| 477 | echo " limit: $$limit bytes" >&2 ; \ |
| 478 | echo " actual: $$actual bytes" >&2 ; \ |
| 479 | echo " excess: $$((actual - limit)) bytes" >&2; \ |
Mike Frysinger | f3a14d3 | 2010-10-13 22:58:23 -0400 | [diff] [blame] | 480 | exit 1; \ |
| 481 | fi |
| 482 | else |
| 483 | BOARD_SIZE_CHECK = |
| 484 | endif |
| 485 | |
Scott Wood | 8137af1 | 2013-12-14 11:47:32 +0800 | [diff] [blame] | 486 | # Statically apply RELA-style relocations (currently arm64 only) |
| 487 | ifneq ($(CONFIG_STATIC_RELA),) |
| 488 | # $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base |
| 489 | DO_STATIC_RELA = \ |
| 490 | start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \ |
| 491 | end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 492 | tools/relocate-rela $(2) $(3) $$start $$end |
Scott Wood | 8137af1 | 2013-12-14 11:47:32 +0800 | [diff] [blame] | 493 | else |
| 494 | DO_STATIC_RELA = |
| 495 | endif |
| 496 | |
Mike Frysinger | 3e88337 | 2009-06-15 00:25:19 -0400 | [diff] [blame] | 497 | # Always append ALL so that arch config.mk's can add custom ones |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 498 | ALL-y += u-boot.srec u-boot.bin System.map |
Haiying Wang | e935a37 | 2011-01-27 09:44:59 -0500 | [diff] [blame] | 499 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 500 | ALL-$(CONFIG_NAND_U_BOOT) += u-boot-nand.bin |
| 501 | ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin |
| 502 | ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl |
| 503 | ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin |
| 504 | ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img |
| 505 | ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin |
| 506 | ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin |
Vadim Bendebury | b343bbb | 2013-03-27 14:34:18 +0000 | [diff] [blame] | 507 | ifneq ($(CONFIG_SPL_TARGET),) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 508 | ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) |
Vadim Bendebury | b343bbb | 2013-03-27 14:34:18 +0000 | [diff] [blame] | 509 | endif |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 510 | ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 511 | |
Allen Martin | 12b7b70 | 2012-08-31 08:30:12 +0000 | [diff] [blame] | 512 | # enable combined SPL/u-boot/dtb rules for tegra |
Tom Warren | 6d6c0ba | 2012-12-11 13:34:17 +0000 | [diff] [blame] | 513 | ifneq ($(CONFIG_TEGRA),) |
Vidya Sagar | 7dcd3a2 | 2013-10-31 14:51:38 +0530 | [diff] [blame] | 514 | ifeq ($(CONFIG_SPL),y) |
Allen Martin | 12b7b70 | 2012-08-31 08:30:12 +0000 | [diff] [blame] | 515 | ifeq ($(CONFIG_OF_SEPARATE),y) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 516 | ALL-y += u-boot-dtb-tegra.bin |
Allen Martin | 12b7b70 | 2012-08-31 08:30:12 +0000 | [diff] [blame] | 517 | else |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 518 | ALL-y += u-boot-nodtb-tegra.bin |
Allen Martin | 12b7b70 | 2012-08-31 08:30:12 +0000 | [diff] [blame] | 519 | endif |
| 520 | endif |
Vidya Sagar | 7dcd3a2 | 2013-10-31 14:51:38 +0530 | [diff] [blame] | 521 | endif |
Allen Martin | 12b7b70 | 2012-08-31 08:30:12 +0000 | [diff] [blame] | 522 | |
Masahiro Yamada | 8a7e7d5 | 2013-11-18 11:08:35 +0900 | [diff] [blame] | 523 | all: $(ALL-y) $(SUBDIR_EXAMPLES-y) |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 524 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 525 | u-boot.dtb: checkdtc u-boot |
| 526 | $(MAKE) $(build)=dts binary |
| 527 | mv dts/dt.dtb $@ |
Simon Glass | 2c0f79e | 2011-10-24 19:15:31 +0000 | [diff] [blame] | 528 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 529 | u-boot-dtb.bin: u-boot.bin u-boot.dtb |
Simon Glass | 2c0f79e | 2011-10-24 19:15:31 +0000 | [diff] [blame] | 530 | cat $^ >$@ |
| 531 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 532 | u-boot.hex: u-boot |
wdenk | 6310eb9 | 2005-01-09 21:28:15 +0000 | [diff] [blame] | 533 | $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ |
| 534 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 535 | u-boot.srec: u-boot |
Albert ARIBAUD | 47ed5dd | 2013-11-07 14:21:46 +0100 | [diff] [blame] | 536 | $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 537 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 538 | u-boot.bin: u-boot |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 539 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
Scott Wood | 8137af1 | 2013-12-14 11:47:32 +0800 | [diff] [blame] | 540 | $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) |
Mike Frysinger | f3a14d3 | 2010-10-13 22:58:23 -0400 | [diff] [blame] | 541 | $(BOARD_SIZE_CHECK) |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 542 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 543 | u-boot.ldr: u-boot |
Mike Frysinger | 76d8218 | 2009-07-21 22:17:36 -0400 | [diff] [blame] | 544 | $(CREATE_LDR_ENV) |
Mike Frysinger | 68e5632 | 2008-08-07 18:56:56 -0400 | [diff] [blame] | 545 | $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS) |
Mike Frysinger | f3a14d3 | 2010-10-13 22:58:23 -0400 | [diff] [blame] | 546 | $(BOARD_SIZE_CHECK) |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 547 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 548 | u-boot.ldr.hex: u-boot.ldr |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 549 | $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary |
| 550 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 551 | u-boot.ldr.srec: u-boot.ldr |
Mike Frysinger | 94a91e2 | 2008-02-04 19:26:57 -0500 | [diff] [blame] | 552 | $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary |
| 553 | |
Stefan Roese | b40bda6 | 2012-08-16 17:54:52 +0200 | [diff] [blame] | 554 | # |
| 555 | # U-Boot entry point, needed for booting of full-blown U-Boot |
| 556 | # from the SPL U-Boot version. |
| 557 | # |
| 558 | ifndef CONFIG_SYS_UBOOT_START |
| 559 | CONFIG_SYS_UBOOT_START := 0 |
| 560 | endif |
| 561 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 562 | u-boot.img: u-boot.bin |
| 563 | tools/mkimage -A $(ARCH) -T firmware -C none \ |
Stefan Roese | b40bda6 | 2012-08-16 17:54:52 +0200 | [diff] [blame] | 564 | -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \ |
| 565 | -e $(CONFIG_SYS_UBOOT_START) \ |
Wolfgang Denk | 881a87e | 2006-02-21 17:33:04 +0100 | [diff] [blame] | 566 | -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \ |
wdenk | bdccc4f | 2003-08-05 17:43:17 +0000 | [diff] [blame] | 567 | sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ |
| 568 | -d $< $@ |
| 569 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 570 | u-boot.imx: u-boot.bin depend |
| 571 | $(MAKE) $(build)=arch/arm/imx-common $(objtree)/u-boot.imx |
Stefano Babic | 8edcde5 | 2010-01-20 18:19:10 +0100 | [diff] [blame] | 572 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 573 | u-boot.kwb: u-boot.bin |
| 574 | tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ |
Eric Cooper | 2ea88b0 | 2010-10-19 13:31:11 -0400 | [diff] [blame] | 575 | -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ |
Prafulla Wadaskar | aa0c7a8 | 2009-09-07 15:05:02 +0530 | [diff] [blame] | 576 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 577 | u-boot.pbl: u-boot.bin |
| 578 | tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \ |
Prabhakar Kushwaha | 690e425 | 2014-01-13 11:28:04 +0530 | [diff] [blame] | 579 | -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \ |
Shaohui Xie | 5d898a0 | 2012-08-10 02:49:35 +0000 | [diff] [blame] | 580 | -d $< $@ |
| 581 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 582 | u-boot.sha1: u-boot.bin |
| 583 | tools/ubsha1 u-boot.bin |
Heiko Schocher | 566a494 | 2007-06-22 19:11:54 +0200 | [diff] [blame] | 584 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 585 | u-boot.dis: u-boot |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 586 | $(OBJDUMP) -d $< > $@ |
| 587 | |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 588 | # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate, |
| 589 | # $(4) is pad-to |
| 590 | SPL_PAD_APPEND = \ |
| 591 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 592 | $(1) $(3); \ |
| 593 | cat $(3) $(2) > $@; \ |
| 594 | rm $(3) |
Scott Wood | 74752ba | 2012-12-06 13:33:16 +0000 | [diff] [blame] | 595 | |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 596 | ifdef CONFIG_TPL |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 597 | SPL_PAYLOAD := tpl/u-boot-with-tpl.bin |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 598 | else |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 599 | SPL_PAYLOAD := u-boot.bin |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 600 | endif |
Scott Wood | 74752ba | 2012-12-06 13:33:16 +0000 | [diff] [blame] | 601 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 602 | u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 603 | $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO)) |
| 604 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 605 | tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin |
| 606 | $(call SPL_PAD_APPEND,$<,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) |
Heiko Schocher | 7816f2c | 2011-07-16 00:06:42 +0000 | [diff] [blame] | 607 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 608 | u-boot-with-spl.imx: spl/u-boot-spl.bin u-boot.bin |
| 609 | $(MAKE) $(build)=arch/arm/imx-common \ |
Benoît Thébaudeau | ba59760 | 2013-04-11 09:35:56 +0000 | [diff] [blame] | 610 | $(OBJTREE)/u-boot-with-spl.imx |
| 611 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 612 | u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin |
| 613 | $(MAKE) $(build)=arch/arm/imx-common \ |
Benoît Thébaudeau | 7d5a5c7 | 2013-04-11 09:35:57 +0000 | [diff] [blame] | 614 | $(OBJTREE)/u-boot-with-nand-spl.imx |
| 615 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 616 | u-boot.ubl: u-boot-with-spl.bin |
| 617 | tools/mkimage -n $(UBL_CONFIG) -T ublimage \ |
| 618 | -e $(CONFIG_SYS_TEXT_BASE) -d $< u-boot.ubl |
José Miguel Gonçalves | 277f00f | 2012-09-19 01:25:26 +0000 | [diff] [blame] | 619 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 620 | u-boot.ais: spl/u-boot-spl.bin u-boot.img |
| 621 | tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:"%"=%),"/dev/null") \ |
Sughosh Ganu | 6d660e7 | 2012-06-13 08:39:06 +0000 | [diff] [blame] | 622 | -T aisimage \ |
Christian Riesch | d36d885 | 2011-12-09 09:47:39 +0000 | [diff] [blame] | 623 | -e $(CONFIG_SPL_TEXT_BASE) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 624 | -d spl/u-boot-spl.bin \ |
| 625 | spl/u-boot-spl.ais |
Christian Riesch | d36d885 | 2011-12-09 09:47:39 +0000 | [diff] [blame] | 626 | $(OBJCOPY) ${OBJCFLAGS} -I binary \ |
| 627 | --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 628 | spl/u-boot-spl.ais spl/u-boot-spl-pad.ais |
| 629 | cat spl/u-boot-spl-pad.ais u-boot.img > u-boot.ais |
Christian Riesch | d36d885 | 2011-12-09 09:47:39 +0000 | [diff] [blame] | 630 | |
Otavio Salvador | a545355 | 2012-08-18 07:25:25 +0000 | [diff] [blame] | 631 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 632 | u-boot.sb: u-boot.bin spl/u-boot-spl.bin |
| 633 | $(MAKE) $(build)=$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb |
Marek Vasut | 30b9b93 | 2011-11-08 23:18:19 +0000 | [diff] [blame] | 634 | |
Stefan Roese | 94aebe6 | 2012-01-05 11:19:50 +0100 | [diff] [blame] | 635 | # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. |
| 636 | # Both images are created using mkimage (crc etc), so that the ROM |
| 637 | # bootloader can check its integrity. Padding needs to be done to the |
| 638 | # SPL image (with mkimage header) and not the binary. Otherwise the resulting image |
| 639 | # which is loaded/copied by the ROM bootloader to SRAM doesn't fit. |
| 640 | # The resulting image containing both U-Boot images is called u-boot.spr |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 641 | u-boot.spr: u-boot.img spl/u-boot-spl.bin |
| 642 | tools/mkimage -A $(ARCH) -T firmware -C none \ |
Stefan Roese | 94aebe6 | 2012-01-05 11:19:50 +0100 | [diff] [blame] | 643 | -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 644 | -d spl/u-boot-spl.bin $@ |
Masahiro Yamada | 5727026 | 2013-12-18 19:00:51 +0900 | [diff] [blame] | 645 | $(OBJCOPY) -I binary -O binary \ |
| 646 | --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 647 | cat u-boot.img >> $@ |
Stefan Roese | 94aebe6 | 2012-01-05 11:19:50 +0100 | [diff] [blame] | 648 | |
Tom Warren | 6d6c0ba | 2012-12-11 13:34:17 +0000 | [diff] [blame] | 649 | ifneq ($(CONFIG_TEGRA),) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 650 | u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin |
| 651 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary spl/u-boot-spl spl/u-boot-spl-pad.bin |
| 652 | cat spl/u-boot-spl-pad.bin u-boot.bin > $@ |
| 653 | rm spl/u-boot-spl-pad.bin |
Stephen Warren | 9972db5 | 2013-05-14 08:00:53 +0000 | [diff] [blame] | 654 | |
| 655 | ifeq ($(CONFIG_OF_SEPARATE),y) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 656 | u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin u-boot.dtb |
| 657 | cat u-boot-nodtb-tegra.bin u-boot.dtb > $@ |
Stephen Warren | 9972db5 | 2013-05-14 08:00:53 +0000 | [diff] [blame] | 658 | endif |
Allen Martin | 984df4e | 2012-08-31 08:30:10 +0000 | [diff] [blame] | 659 | endif |
| 660 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 661 | u-boot-img.bin: spl/u-boot-spl.bin u-boot.img |
| 662 | cat spl/u-boot-spl.bin u-boot.img > $@ |
Stefan Roese | fb3d2b8 | 2012-08-24 17:36:53 +0200 | [diff] [blame] | 663 | |
Stefan Roese | ecddccd | 2013-02-22 11:36:50 +0100 | [diff] [blame] | 664 | # PPC4xx needs the SPL at the end of the image, since the reset vector |
| 665 | # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target |
| 666 | # and need to introduce a new build target with the full blown U-Boot |
| 667 | # at the start padded up to the start of the SPL image. And then concat |
| 668 | # the SPL image to the end. |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 669 | u-boot-img-spl-at-end.bin: spl/u-boot-spl.bin u-boot.img |
Masahiro Yamada | 5727026 | 2013-12-18 19:00:51 +0900 | [diff] [blame] | 670 | $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 671 | --gap-fill=0xff u-boot.img $@ |
| 672 | cat spl/u-boot-spl.bin >> $@ |
Stefan Roese | ecddccd | 2013-02-22 11:36:50 +0100 | [diff] [blame] | 673 | |
Scott Wood | f4dc714 | 2013-12-14 11:47:33 +0800 | [diff] [blame] | 674 | # Create a new ELF from a raw binary file. This is useful for arm64 |
| 675 | # where static relocation needs to be performed on the raw binary, |
| 676 | # but certain simulators only accept an ELF file (but don't do the |
| 677 | # relocation). |
| 678 | # FIXME refactor dts/Makefile to share target/arch detection |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 679 | u-boot.elf: u-boot.bin |
Scott Wood | f4dc714 | 2013-12-14 11:47:33 +0800 | [diff] [blame] | 680 | @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 681 | $< u-boot-elf.o |
| 682 | @$(LD) u-boot-elf.o -o $@ \ |
Scott Wood | f4dc714 | 2013-12-14 11:47:33 +0800 | [diff] [blame] | 683 | --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \ |
| 684 | -Ttext=$(CONFIG_SYS_TEXT_BASE) |
| 685 | |
Simon Glass | 86eb49b | 2011-10-03 19:26:50 +0000 | [diff] [blame] | 686 | ifeq ($(CONFIG_SANDBOX),y) |
| 687 | GEN_UBOOT = \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 688 | $(CC) $(SYMS) -T u-boot.lds \ |
| 689 | -Wl,--start-group $(LIBS) -Wl,--end-group \ |
Simon Glass | 86eb49b | 2011-10-03 19:26:50 +0000 | [diff] [blame] | 690 | $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot |
| 691 | else |
Mike Frysinger | ecb1dc8 | 2009-05-20 04:35:14 -0400 | [diff] [blame] | 692 | GEN_UBOOT = \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 693 | $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \ |
| 694 | $(OBJS) \ |
| 695 | --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \ |
wdenk | b2184c3 | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 696 | -Map u-boot.map -o u-boot |
Simon Glass | 86eb49b | 2011-10-03 19:26:50 +0000 | [diff] [blame] | 697 | endif |
| 698 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 699 | u-boot: depend $(SUBDIR_TOOLS) $(OBJS) $(LIBS) u-boot.lds |
Mike Frysinger | ecb1dc8 | 2009-05-20 04:35:14 -0400 | [diff] [blame] | 700 | $(GEN_UBOOT) |
| 701 | ifeq ($(CONFIG_KALLSYMS),y) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 702 | smap=`$(call SYSTEM_MAP,u-boot) | \ |
Wolfgang Denk | 1aada9c | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 703 | awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \ |
| 704 | $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 705 | -c $(srctree)/common/system_map.c -o common/system_map.o |
| 706 | $(GEN_UBOOT) common/system_map.o |
Mike Frysinger | ecb1dc8 | 2009-05-20 04:35:14 -0400 | [diff] [blame] | 707 | endif |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 708 | |
Masahiro Yamada | 3bddafa | 2013-10-21 11:53:41 +0900 | [diff] [blame] | 709 | $(OBJS): |
| 710 | @: |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 711 | |
Che-liang Chiou | 349e83f | 2011-10-17 21:04:15 +0000 | [diff] [blame] | 712 | $(LIBS): depend $(SUBDIR_TOOLS) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 713 | $(MAKE) $(build)=$(patsubst %/,%,$(dir $@)) |
wdenk | a8c7c70 | 2003-12-06 19:49:23 +0000 | [diff] [blame] | 714 | |
Masahiro Yamada | 4a20df3 | 2014-02-04 17:24:12 +0900 | [diff] [blame] | 715 | $(SUBDIRS): depend |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 716 | $(MAKE) $(build)=$@ all |
Masahiro Yamada | 940db16 | 2014-02-04 17:24:10 +0900 | [diff] [blame] | 717 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 718 | $(SUBDIR_EXAMPLES-y): u-boot |
Che-liang Chiou | 349e83f | 2011-10-17 21:04:15 +0000 | [diff] [blame] | 719 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 720 | u-boot.lds: $(LDSCRIPT) depend |
Marek Vasut | 97b24d3 | 2012-10-19 05:00:10 +0000 | [diff] [blame] | 721 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@ |
Wolfgang Denk | 1aada9c | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 722 | |
Haiying Wang | e935a37 | 2011-01-27 09:44:59 -0500 | [diff] [blame] | 723 | nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 724 | $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 725 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 726 | u-boot-nand.bin: nand_spl u-boot.bin |
| 727 | cat nand_spl/u-boot-spl-16k.bin u-boot.bin > u-boot-nand.bin |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 728 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 729 | spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend |
| 730 | $(MAKE) obj=spl -f $(srctree)/spl/Makefile all |
Daniel Schwierzeck | 5df2ee2 | 2011-07-13 05:11:04 +0000 | [diff] [blame] | 731 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 732 | tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend |
| 733 | $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 734 | |
Daniel Hobi | 2a99879 | 2010-01-18 18:13:39 +0100 | [diff] [blame] | 735 | # Explicitly make _depend in subdirs containing multiple targets to prevent |
| 736 | # parallel sub-makes creating .depend files simultaneously. |
Wolfgang Denk | 16a354f | 2010-10-26 00:08:35 +0200 | [diff] [blame] | 737 | depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 738 | include/spl-autoconf.mk \ |
| 739 | include/tpl-autoconf.mk \ |
| 740 | include/autoconf.mk \ |
| 741 | include/generated/generic-asm-offsets.h \ |
| 742 | include/generated/asm-offsets.h |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 743 | |
Li Yang | e5e4e70 | 2009-12-09 18:13:26 +0800 | [diff] [blame] | 744 | TAG_SUBDIRS = $(SUBDIRS) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 745 | TAG_SUBDIRS += $(dir $(LIBS)) |
Jean-Christophe PLAGNIOL-VILLARD | a340c32 | 2007-11-25 18:45:47 +0100 | [diff] [blame] | 746 | TAG_SUBDIRS += include |
Jean-Christophe PLAGNIOL-VILLARD | a340c32 | 2007-11-25 18:45:47 +0100 | [diff] [blame] | 747 | |
Horst Kronstorfer | 857d9ea | 2011-07-18 01:21:18 +0000 | [diff] [blame] | 748 | FIND := find |
| 749 | FINDFLAGS := -L |
| 750 | |
Tom Rini | 1064d98 | 2012-02-02 14:07:05 +0000 | [diff] [blame] | 751 | checkstack: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 752 | $(CROSS_COMPILE)objdump -d u-boot \ |
| 753 | `$(FIND) . -name u-boot-spl -print` | \ |
| 754 | perl $(src)/scripts/checkstack.pl $(ARCH) |
Tom Rini | 1064d98 | 2012-02-02 14:07:05 +0000 | [diff] [blame] | 755 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 756 | tags ctags: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 757 | ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ |
Li Yang | e5e4e70 | 2009-12-09 18:13:26 +0800 | [diff] [blame] | 758 | -name '*.[chS]' -print` |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 759 | |
| 760 | etags: |
Horst Kronstorfer | 857d9ea | 2011-07-18 01:21:18 +0000 | [diff] [blame] | 761 | etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ |
Li Yang | e5e4e70 | 2009-12-09 18:13:26 +0800 | [diff] [blame] | 762 | -name '*.[chS]' -print` |
Li Yang | ffda586 | 2008-02-29 11:46:05 +0800 | [diff] [blame] | 763 | cscope: |
Horst Kronstorfer | 857d9ea | 2011-07-18 01:21:18 +0000 | [diff] [blame] | 764 | $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \ |
| 765 | cscope.files |
Li Yang | ffda586 | 2008-02-29 11:46:05 +0800 | [diff] [blame] | 766 | cscope -b -q -k |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 767 | |
Mike Frysinger | ecb1dc8 | 2009-05-20 04:35:14 -0400 | [diff] [blame] | 768 | SYSTEM_MAP = \ |
| 769 | $(NM) $1 | \ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 770 | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ |
Mike Frysinger | ecb1dc8 | 2009-05-20 04:35:14 -0400 | [diff] [blame] | 771 | LC_ALL=C sort |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 772 | System.map: u-boot |
Masahiro Yamada | bc8bb6e | 2013-11-11 14:36:01 +0900 | [diff] [blame] | 773 | @$(call SYSTEM_MAP,$<) > $@ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 774 | |
Tom Rini | 06a119a | 2012-03-16 06:34:35 +0000 | [diff] [blame] | 775 | checkthumb: |
| 776 | @if test $(call cc-version) -lt 0404; then \ |
| 777 | echo -n '*** Your GCC does not produce working '; \ |
| 778 | echo 'binaries in THUMB mode.'; \ |
| 779 | echo '*** Your board is configured for THUMB mode.'; \ |
| 780 | false; \ |
| 781 | fi |
Scott Wood | 6ec63f4 | 2012-09-20 19:10:01 -0500 | [diff] [blame] | 782 | |
| 783 | # GCC 3.x is reported to have problems generating the type of relocation |
| 784 | # that U-Boot wants. |
| 785 | # See http://lists.denx.de/pipermail/u-boot/2012-September/135156.html |
| 786 | checkgcc4: |
| 787 | @if test $(call cc-version) -lt 0400; then \ |
| 788 | echo -n '*** Your GCC is too old, please upgrade to GCC 4.x or newer'; \ |
| 789 | false; \ |
| 790 | fi |
| 791 | |
Stephen Warren | 501ebdf | 2013-07-24 10:09:16 -0700 | [diff] [blame] | 792 | checkdtc: |
| 793 | @if test $(call dtc-version) -lt 0104; then \ |
| 794 | echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \ |
| 795 | false; \ |
| 796 | fi |
| 797 | |
Grant Likely | 2f155f6 | 2007-09-24 09:05:31 -0600 | [diff] [blame] | 798 | # |
| 799 | # Auto-generate the autoconf.mk file (which is included by all makefiles) |
| 800 | # |
| 801 | # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep. |
| 802 | # the dep file is only include in this top level makefile to determine when |
| 803 | # to regenerate the autoconf.mk file. |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 804 | include/autoconf.mk.dep: include/config.h include/common.h |
Wolfgang Denk | 1510b82 | 2008-05-13 23:15:52 +0200 | [diff] [blame] | 805 | @$(XECHO) Generating $@ ; \ |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 806 | : Generate the dependancies ; \ |
Mike Frysinger | 4c34b2a | 2011-10-12 19:48:00 +0000 | [diff] [blame] | 807 | $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 808 | -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || \ |
Masahiro Yamada | 65947ab | 2013-12-02 14:57:29 +0900 | [diff] [blame] | 809 | rm $@ |
Wolfgang Denk | 1510b82 | 2008-05-13 23:15:52 +0200 | [diff] [blame] | 810 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 811 | include/autoconf.mk: include/config.h |
Wolfgang Denk | 1510b82 | 2008-05-13 23:15:52 +0200 | [diff] [blame] | 812 | @$(XECHO) Generating $@ ; \ |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 813 | : Extract the config macros ; \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 814 | $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
| 815 | sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ |
Masahiro Yamada | 65947ab | 2013-12-02 14:57:29 +0900 | [diff] [blame] | 816 | rm $@.tmp |
Grant Likely | 2f155f6 | 2007-09-24 09:05:31 -0600 | [diff] [blame] | 817 | |
Joel Fernandes | 39bc12d | 2013-08-19 16:14:14 +0800 | [diff] [blame] | 818 | # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 819 | include/tpl-autoconf.mk: include/config.h |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 820 | @$(XECHO) Generating $@ ; \ |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 821 | : Extract the config macros ; \ |
| 822 | $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 823 | -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
| 824 | sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ |
Masahiro Yamada | 65947ab | 2013-12-02 14:57:29 +0900 | [diff] [blame] | 825 | rm $@.tmp |
Ying Zhang | 3aa29de | 2013-08-16 15:16:15 +0800 | [diff] [blame] | 826 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 827 | include/spl-autoconf.mk: include/config.h |
Joel Fernandes | 39bc12d | 2013-08-19 16:14:14 +0800 | [diff] [blame] | 828 | @$(XECHO) Generating $@ ; \ |
Joel Fernandes | 39bc12d | 2013-08-19 16:14:14 +0800 | [diff] [blame] | 829 | : Extract the config macros ; \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 830 | $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
| 831 | sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ |
Masahiro Yamada | 65947ab | 2013-12-02 14:57:29 +0900 | [diff] [blame] | 832 | rm $@.tmp |
Joel Fernandes | 39bc12d | 2013-08-19 16:14:14 +0800 | [diff] [blame] | 833 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 834 | include/generated/generic-asm-offsets.h: lib/asm-offsets.s |
Wolfgang Denk | 16a354f | 2010-10-26 00:08:35 +0200 | [diff] [blame] | 835 | @$(XECHO) Generating $@ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 836 | $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@ |
Wolfgang Denk | 16a354f | 2010-10-26 00:08:35 +0200 | [diff] [blame] | 837 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 838 | lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c |
| 839 | @mkdir -p lib |
Wolfgang Denk | 16a354f | 2010-10-26 00:08:35 +0200 | [diff] [blame] | 840 | $(CC) -DDO_DEPS_ONLY \ |
| 841 | $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 842 | -o $@ $(srctree)/lib/asm-offsets.c -c -S |
Wolfgang Denk | 16a354f | 2010-10-26 00:08:35 +0200 | [diff] [blame] | 843 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 844 | include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s |
Wolfgang Denk | b12734e | 2012-07-26 20:52:41 +0000 | [diff] [blame] | 845 | @$(XECHO) Generating $@ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 846 | $(srctree)/tools/scripts/make-asm-offsets $(CPUDIR)/$(SOC)/asm-offsets.s $@ |
Stefano Babic | a4814a6 | 2011-09-05 04:32:28 +0000 | [diff] [blame] | 847 | |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 848 | $(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h |
| 849 | @mkdir -p $(CPUDIR)/$(SOC) |
| 850 | if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ |
Stefano Babic | a4814a6 | 2011-09-05 04:32:28 +0000 | [diff] [blame] | 851 | $(CC) -DDO_DEPS_ONLY \ |
| 852 | $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 853 | -o $@ $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \ |
Stefano Babic | a4814a6 | 2011-09-05 04:32:28 +0000 | [diff] [blame] | 854 | else \ |
| 855 | touch $@; \ |
| 856 | fi |
| 857 | |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 858 | ######################################################################### |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 859 | else # !config.mk |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 860 | all u-boot.hex u-boot.srec u-boot.bin \ |
| 861 | u-boot.img u-boot.dis u-boot \ |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 862 | $(filter-out tools,$(SUBDIRS)) \ |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 863 | depend dep tags ctags etags cscope System.map: |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 864 | @echo "System not configured - see README" >&2 |
| 865 | @ exit 1 |
Mike Frysinger | c7c0d54 | 2010-01-21 04:03:22 -0500 | [diff] [blame] | 866 | |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 867 | tools: $(VERSION_FILE) $(TIMESTAMP_FILE) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 868 | $(MAKE) $(build)=$@ all |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 869 | endif # config.mk |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 870 | |
Scott Wood | 54799e4 | 2013-12-14 11:47:34 +0800 | [diff] [blame] | 871 | # ARM relocations should all be R_ARM_RELATIVE (32-bit) or |
| 872 | # R_AARCH64_RELATIVE (64-bit). |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 873 | checkarmreloc: u-boot |
Scott Wood | 54799e4 | 2013-12-14 11:47:34 +0800 | [diff] [blame] | 874 | @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \ |
| 875 | grep R_A | sort -u`"; \ |
| 876 | if test "$$RELOC" != "R_ARM_RELATIVE" -a \ |
| 877 | "$$RELOC" != "R_AARCH64_RELATIVE"; then \ |
| 878 | echo "$< contains unexpected relocations: $$RELOC"; \ |
| 879 | false; \ |
| 880 | fi |
Albert ARIBAUD | c37980c | 2013-06-11 14:17:30 +0200 | [diff] [blame] | 881 | |
Ilya Yanok | 28abd48 | 2011-06-20 12:45:38 +0000 | [diff] [blame] | 882 | $(VERSION_FILE): |
Mike Frysinger | 14ce91b | 2011-06-30 16:56:20 +0000 | [diff] [blame] | 883 | @mkdir -p $(dir $(VERSION_FILE)) |
Masahiro Yamada | dd88ab3 | 2013-11-28 16:29:23 +0900 | [diff] [blame] | 884 | @( localvers='$(shell $(TOPDIR)/scripts/setlocalversion $(TOPDIR))' ; \ |
Ilya Yanok | 28abd48 | 2011-06-20 12:45:38 +0000 | [diff] [blame] | 885 | printf '#define PLAIN_VERSION "%s%s"\n' \ |
| 886 | "$(U_BOOT_VERSION)" "$${localvers}" ; \ |
| 887 | printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ |
| 888 | "$(U_BOOT_VERSION)" "$${localvers}" ; \ |
| 889 | ) > $@.tmp |
| 890 | @( printf '#define CC_VERSION_STRING "%s"\n' \ |
| 891 | '$(shell $(CC) --version | head -n 1)' )>> $@.tmp |
| 892 | @( printf '#define LD_VERSION_STRING "%s"\n' \ |
| 893 | '$(shell $(LD) -v | head -n 1)' )>> $@.tmp |
| 894 | @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ |
| 895 | |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 896 | $(TIMESTAMP_FILE): |
| 897 | @mkdir -p $(dir $(TIMESTAMP_FILE)) |
Loïc Minier | a76406f | 2011-10-03 11:57:11 +0200 | [diff] [blame] | 898 | @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp |
| 899 | @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp |
| 900 | @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 901 | |
Mike Frysinger | 0358df4 | 2010-08-15 00:03:21 -0400 | [diff] [blame] | 902 | easylogo env gdb: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 903 | $(MAKE) $(build)=tools/$@ MTD_VERSION=${MTD_VERSION} |
Masahiro Yamada | 940db16 | 2014-02-04 17:24:10 +0900 | [diff] [blame] | 904 | |
Mike Frysinger | 0358df4 | 2010-08-15 00:03:21 -0400 | [diff] [blame] | 905 | gdbtools: gdb |
| 906 | |
Marek Vasut | 30ff891 | 2012-10-06 14:04:58 +0000 | [diff] [blame] | 907 | xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 908 | $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) $(build)=doc/DocBook $@ |
Marek Vasut | 30ff891 | 2012-10-06 14:04:58 +0000 | [diff] [blame] | 909 | |
Loïc Minier | 249b53a | 2011-10-03 11:57:10 +0200 | [diff] [blame] | 910 | tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 911 | $(MAKE) $(build)=tools HOST_TOOLS_ALL=y |
Mike Frysinger | 0358df4 | 2010-08-15 00:03:21 -0400 | [diff] [blame] | 912 | |
Wolfgang Denk | 4e53a25 | 2006-10-25 00:43:17 +0200 | [diff] [blame] | 913 | .PHONY : CHANGELOG |
| 914 | CHANGELOG: |
Ben Warren | b985b5d | 2006-10-26 14:38:25 -0400 | [diff] [blame] | 915 | git log --no-merges U-Boot-1_1_5.. | \ |
| 916 | unexpand -a | sed -e 's/\s\s*$$//' > $@ |
Wolfgang Denk | 4e53a25 | 2006-10-25 00:43:17 +0200 | [diff] [blame] | 917 | |
Harald Welte | 0a823aa | 2008-07-09 22:30:30 +0800 | [diff] [blame] | 918 | include/license.h: tools/bin2header COPYING |
Wolfgang Denk | 0e42ada | 2010-05-27 23:18:33 +0200 | [diff] [blame] | 919 | cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 920 | ######################################################################### |
| 921 | |
| 922 | unconfig: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 923 | @rm -f include/config.h include/config.mk \ |
| 924 | board/*/config.tmp board/*/*/config.tmp \ |
| 925 | include/autoconf.mk include/autoconf.mk.dep \ |
| 926 | include/spl-autoconf.mk \ |
| 927 | include/tpl-autoconf.mk |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 928 | |
Wolfgang Denk | a6862bc | 2010-05-27 23:18:36 +0200 | [diff] [blame] | 929 | %_config:: unconfig |
| 930 | @$(MKCONFIG) -A $(@:_config=) |
| 931 | |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 932 | ######################################################################### |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 933 | |
| 934 | clean: |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 935 | @rm -f examples/standalone/atmel_df_pow2 \ |
| 936 | examples/standalone/hello_world \ |
| 937 | examples/standalone/interrupt \ |
| 938 | examples/standalone/mem_to_mem_idma2intr \ |
| 939 | examples/standalone/sched \ |
| 940 | $(addprefix examples/standalone/, smc91111_eeprom smc911x_eeprom) \ |
| 941 | examples/standalone/test_burst \ |
| 942 | examples/standalone/timer |
| 943 | @rm -f $(addprefix examples/api/, demo demo.bin) |
| 944 | @rm -f tools/bmp_logo tools/easylogo/easylogo \ |
| 945 | tools/env/fw_printenv \ |
| 946 | tools/envcrc \ |
| 947 | $(addprefix tools/gdb/, gdbcont gdbsend) \ |
| 948 | tools/gen_eth_addr tools/img2srec \ |
| 949 | tools/dumpimage \ |
| 950 | $(addprefix tools/, mkenvimage mkimage) \ |
| 951 | tools/mpc86x_clk \ |
| 952 | $(addprefix tools/, mk$(BOARD)spl mkexynosspl) \ |
| 953 | tools/mxsboot \ |
| 954 | tools/ncb tools/ubsha1 \ |
| 955 | tools/kernel-doc/docproc \ |
| 956 | tools/proftool |
| 957 | @rm -f $(addprefix board/cray/L1/, bootscript.c bootscript.image) \ |
| 958 | board/matrix_vision/*/bootscript.img \ |
| 959 | spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl \ |
| 960 | u-boot.lds \ |
| 961 | $(addprefix arch/blackfin/cpu/, init.lds init.elf) |
| 962 | @rm -f include/bmp_logo.h |
| 963 | @rm -f include/bmp_logo_data.h |
| 964 | @rm -f lib/asm-offsets.s |
| 965 | @rm -f include/generated/asm-offsets.h |
| 966 | @rm -f $(CPUDIR)/$(SOC)/asm-offsets.s |
Peter Tyser | d4abc75 | 2009-07-20 19:02:21 -0500 | [diff] [blame] | 967 | @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 968 | @$(MAKE) -f $(srctree)/doc/DocBook/Makefile cleandocs |
Wolfgang Denk | ae6d105 | 2008-01-13 00:59:21 +0100 | [diff] [blame] | 969 | @find $(OBJTREE) -type f \ |
Tom Rini | 4a30f1e | 2012-02-20 13:50:10 +0000 | [diff] [blame] | 970 | \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ |
Troy Kisky | 71a988a | 2013-01-18 16:14:24 +0000 | [diff] [blame] | 971 | -o -name '*.o' -o -name '*.a' -o -name '*.exe' \ |
| 972 | -o -name '*.cfgtmp' \) -print \ |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 973 | | xargs rm -f |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 974 | |
Andy Fleming | 734329f | 2011-11-21 13:40:43 +0000 | [diff] [blame] | 975 | # Removes everything not needed for testing u-boot |
| 976 | tidy: clean |
| 977 | @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f |
| 978 | |
| 979 | clobber: tidy |
| 980 | @find $(OBJTREE) -type f \( -name '*.srec' \ |
| 981 | -o -name '*.bin' -o -name u-boot.img \) \ |
| 982 | -print0 | xargs -0 rm -f |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 983 | @rm -f $(OBJS) *.bak ctags etags TAGS \ |
| 984 | cscope.* *.*~ |
| 985 | @rm -f u-boot u-boot.map u-boot.hex $(ALL-y) |
| 986 | @rm -f u-boot.kwb |
| 987 | @rm -f u-boot.pbl |
| 988 | @rm -f u-boot.imx |
| 989 | @rm -f u-boot-with-spl.imx |
| 990 | @rm -f u-boot-with-nand-spl.imx |
| 991 | @rm -f u-boot.ubl |
| 992 | @rm -f u-boot.ais |
| 993 | @rm -f u-boot.dtb |
| 994 | @rm -f u-boot.sb |
| 995 | @rm -f u-boot.spr |
| 996 | @rm -f $(addprefix nand_spl/, u-boot.lds u-boot.lst System.map) |
| 997 | @rm -f $(addprefix nand_spl/, u-boot-nand_spl.lds u-boot-spl u-boot-spl.map) |
| 998 | @rm -f $(addprefix spl/, u-boot-spl u-boot-spl.bin u-boot-spl.map) |
| 999 | @rm -f spl/u-boot-spl.lds |
| 1000 | @rm -f $(addprefix tpl/, u-boot-tpl u-boot-tpl.bin u-boot-tpl.map) |
| 1001 | @rm -f tpl/u-boot-spl.lds |
| 1002 | @rm -f MLO MLO.byteswap |
| 1003 | @rm -f SPL |
| 1004 | @rm -f tools/xway-swap-bytes |
| 1005 | @rm -fr include/asm/proc include/asm/arch include/asm |
| 1006 | @rm -fr include/generated |
| 1007 | @[ ! -d nand_spl ] || find nand_spl -name "*" -type l -print | xargs rm -f |
| 1008 | @rm -f dts/*.tmp |
| 1009 | @rm -f $(addprefix spl/, u-boot-spl.ais, u-boot-spl-pad.ais) |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1010 | |
| 1011 | mrproper \ |
| 1012 | distclean: clobber unconfig |
Mike Frysinger | afd077b | 2011-06-24 18:37:55 +0000 | [diff] [blame] | 1013 | ifneq ($(OBJTREE),$(SRCTREE)) |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 1014 | rm -rf * |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 1015 | endif |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1016 | |
| 1017 | backup: |
| 1018 | F=`basename $(TOPDIR)` ; cd .. ; \ |
Ilya Yanok | d6b9371 | 2010-06-21 18:13:21 +0400 | [diff] [blame] | 1019 | gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F |
wdenk | 7ebf744 | 2002-11-02 23:17:16 +0000 | [diff] [blame] | 1020 | |
| 1021 | ######################################################################### |
Masahiro Yamada | 9e41403 | 2014-02-04 17:24:24 +0900 | [diff] [blame^] | 1022 | |
| 1023 | endif # skip-makefile |
| 1024 | |
| 1025 | PHONY += FORCE |
| 1026 | FORCE: |
| 1027 | |
| 1028 | # Declare the contents of the .PHONY variable as phony. We keep that |
| 1029 | # information in a variable so we can use it in if_changed and friends. |
| 1030 | .PHONY: $(PHONY) |