Lines Matching +full:u +full:- +full:boot +full:- +full:spl
2 # SPDX-License-Identifier: GPL-2.0+
17 # o Do not use make's built-in rules and variables
18 # (this increases performance and avoids hard-to-debug behaviour);
20 MAKEFLAGS += -rR --include-dir=$(CURDIR)
34 # Most importantly: sub-Makefiles should only ever modify files in
37 # unavoidable when linking the built-in.o targets which finally
48 # ---------------------------------------------------------------------------
55 # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
62 # A simple variant is to prefix commands with $(Q) - that's useful
63 # for commands that shall be hidden in non-verbose mode.
88 # If the user is running make -s (silent mode), suppress echoing of
91 ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
95 else # make-3.8x
96 ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
138 saved-output := $(KBUILD_OUTPUT)
139 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
142 $(error failed to create output directory "$(saved-output)"))
144 PHONY += $(MAKECMDGOALS) sub-make
146 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
149 sub-make: FORCE
150 $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
151 -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
154 skip-makefile := 1
159 ifeq ($(skip-makefile),)
164 MAKEFLAGS += --no-print-directory
169 # Use 'make C=1' to enable checking of only re-compiled files.
171 # of whether they are re-compiled or not.
227 HOSTARCH := $(shell uname -m | \
228 sed -e s/i.86/x86/ \
229 -e s/sun4u/sparc64/ \
230 -e s/arm.*/arm/ \
231 -e s/sa110/arm/ \
232 -e s/ppc64/powerpc/ \
233 -e s/ppc/powerpc/ \
234 -e s/macppc/powerpc/\
235 -e s/sh.*/sh/)
237 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
238 sed -e 's/\(cygwin\).*/cygwin/')
253 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
254 else if [ -x /bin/bash ]; then echo /bin/bash; \
259 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
260 $(if $(CONFIG_TOOLS_DEBUG),-g)
261 HOSTCXXFLAGS = -O2
264 HOSTCFLAGS += -ansi
269 # and use GNU C's cpp. To do this we pass the -traditional-cpp
270 # option to the compiler. Note that the -traditional-cpp flag
276 # -multiply_defined suppress option to turn off this error.
280 DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
281 DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
283 os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
284 $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)
288 HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
289 HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
294 HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
297 # Decide whether to build built-in, modular, or both.
298 # Normally, just do built-in.
303 # If we have only "make modules", don't compile built-in objects.
305 # the built-in objects during the descend as well, in order to
316 # U-Boot does not need modules
336 ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2> /dev/null),)
342 CPP = $(CC) -E
355 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
356 -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
358 KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
360 KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
361 -Wno-format-security \
362 -fno-builtin -ffreestanding
363 KBUILD_CFLAGS += -fshort-wchar -Werror
364 KBUILD_AFLAGS := -D__ASSEMBLY__
380 # When compiling out-of-tree modules, put MODVERDIR in the module
382 # even be read-only.
387 export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
388 -name CVS -o -name .pc -o -name .hg -o -name .git \) \
389 -prune -o
390 export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
391 --exclude CVS --exclude .pc --exclude .hg --exclude .git
400 $(Q)rm -f .tmp_quiet_recordmcount
401 @mkdir -p spl/board/forlinx/ok3568/nxp_a1007
402 @mkdir -p tpl/board/forlinx/ok3568/nxp_a1007
404 @cp release-uboot/spl/fuse.mod spl/board/forlinx/ok3568/fuse.o
405 @cp release-uboot/tpl/fuse.mod tpl/board/forlinx/ok3568/fuse.o
407 @cp release-uboot/spl/eep.mod spl/board/forlinx/ok3568/eep.o
408 @cp release-uboot/tpl/eep.mod tpl/board/forlinx/ok3568/eep.o
409 @cp board/forlinx/ok3568/nxp-a1007.mod board/forlinx/ok3568/nxp_a1007/nxp-a1007.o
410 @cp release-uboot/spl/nxp-a1007.mod spl/board/forlinx/ok3568/nxp_a1007/nxp-a1007.o
411 @cp release-uboot/tpl/nxp-a1007.mod tpl/board/forlinx/ok3568/nxp_a1007/nxp-a1007.o
412 @cp arch/arm/mach-rockchip/board.mod arch/arm/mach-rockchip/board.o
414 @cp release-uboot/spl/menu.mod spl/board/forlinx/ok3568/menu.o
415 @cp release-uboot/tpl/menu.mod tpl/board/forlinx/ok3568/menu.o
427 $(Q)ln -fsn $(srctree) source
443 no-dot-config-targets := clean clobber mrproper distclean \
447 config-targets := 0
448 mixed-targets := 0
449 dot-config := 1
451 ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
452 ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
453 dot-config := 0
459 config-targets := 1
461 mixed-targets := 1
466 ifeq ($(mixed-targets),1)
473 $(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one
477 $(Q)set -e; \
479 $(MAKE) -f $(srctree)/Makefile $$i; \
483 ifeq ($(config-targets),1)
485 # *config targets only - make sure prerequisites are updated, and descend
499 # Build targets only - this includes vmlinux, arch specific targets, clean
509 ifeq ($(dot-config),1)
511 -include include/config/auto.conf
515 -include include/config/auto.conf.cmd
525 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
527 @# deleted so "make silentoldconfig" will be re-run on the next build.
528 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf || \
529 { rm -f include/config/auto.conf; false; }
536 u-boot.cfg spl/u-boot.cfg tpl/u-boot.cfg: include/config.h FORCE
537 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf $(@)
539 -include include/autoconf.mk
540 -include include/autoconf.mk.dep
543 # is up-to-date. When we switch to a different board configuration, old CONFIG
548 autoconf_is_old := $(shell find . -path ./$(KCONFIG_CONFIG) -newer \
557 # These are set by the arch-specific config.mk. Make sure they are exported
571 #LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds.debug
581 LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds
584 LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot.lds
587 LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot.lds
594 endif # $(dot-config)
597 # Xtensa linker script cannot be preprocessed with -ansi because of
601 LDPPFLAGS += -ansi
605 KBUILD_CFLAGS += -Os
607 KBUILD_CFLAGS += -O2
610 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
611 KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
613 KBUILD_CFLAGS += -g
614 # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
616 KBUILD_AFLAGS += -g
619 ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y)
620 KBUILD_CFLAGS += -fstack-usage
623 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
624 KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
628 ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
629 KBUILD_AFLAGS += -Wa,-gstabs,-S
633 # Prohibit date/time macros, which would make the build non-deterministic
634 KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
646 -Iinclude \
647 $(if $(KBUILD_SRC), -I$(srctree)/include) \
650 -I$(srctree)/arch/$(ARCH)/thumb1/include),) \
651 -I$(srctree)/arch/$(ARCH)/include \
652 -include $(srctree)/include/linux/kconfig.h
654 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
663 # U-Boot objects....order is important (i.e. start must be first)
667 libs-y += lib/
668 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
669 libs-$(CONFIG_OF_EMBED) += dts/
671 libs-y += fs/
672 libs-y += net/
673 libs-y += disk/
674 libs-y += drivers/
675 libs-y += drivers/cpu/
676 libs-y += drivers/dma/
677 libs-y += drivers/gpio/
678 libs-y += drivers/i2c/
679 libs-y += drivers/mtd/
680 libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/
681 libs-y += drivers/mtd/onenand/
682 libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
683 libs-y += drivers/mtd/spi/
684 libs-y += drivers/net/
685 libs-y += drivers/net/phy/
686 libs-y += drivers/pci/
687 libs-y += drivers/power/ \
695 drivers/power/io-domain/ \
697 libs-y += drivers/spi/
698 libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
699 libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
700 libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
701 libs-$(CONFIG_ALTERA_SDRAM) += drivers/ddr/altera/
702 libs-y += drivers/serial/
703 libs-y += drivers/usb/cdns3/
704 libs-y += drivers/usb/dwc3/
705 libs-y += drivers/usb/common/
706 libs-y += drivers/usb/emul/
707 libs-y += drivers/usb/eth/
708 libs-y += drivers/usb/gadget/
709 libs-y += drivers/usb/gadget/udc/
710 libs-y += drivers/usb/host/
711 libs-y += drivers/usb/musb/
712 libs-y += drivers/usb/musb-new/
713 libs-y += drivers/usb/phy/
714 libs-y += drivers/usb/ulpi/
715 libs-y += cmd/
716 libs-y += common/
717 libs-y += env/
718 libs-$(CONFIG_API) += api/
719 libs-$(CONFIG_HAS_POST) += post/
721 libs-y += test/
722 libs-y += test/dm/
723 libs-$(CONFIG_UT_ENV) += test/env/
724 libs-$(CONFIG_UT_OVERLAY) += test/overlay/
726 libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
728 libs-y := $(sort $(libs-y))
730 u-boot-dirs := $(patsubst %/,%,$(filter %/, $(libs-y))) tools examples
732 u-boot-alldirs := $(sort $(u-boot-dirs) $(patsubst %/,%,$(filter %/, $(libs-))))
734 libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
736 u-boot-init := $(head-y)
737 u-boot-main := $(libs-y)
744 PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
754 -include $(srctree)/include/u-boot/u-boot.lds.h \
755 -DCPUDIR=$(CPUDIR) \
756 $(shell $(LD) --version | \
757 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
764 @actual=`wc -c $@ | awk '{print $$1}'`; \
766 if test $$actual -gt $$limit; then \
770 echo " excess: $$((actual - limit)) bytes" >&2; \
777 # Statically apply RELA-style relocations (currently arm64 only)
782 # $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base
784 start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \
785 end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \
786 tools/relocate-rela $(2) $(3) $$start $$end
792 ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check
793 ALL-$(CONFIG_SUPPORT_USBPLUG) += usbplug.bin
795 ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
797 ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin
800 # For Secure Boot The Image needs to be signed and Header must also
802 ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
805 ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
807 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img
809 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
811 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
812 ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb
814 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
816 ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb
818 ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
820 ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
821 ALL-$(CONFIG_EFI_APP) += u-boot-app.efi
822 ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi
825 ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
828 # enable combined SPL/u-boot/dtb rules for tegra
830 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
831 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
836 ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)
839 LDFLAGS_u-boot += $(LDFLAGS_FINAL)
842 LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
845 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
850 cmd_objcopy = $(OBJCOPY) --gap-fill=0xff $(OBJCOPYFLAGS) \
858 cmd_efipayload = $(OBJCOPY) -I binary -O $(EFIPAYLOAD_BFDTARGET) -B $(EFIPAYLOAD_BFDARCH) $< $@
863 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
867 cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -E $@ \
871 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
873 append = cat $(filter-out $< $(PHONY), $^) >> $@
876 cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
878 cfg: u-boot.cfg
881 cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
884 all: $(ALL-y) cfg
895 $(call cmd,cfgcheck,u-boot.cfg)
900 dts/dt.dtb: u-boot
907 cmd_truncate = truncate -s "%8" $@
911 fit-dtb.blob: dts/dt.dtb FORCE
914 MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
915 -a 0 -e 0 -E \
916 $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
918 u-boot-fit-dtb.bin: u-boot-nodtb.bin fit-dtb.blob
921 u-boot.bin: u-boot-fit-dtb.bin FORCE
925 u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
930 u-boot-dtb-kern.bin: u-boot-dtb.bin FORCE
933 u-boot.bin: u-boot-dtb-kern.bin $(EMBED_KERN_DTB) FORCE
936 u-boot.bin: u-boot-dtb.bin FORCE
942 u-boot.bin: u-boot-nodtb.bin FORCE
947 usbplug.bin: u-boot.bin
952 $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
960 u-boot.dtb: dts/dt.dtb FORCE
963 OBJCOPYFLAGS_u-boot.hex := -O ihex
965 OBJCOPYFLAGS_u-boot.srec := -O srec
967 u-boot.hex u-boot.srec: u-boot FORCE
970 OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
971 $(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec)
973 binary_size_check: u-boot-nodtb.bin FORCE
974 @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
975 map_size=$(shell cat u-boot.map | \
976 … = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \
980 if test $$map_size -ne $$file_size; then \
981 echo "u-boot.map shows a binary size of $$map_size" >&2 ; \
982 echo " but u-boot-nodtb.bin shows $$file_size" >&2 ; \
987 u-boot-nodtb.bin: u-boot FORCE
992 u-boot.ldr: u-boot
994 $(LDR) -T $(CONFIG_CPU) -c $@ $< $(LDR_FLAGS)
998 # ---------------------------------------------------------------------------
1000 cmd_binman = $(srctree)/tools/binman/binman -d u-boot.dtb -O . \
1001 -I . -I $(srctree)/board/$(BOARDDIR) $<
1003 OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
1005 OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
1007 u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
1011 # U-Boot entry point, needed for booting of full-blown U-Boot
1012 # from the SPL U-Boot version.
1020 cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
1021 -DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
1029 U_BOOT_ITS := u-boot.its
1037 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
1038 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
1039 -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
1040 $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST)))
1042 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
1043 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
1044 -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
1045 MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
1046 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
1047 -n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
1048 u-boot-ivt.img: MKIMAGEOUTPUT = u-boot-ivt.img.log
1049 CLEAN_FILES += u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log
1052 MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
1054 MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
1055 -T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
1057 MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
1058 -T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
1059 $(if $(KEYDIR),-k $(KEYDIR))
1061 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
1062 -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
1064 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
1065 $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin dts/dt.dtb,u-boot.bin) FORCE
1068 u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE
1071 u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
1074 u-boot.sha1: u-boot.bin
1075 tools/ubsha1 u-boot.bin
1077 u-boot.dis: u-boot
1078 $(OBJDUMP) -d $< > $@
1081 SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
1083 SPL_PAYLOAD := u-boot.bin
1086 OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
1087 --pad-to=$(CONFIG_SPL_PAD_TO)
1088 u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE
1091 MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
1093 lpc32xx-spl.img: spl/u-boot-spl.bin FORCE
1096 OBJCOPYFLAGS_lpc32xx-boot-0.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
1098 lpc32xx-boot-0.bin: lpc32xx-spl.img FORCE
1101 OBJCOPYFLAGS_lpc32xx-boot-1.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
1103 lpc32xx-boot-1.bin: lpc32xx-spl.img FORCE
1106 lpc32xx-full.bin: lpc32xx-boot-0.bin lpc32xx-boot-1.bin u-boot.img FORCE
1109 CLEAN_FILES += lpc32xx-*
1111 OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
1112 --pad-to=$(CONFIG_TPL_PAD_TO)
1113 tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
1116 SPL: spl/u-boot-spl.bin FORCE target
1117 $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
1119 u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
1120 $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
1122 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE)
1124 u-boot.ubl: u-boot-with-spl.bin FORCE
1127 MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \
1129 -T aisimage -e $(CONFIG_SPL_TEXT_BASE)
1130 spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE
1133 OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
1134 u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE
1137 u-boot-signed.sb: u-boot.bin spl/u-boot-spl.bin
1138 $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs u-boot-signed.sb
1139 u-boot.sb: u-boot.bin spl/u-boot-spl.bin
1140 $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs u-boot.sb
1142 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
1145 # SPL image (with mkimage header) and not the binary. Otherwise the resulting image
1147 # The resulting image containing both U-Boot images is called u-boot.spr
1148 MKIMAGEFLAGS_u-boot-spl.img = -A $(ARCH) -T firmware -C none \
1149 -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER
1150 spl/u-boot-spl.img: spl/u-boot-spl.bin FORCE
1153 OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
1154 --gap-fill=0xff
1155 u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
1160 cmd_socboot = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
1161 spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
1162 u-boot.img > $@ || rm -f $@
1163 u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
1167 # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
1168 # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
1172 rom: u-boot.rom FORCE
1179 $(filter-out FORCE,$^) -o $@
1181 u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
1182 $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
1186 OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
1187 u-boot-x86-16bit.bin: u-boot FORCE
1192 u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
1197 OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
1198 u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
1201 OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
1202 u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
1205 u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
1209 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
1210 u-boot-app.efi: u-boot FORCE
1213 u-boot.bin.o: u-boot.bin FORCE
1216 u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
1219 # Rule to link the EFI payload which contains a stub and a U-Boot binary
1220 quiet_cmd_u-boot_payload ?= LD $@
1221 cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
1222 -T u-boot-payload.lds arch/x86/cpu/call32.o \
1223 lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
1226 u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
1227 $(call if_changed,u-boot_payload)
1229 OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)
1230 u-boot-payload.efi: u-boot-payload FORCE
1233 u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE
1236 #Add a target to create boot binary having SPL binary in PBI format
1237 #concatenated with u-boot binary. It is need by PowerPC SoC having
1239 MKIMAGEFLAGS_u-boot-spl.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
1240 -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage \
1241 -A $(ARCH) -a $(CONFIG_SPL_TEXT_BASE)
1243 spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
1247 UBOOT_BINLOAD := u-boot.img
1249 UBOOT_BINLOAD := u-boot.bin
1252 OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
1253 --gap-fill=0xff
1255 u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl $(UBOOT_BINLOAD) FORCE
1258 # PPC4xx needs the SPL at the end of the image, since the reset vector
1259 # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
1260 # and need to introduce a new build target with the full blown U-Boot
1261 # at the start padded up to the start of the SPL image. And then concat
1262 # the SPL image to the end.
1264 OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \
1265 --pad-to=$(CONFIG_UBOOT_PAD_TO) --gap-fill=0xff
1266 u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
1273 quiet_cmd_u-boot-elf ?= LD $@
1274 cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
1275 --defsym=$(PLATFORM_ELFENTRY)=$(CONFIG_SYS_TEXT_BASE) \
1276 -Ttext=$(CONFIG_SYS_TEXT_BASE)
1277 u-boot.elf: u-boot.bin
1278 $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o
1279 $(call if_changed,u-boot-elf)
1283 # Rule to link u-boot
1285 quiet_cmd_u-boot__ ?= LD $@
1286 cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
1287 -T u-boot.lds $(u-boot-init) \
1288 --start-group $(u-boot-main) --end-group \
1289 $(PLATFORM_LIBS) -Map u-boot.map; \
1290 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
1294 smap=`$(call SYSTEM_MAP,u-boot) | \
1296 $(CC) $(c_flags) -DSYSTEM_MAP="\"$${smap}\"" \
1297 -c $(srctree)/common/system_map.c -o common/system_map.o
1299 u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE target
1300 +$(call if_changed,u-boot__)
1303 $(call cmd,u-boot__) common/system_map.o
1307 cmd_sym ?= $(OBJDUMP) -t $< > $@
1308 u-boot.sym: u-boot FORCE
1313 $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
1315 # Handle descending into subdirectories listed in $(vmlinux-dirs)
1321 PHONY += $(u-boot-dirs)
1322 $(u-boot-dirs): prepare scripts
1327 $(filter-out tools, $(u-boot-dirs)): tools
1328 # The "examples" conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
1329 # is "yes"), so compile examples after U-Boot is compiled.
1330 examples: $(filter-out examples, $(u-boot-dirs))
1343 # A multi level approach is used. prepareN is processed before prepareN-1.
1355 @$(kecho) ' Using $(srctree) as source for U-Boot'
1356 $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
1382 # ---------------------------------------------------------------------------
1387 echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; \
1388 echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \
1389 echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; )
1394 echo \#define U_BOOT_VERSION \"USB-PLUG \" PLAIN_VERSION; \
1395 echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \
1396 echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; )
1402 # with the misused '-d' switch. Respect that and search a working date with
1403 # well known pre- and suffixes for the GNU variant of date.
1405 (if test -n "$${SOURCE_DATE_EPOCH}"; then \
1409 $${date} -u -d "$${SOURCE_DATE}" >/dev/null 2>&1 && DATE="$${date}"; \
1411 if test -n "$${DATE}"; then \
1412 LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
1413 LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
1414 LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
1415 LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
1416 LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
1435 # ---------------------------------------------------------------------------
1437 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \
1438 -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
1440 u-boot.lds: $(LDSCRIPT) prepare FORCE
1443 spl/u-boot-spl.bin: spl/u-boot-spl
1445 spl/u-boot-spl: tools prepare \
1448 $(Q)$(MAKE) obj=spl -f $(srctree)/scripts/Makefile.spl all
1450 spl/sunxi-spl.bin: spl/u-boot-spl
1453 spl/sunxi-spl-with-ecc.bin: spl/sunxi-spl.bin
1456 spl/u-boot-spl.sfp: spl/u-boot-spl
1459 spl/boot.bin: spl/u-boot-spl
1462 tpl/u-boot-tpl.bin: tools prepare \
1464 $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all
1466 TAG_SUBDIRS := $(patsubst %,$(srctree)/%,$(u-boot-dirs) include)
1469 FINDFLAGS := -L
1472 ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
1473 -name '*.[chS]' -print`
1474 ln -s ctags tags
1477 etags -a -o etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
1478 -name '*.[chS]' -print`
1480 $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
1482 cscope -b -q -k
1486 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
1488 System.map: u-boot
1493 # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
1494 # R_AARCH64_RELATIVE (64-bit).
1495 checkarmreloc: u-boot
1496 @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \
1497 grep R_A | sort -u`"; \
1498 if test "$$RELOC" != "R_ARM_RELATIVE" -a \
1507 tools-only: scripts_basic $(version_h) $(timestamp_h)
1510 tools-all: export HOST_TOOLS_ALL=y
1511 tools-all: envtools tools ;
1518 git log --no-merges U-Boot-1_1_5.. | \
1519 unexpand -a | sed -e 's/\s\s*$$//' > $@
1532 $(foreach d, spl tpl, $(patsubst %,$d/%, \
1533 $(filter-out include, $(shell ls -1 $d 2>/dev/null))))
1536 boot* u-boot* MLO* SPL System.map fit-dtb.blob *.bin *.img *.gz .cc
1539 MRPROPER_DIRS += include/config include/generated spl tpl \
1544 # clean - Delete most, but leave enough to build external modules
1546 clean: rm-dirs := $(CLEAN_DIRS)
1547 clean: rm-files := $(CLEAN_FILES)
1549 clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $(srctree)/$f/Makefile),$f))
1551 clean-dirs := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
1553 PHONY += $(clean-dirs) clean archclean
1554 $(clean-dirs):
1558 clean: $(clean-dirs)
1562 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
1563 -o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
1564 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
1565 -o -name '*.symtypes' -o -name 'modules.order' \
1566 -o -name modules.builtin -o -name '.tmp_*.o.*' \
1567 -o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
1568 -o -name '*.gcno' \) -type f -print | xargs rm -f
1570 # mrproper - Delete all generated files, including .config
1572 mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
1573 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
1574 mrproper-dirs := $(addprefix _mrproper_,scripts)
1576 PHONY += $(mrproper-dirs) mrproper archmrproper
1577 $(mrproper-dirs):
1580 mrproper: clean $(mrproper-dirs)
1583 @rm -f arch/*/include/asm/arch
1591 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
1592 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
1593 -o -name '.*.rej' -o -name '*%' -o -name 'core' \
1594 -o -name '*.pyc' \) \
1595 -type f -print | xargs rm -f
1596 @rm -f boards.cfg
1600 gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
1604 @echo ' clean - Remove most generated files but keep the config'
1605 @echo ' mrproper - Remove all generated files + config + various backup files'
1606 @echo ' distclean - mrproper + remove editor backup and patch files'
1609 @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
1612 @echo ' all - Build all necessary images depending on configuration'
1613 @echo ' tests - Build U-Boot for sandbox and run tests'
1614 @echo '* u-boot - Build the bare u-boot'
1615 @echo ' dir/ - Build all files in dir and below'
1616 @echo ' dir/file.[oisS] - Build specified target only'
1617 @echo ' dir/file.lst - Build specified mixed source/assembly target only'
1619 @echo ' tags/ctags - Generate ctags file for editors'
1620 @echo ' etags - Generate etags file for editors'
1621 @echo ' cscope - Generate cscope index'
1622 @echo ' ubootrelease - Output the release version string (use with make -s)'
1623 @echo ' ubootversion - Output the version stored in Makefile (use with make -s)'
1624 @echo " cfg - Don't build, just create the .cfg files"
1625 @echo " envtools - Build only the target-side environment tools"
1628 @echo ' checkstack - Generate a list of stack hogs'
1631 @$(MAKE) -f $(srctree)/doc/DocBook/Makefile dochelp
1652 # ---------------------------------------------------------------------------
1657 endif #ifeq ($(config-targets),1)
1658 endif #ifeq ($(mixed-targets),1)
1663 $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
1673 # ---------------------------------------------------------------------------
1675 # - build with mixed source and output
1676 # - build with separate output dir 'make O=...'
1677 # - external modules
1679 # target-dir => where to store outputfile
1680 # build-dir => directory in kernel source tree to use
1683 build-dir = $(patsubst %/,%,$(dir $@))
1684 target-dir = $(dir $@)
1686 zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
1687 build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
1688 target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
1692 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1694 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1696 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1698 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1700 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1702 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1704 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1710 $(build)=$(build-dir)
1714 $(build)=$(build-dir)
1718 $(build)=$(build-dir) $(@:.ko=.o)
1719 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1722 cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \
1723 sed --in-place -e 's/\x00/\x0A/g' $@
1725 u-boot-initial-env: u-boot.bin
1731 quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
1732 cmd_rmdirs = rm -rf $(rm-dirs)
1734 quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1735 cmd_rmfiles = rm -f $(rm-files)
1747 endif # skip-makefile