Commit 9e4140329ee9a787d0f96ac2829d618d47f7973f

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent d958002589

kbuild: change out-of-tree build

This commit changes the working directory
where the build process occurs.

Before this commit, build process occurred under the source
tree for both in-tree and out-of-tree build.

That's why we needed to add $(obj) prefix to all generated
files in makefiles like follows:
  $(obj)u-boot.bin:  $(obj)u-boot

Here, $(obj) is empty for in-tree build, whereas it points
to the output directory for out-of-tree build.

And our old build system changes the current working directory
with "make -C <sub-dir>" syntax when descending into the
sub-directories.

On the other hand, Kbuild uses a different idea
to handle out-of-tree build and directory descending.

The build process of Kbuild always occurs under the output tree.
When "O=dir/to/store/output/files" is given, the build system
changes the current working directory to that directory and
restarts the make.

Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>"
syntax for descending into sub-directories.
(We can write it like "make $(obj)=<sub-dir>" with a shorthand.)
This means the current working directory is always the top
of the output directory.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>

Showing 64 changed files with 612 additions and 744 deletions Side-by-side Diff

... ... @@ -674,8 +674,6 @@
674 674 output_dir="${OUTPUT_PREFIX}"
675 675 fi
676 676  
677   - export BUILD_DIR="${output_dir}"
678   -
679 677 target_arch=$(get_target_arch ${target})
680 678 eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
681 679 if [ "${cross_toolchain}" ] ; then
... ... @@ -684,6 +682,10 @@
684 682 MAKE="make CROSS_COMPILE=${CROSS_COMPILE}"
685 683 else
686 684 MAKE=make
  685 + fi
  686 +
  687 + if [ "${output_dir}" != "." ] ; then
  688 + MAKE="${MAKE} O=${output_dir}"
687 689 fi
688 690  
689 691 ${MAKE} distclean >/dev/null
Changes suppressed. Click to show
... ... @@ -14,8 +14,8 @@
14 14 else
15 15 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
16 16 endif
17   -TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h
18   -VERSION_FILE = $(obj)include/generated/version_autogenerated.h
  17 +TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
  18 +VERSION_FILE = include/generated/version_autogenerated.h
19 19  
20 20 HOSTARCH := $(shell uname -m | \
21 21 sed -e s/i.86/x86/ \
22 22  
23 23  
24 24  
25 25  
26 26  
... ... @@ -43,32 +43,82 @@
43 43 XECHO = :
44 44 endif
45 45  
46   -#########################################################################
  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/"
47 51 #
48   -# U-boot build supports generating object files in a separate external
49   -# directory. Two use cases are supported:
  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
50 57 #
51   -# 1) Add O= to the make command line
52   -# 'make O=/tmp/build all'
53   -#
54   -# 2) Set environment variable BUILD_DIR to point to the desired location
55   -# 'export BUILD_DIR=/tmp/build'
56   -# 'make'
57   -#
58   -# The second approach can also be used with a MAKEALL script
59   -# 'export BUILD_DIR=/tmp/build'
60   -# './MAKEALL'
61   -#
62   -# Command line 'O=' setting overrides BUILD_DIR environment variable.
63   -#
64   -# When none of the above methods is used the local build is performed and
65   -# the object files are placed in the source directory.
66   -#
  58 +# The O= assignment takes precedence over the KBUILD_OUTPUT environment
  59 +# variable.
67 60  
  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?
68 68 ifeq ("$(origin O)", "command line")
69   -BUILD_DIR := $(O)
  69 + KBUILD_OUTPUT := $(O)
70 70 endif
71 71  
  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 +
72 122 # Call a source code checker (by default, "sparse") as part of the
73 123 # C compilation.
74 124 #
75 125  
76 126  
77 127  
... ... @@ -87,41 +137,16 @@
87 137 endif
88 138 export CHECKSRC
89 139  
90   -ifneq ($(BUILD_DIR),)
91   -saved-output := $(BUILD_DIR)
92   -
93   -# Attempt to create a output directory.
94   -$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
95   -
96   -# Verify if it was successful.
97   -BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
98   -$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
99   -endif # ifneq ($(BUILD_DIR),)
100   -
101   -OBJTREE := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
  140 +OBJTREE := $(objtree)
102 141 SPLTREE := $(OBJTREE)/spl
103 142 TPLTREE := $(OBJTREE)/tpl
104   -SRCTREE := $(CURDIR)
105   -srctree := $(SRCTREE)
  143 +SRCTREE := $(srctree)
106 144 TOPDIR := $(SRCTREE)
107   -LNDIR := $(OBJTREE)
108   -export TOPDIR SRCTREE srctree OBJTREE SPLTREE TPLTREE
  145 +export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
109 146  
110 147 MKCONFIG := $(SRCTREE)/mkconfig
111 148 export MKCONFIG
112 149  
113   -# $(obj) and (src) are defined in config.mk but here in main Makefile
114   -# we also need them before config.mk is included which is the case for
115   -# some targets like unconfig, clean, clobber, distclean, etc.
116   -ifneq ($(OBJTREE),$(SRCTREE))
117   -obj := $(OBJTREE)/
118   -src := $(SRCTREE)/
119   -else
120   -obj :=
121   -src :=
122   -endif
123   -export obj src
124   -
125 150 # Make sure CDPATH settings don't interfere
126 151 unexport CDPATH
127 152  
128 153  
... ... @@ -136,14 +161,14 @@
136 161  
137 162 .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
138 163  
139   -ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
  164 +ifeq (include/config.mk,$(wildcard include/config.mk))
140 165  
141 166 # Include autoconf.mk before config.mk so that the config options are available
142 167 # to all top level build files. We need the dummy all: target to prevent the
143 168 # dependency target in autoconf.mk.dep from being the default.
144 169 all:
145   -sinclude $(obj)include/autoconf.mk.dep
146   -sinclude $(obj)include/autoconf.mk
  170 +sinclude include/autoconf.mk.dep
  171 +sinclude include/autoconf.mk
147 172  
148 173 SUBDIR_EXAMPLES-y := examples/standalone
149 174 SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
... ... @@ -152,7 +177,7 @@
152 177 endif
153 178  
154 179 # load ARCH, BOARD, and CPU configuration
155   -include $(obj)include/config.mk
  180 +include include/config.mk
156 181 export ARCH CPU BOARD VENDOR SOC
157 182  
158 183 # set default to nothing for native builds
... ... @@ -197,6 +222,9 @@
197 222 HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
198 223 endif
199 224  
  225 +# Look for make include files relative to root of kernel src
  226 +MAKEFLAGS += --include-dir=$(srctree)
  227 +
200 228 # We need some generic definitions (do not try to remake the file).
201 229 $(srctree)/scripts/Kbuild.include: ;
202 230 include $(srctree)/scripts/Kbuild.include
... ... @@ -287,7 +315,7 @@
287 315  
288 316 export CONFIG_SYS_TEXT_BASE
289 317  
290   -LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
  318 +LDFLAGS_u-boot += -T u-boot.lds $(LDFLAGS_FINAL)
291 319 ifneq ($(CONFIG_SYS_TEXT_BASE),)
292 320 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
293 321 endif
294 322  
... ... @@ -350,9 +378,9 @@
350 378 head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
351 379 head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
352 380  
353   -OBJS := $(addprefix $(obj),$(head-y))
  381 +OBJS := $(head-y)
354 382  
355   -HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n)
  383 +HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
356 384  
357 385 LIBS-y += lib/
358 386 LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
... ... @@ -412,7 +440,7 @@
412 440 LIBS-y += board/$(BOARDDIR)/
413 441  
414 442 LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
415   -LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
  443 +LIBS := $(sort $(LIBS-y))
416 444 .PHONY : $(LIBS)
417 445  
418 446 # Add GCC lib
... ... @@ -437,9 +465,6 @@
437 465 $(shell $(LD) --version | \
438 466 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
439 467  
440   -__OBJS := $(subst $(obj),,$(OBJS))
441   -__LIBS := $(subst $(obj),,$(LIBS))
442   -
443 468 #########################################################################
444 469 #########################################################################
445 470  
446 471  
447 472  
448 473  
449 474  
450 475  
451 476  
452 477  
453 478  
454 479  
455 480  
456 481  
457 482  
458 483  
459 484  
... ... @@ -464,66 +489,66 @@
464 489 DO_STATIC_RELA = \
465 490 start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \
466 491 end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \
467   - $(obj)tools/relocate-rela $(2) $(3) $$start $$end
  492 + tools/relocate-rela $(2) $(3) $$start $$end
468 493 else
469 494 DO_STATIC_RELA =
470 495 endif
471 496  
472 497 # Always append ALL so that arch config.mk's can add custom ones
473   -ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
  498 +ALL-y += u-boot.srec u-boot.bin System.map
474 499  
475   -ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
476   -ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
477   -ALL-$(CONFIG_RAMBOOT_PBL) += $(obj)u-boot.pbl
478   -ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
479   -ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.img
480   -ALL-$(CONFIG_TPL) += $(obj)tpl/u-boot-tpl.bin
481   -ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
  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
482 507 ifneq ($(CONFIG_SPL_TARGET),)
483   -ALL-$(CONFIG_SPL) += $(obj)$(CONFIG_SPL_TARGET:"%"=%)
  508 +ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
484 509 endif
485   -ALL-$(CONFIG_REMAKE_ELF) += $(obj)u-boot.elf
  510 +ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
486 511  
487 512 # enable combined SPL/u-boot/dtb rules for tegra
488 513 ifneq ($(CONFIG_TEGRA),)
489 514 ifeq ($(CONFIG_SPL),y)
490 515 ifeq ($(CONFIG_OF_SEPARATE),y)
491   -ALL-y += $(obj)u-boot-dtb-tegra.bin
  516 +ALL-y += u-boot-dtb-tegra.bin
492 517 else
493   -ALL-y += $(obj)u-boot-nodtb-tegra.bin
  518 +ALL-y += u-boot-nodtb-tegra.bin
494 519 endif
495 520 endif
496 521 endif
497 522  
498 523 all: $(ALL-y) $(SUBDIR_EXAMPLES-y)
499 524  
500   -$(obj)u-boot.dtb: checkdtc $(obj)u-boot
501   - $(MAKE) $(build) dts binary
502   - mv $(obj)dts/dt.dtb $@
  525 +u-boot.dtb: checkdtc u-boot
  526 + $(MAKE) $(build)=dts binary
  527 + mv dts/dt.dtb $@
503 528  
504   -$(obj)u-boot-dtb.bin: $(obj)u-boot.bin $(obj)u-boot.dtb
  529 +u-boot-dtb.bin: u-boot.bin u-boot.dtb
505 530 cat $^ >$@
506 531  
507   -$(obj)u-boot.hex: $(obj)u-boot
  532 +u-boot.hex: u-boot
508 533 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
509 534  
510   -$(obj)u-boot.srec: $(obj)u-boot
  535 +u-boot.srec: u-boot
511 536 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
512 537  
513   -$(obj)u-boot.bin: $(obj)u-boot
  538 +u-boot.bin: u-boot
514 539 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
515 540 $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
516 541 $(BOARD_SIZE_CHECK)
517 542  
518   -$(obj)u-boot.ldr: $(obj)u-boot
  543 +u-boot.ldr: u-boot
519 544 $(CREATE_LDR_ENV)
520 545 $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
521 546 $(BOARD_SIZE_CHECK)
522 547  
523   -$(obj)u-boot.ldr.hex: $(obj)u-boot.ldr
  548 +u-boot.ldr.hex: u-boot.ldr
524 549 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
525 550  
526   -$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
  551 +u-boot.ldr.srec: u-boot.ldr
527 552 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
528 553  
529 554 #
530 555  
531 556  
532 557  
533 558  
534 559  
535 560  
536 561  
537 562  
538 563  
539 564  
540 565  
541 566  
542 567  
543 568  
544 569  
545 570  
546 571  
... ... @@ -534,79 +559,78 @@
534 559 CONFIG_SYS_UBOOT_START := 0
535 560 endif
536 561  
537   -$(obj)u-boot.img: $(obj)u-boot.bin
538   - $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  562 +u-boot.img: u-boot.bin
  563 + tools/mkimage -A $(ARCH) -T firmware -C none \
539 564 -O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
540 565 -e $(CONFIG_SYS_UBOOT_START) \
541 566 -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
542 567 sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
543 568 -d $< $@
544 569  
545   -$(obj)u-boot.imx: $(obj)u-boot.bin depend
546   - $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
  570 +u-boot.imx: u-boot.bin depend
  571 + $(MAKE) $(build)=arch/arm/imx-common $(objtree)/u-boot.imx
547 572  
548   -$(obj)u-boot.kwb: $(obj)u-boot.bin
549   - $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
  573 +u-boot.kwb: u-boot.bin
  574 + tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
550 575 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
551 576  
552   -$(obj)u-boot.pbl: $(obj)u-boot.bin
553   - $(obj)tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
  577 +u-boot.pbl: u-boot.bin
  578 + tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
554 579 -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \
555 580 -d $< $@
556 581  
557   -$(obj)u-boot.sha1: $(obj)u-boot.bin
558   - $(obj)tools/ubsha1 $(obj)u-boot.bin
  582 +u-boot.sha1: u-boot.bin
  583 + tools/ubsha1 u-boot.bin
559 584  
560   -$(obj)u-boot.dis: $(obj)u-boot
  585 +u-boot.dis: u-boot
561 586 $(OBJDUMP) -d $< > $@
562 587  
563 588 # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
564 589 # $(4) is pad-to
565 590 SPL_PAD_APPEND = \
566 591 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \
567   - $(1) $(obj)$(3); \
568   - cat $(obj)$(3) $(2) > $@; \
569   - rm $(obj)$(3)
  592 + $(1) $(3); \
  593 + cat $(3) $(2) > $@; \
  594 + rm $(3)
570 595  
571 596 ifdef CONFIG_TPL
572   -SPL_PAYLOAD := $(obj)tpl/u-boot-with-tpl.bin
  597 +SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
573 598 else
574   -SPL_PAYLOAD := $(obj)u-boot.bin
  599 +SPL_PAYLOAD := u-boot.bin
575 600 endif
576 601  
577   -$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(SPL_PAYLOAD)
  602 +u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD)
578 603 $(call SPL_PAD_APPEND,$<,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
579 604  
580   -$(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
581   - $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
  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))
582 607  
583   -$(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
584   - $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
  608 +u-boot-with-spl.imx: spl/u-boot-spl.bin u-boot.bin
  609 + $(MAKE) $(build)=arch/arm/imx-common \
585 610 $(OBJTREE)/u-boot-with-spl.imx
586 611  
587   -$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
588   - $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
  612 +u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
  613 + $(MAKE) $(build)=arch/arm/imx-common \
589 614 $(OBJTREE)/u-boot-with-nand-spl.imx
590 615  
591   -$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
592   - $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
593   - -e $(CONFIG_SYS_TEXT_BASE) -d $< $(obj)u-boot.ubl
  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
594 619  
595   -$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
596   - $(obj)tools/mkimage -s -n $(if $(CONFIG_AIS_CONFIG_FILE),$(CONFIG_AIS_CONFIG_FILE),"/dev/null") \
  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") \
597 622 -T aisimage \
598 623 -e $(CONFIG_SPL_TEXT_BASE) \
599   - -d $(obj)spl/u-boot-spl.bin \
600   - $(obj)spl/u-boot-spl.ais
  624 + -d spl/u-boot-spl.bin \
  625 + spl/u-boot-spl.ais
601 626 $(OBJCOPY) ${OBJCFLAGS} -I binary \
602 627 --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
603   - $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
604   - cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
605   - $(obj)u-boot.ais
  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
606 630  
607 631  
608   -$(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
609   - $(MAKE) $(build) $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
  632 +u-boot.sb: u-boot.bin spl/u-boot-spl.bin
  633 + $(MAKE) $(build)=$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
610 634  
611 635 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
612 636 # Both images are created using mkimage (crc etc), so that the ROM
613 637  
614 638  
615 639  
616 640  
617 641  
618 642  
619 643  
620 644  
621 645  
622 646  
623 647  
624 648  
625 649  
626 650  
627 651  
628 652  
629 653  
630 654  
631 655  
632 656  
633 657  
634 658  
635 659  
636 660  
637 661  
638 662  
... ... @@ -614,124 +638,123 @@
614 638 # SPL image (with mkimage header) and not the binary. Otherwise the resulting image
615 639 # which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
616 640 # The resulting image containing both U-Boot images is called u-boot.spr
617   -$(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
618   - $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  641 +u-boot.spr: u-boot.img spl/u-boot-spl.bin
  642 + tools/mkimage -A $(ARCH) -T firmware -C none \
619 643 -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
620   - -d $(obj)spl/u-boot-spl.bin $@
  644 + -d spl/u-boot-spl.bin $@
621 645 $(OBJCOPY) -I binary -O binary \
622 646 --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
623   - cat $(obj)u-boot.img >> $@
  647 + cat u-boot.img >> $@
624 648  
625 649 ifneq ($(CONFIG_TEGRA),)
626   -$(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
627   - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
628   - cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > $@
629   - rm $(obj)spl/u-boot-spl-pad.bin
  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
630 654  
631 655 ifeq ($(CONFIG_OF_SEPARATE),y)
632   -$(obj)u-boot-dtb-tegra.bin: $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb
633   - cat $(obj)u-boot-nodtb-tegra.bin $(obj)u-boot.dtb > $@
  656 +u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin u-boot.dtb
  657 + cat u-boot-nodtb-tegra.bin u-boot.dtb > $@
634 658 endif
635 659 endif
636 660  
637   -$(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
638   - cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
  661 +u-boot-img.bin: spl/u-boot-spl.bin u-boot.img
  662 + cat spl/u-boot-spl.bin u-boot.img > $@
639 663  
640 664 # PPC4xx needs the SPL at the end of the image, since the reset vector
641 665 # is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
642 666 # and need to introduce a new build target with the full blown U-Boot
643 667 # at the start padded up to the start of the SPL image. And then concat
644 668 # the SPL image to the end.
645   -$(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
  669 +u-boot-img-spl-at-end.bin: spl/u-boot-spl.bin u-boot.img
646 670 $(OBJCOPY) -I binary -O binary --pad-to=$(CONFIG_UBOOT_PAD_TO) \
647   - --gap-fill=0xff $(obj)u-boot.img $@
648   - cat $(obj)spl/u-boot-spl.bin >> $@
  671 + --gap-fill=0xff u-boot.img $@
  672 + cat spl/u-boot-spl.bin >> $@
649 673  
650 674 # Create a new ELF from a raw binary file. This is useful for arm64
651 675 # where static relocation needs to be performed on the raw binary,
652 676 # but certain simulators only accept an ELF file (but don't do the
653 677 # relocation).
654 678 # FIXME refactor dts/Makefile to share target/arch detection
655   -$(obj)u-boot.elf: $(obj)u-boot.bin
  679 +u-boot.elf: u-boot.bin
656 680 @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \
657   - $< $(obj)u-boot-elf.o
658   - @$(LD) $(obj)u-boot-elf.o -o $@ \
  681 + $< u-boot-elf.o
  682 + @$(LD) u-boot-elf.o -o $@ \
659 683 --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
660 684 -Ttext=$(CONFIG_SYS_TEXT_BASE)
661 685  
662 686 ifeq ($(CONFIG_SANDBOX),y)
663 687 GEN_UBOOT = \
664   - cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
665   - -Wl,--start-group $(__LIBS) -Wl,--end-group \
  688 + $(CC) $(SYMS) -T u-boot.lds \
  689 + -Wl,--start-group $(LIBS) -Wl,--end-group \
666 690 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
667 691 else
668 692 GEN_UBOOT = \
669   - cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
670   - $(__OBJS) \
671   - --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
  693 + $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
  694 + $(OBJS) \
  695 + --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
672 696 -Map u-boot.map -o u-boot
673 697 endif
674 698  
675   -$(obj)u-boot: depend \
676   - $(SUBDIR_TOOLS) $(OBJS) $(LIBS) $(obj)u-boot.lds
  699 +u-boot: depend $(SUBDIR_TOOLS) $(OBJS) $(LIBS) u-boot.lds
677 700 $(GEN_UBOOT)
678 701 ifeq ($(CONFIG_KALLSYMS),y)
679   - smap=`$(call SYSTEM_MAP,$(obj)u-boot) | \
  702 + smap=`$(call SYSTEM_MAP,u-boot) | \
680 703 awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
681 704 $(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
682   - -c common/system_map.c -o $(obj)common/system_map.o
683   - $(GEN_UBOOT) $(obj)common/system_map.o
  705 + -c $(srctree)/common/system_map.c -o common/system_map.o
  706 + $(GEN_UBOOT) common/system_map.o
684 707 endif
685 708  
686 709 $(OBJS):
687 710 @:
688 711  
689 712 $(LIBS): depend $(SUBDIR_TOOLS)
690   - $(MAKE) $(build) $(dir $(subst $(obj),,$@))
  713 + $(MAKE) $(build)=$(patsubst %/,%,$(dir $@))
691 714  
692 715 $(SUBDIRS): depend
693   - $(MAKE) $(build) $@ all
  716 + $(MAKE) $(build)=$@ all
694 717  
695   -$(SUBDIR_EXAMPLES-y): $(obj)u-boot
  718 +$(SUBDIR_EXAMPLES-y): u-boot
696 719  
697   -$(obj)u-boot.lds: $(LDSCRIPT) depend
  720 +u-boot.lds: $(LDSCRIPT) depend
698 721 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$< >$@
699 722  
700 723 nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend
701   - $(MAKE) $(build) nand_spl/board/$(BOARDDIR) all
  724 + $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
702 725  
703   -$(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
704   - cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
  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
705 728  
706   -$(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend
707   - $(MAKE) -C spl all
  729 +spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend
  730 + $(MAKE) obj=spl -f $(srctree)/spl/Makefile all
708 731  
709   -$(obj)tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend
710   - $(MAKE) -C spl all CONFIG_TPL_BUILD=y
  732 +tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend
  733 + $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
711 734  
712 735 # Explicitly make _depend in subdirs containing multiple targets to prevent
713 736 # parallel sub-makes creating .depend files simultaneously.
714 737 depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
715   - $(obj)include/spl-autoconf.mk \
716   - $(obj)include/tpl-autoconf.mk \
717   - $(obj)include/autoconf.mk \
718   - $(obj)include/generated/generic-asm-offsets.h \
719   - $(obj)include/generated/asm-offsets.h
  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
720 743  
721 744 TAG_SUBDIRS = $(SUBDIRS)
722   -TAG_SUBDIRS += $(dir $(__LIBS))
  745 +TAG_SUBDIRS += $(dir $(LIBS))
723 746 TAG_SUBDIRS += include
724 747  
725 748 FIND := find
726 749 FINDFLAGS := -L
727 750  
728 751 checkstack:
729   - $(CROSS_COMPILE)objdump -d $(obj)u-boot \
730   - `$(FIND) $(obj) -name u-boot-spl -print` | \
731   - perl $(src)scripts/checkstack.pl $(ARCH)
  752 + $(CROSS_COMPILE)objdump -d u-boot \
  753 + `$(FIND) . -name u-boot-spl -print` | \
  754 + perl $(src)/scripts/checkstack.pl $(ARCH)
732 755  
733 756 tags ctags:
734   - ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
  757 + ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
735 758 -name '*.[chS]' -print`
736 759  
737 760 etags:
... ... @@ -746,7 +769,7 @@
746 769 $(NM) $1 | \
747 770 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
748 771 LC_ALL=C sort
749   -$(obj)System.map: $(obj)u-boot
  772 +System.map: u-boot
750 773 @$(call SYSTEM_MAP,$<) > $@
751 774  
752 775 checkthumb:
753 776  
754 777  
755 778  
756 779  
757 780  
758 781  
759 782  
760 783  
761 784  
762 785  
763 786  
764 787  
765 788  
766 789  
767 790  
768 791  
769 792  
770 793  
771 794  
... ... @@ -778,76 +801,76 @@
778 801 # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
779 802 # the dep file is only include in this top level makefile to determine when
780 803 # to regenerate the autoconf.mk file.
781   -$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
  804 +include/autoconf.mk.dep: include/config.h include/common.h
782 805 @$(XECHO) Generating $@ ; \
783 806 : Generate the dependancies ; \
784 807 $(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
785   - -MQ $(obj)include/autoconf.mk include/common.h > $@ || \
  808 + -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || \
786 809 rm $@
787 810  
788   -$(obj)include/autoconf.mk: $(obj)include/config.h
  811 +include/autoconf.mk: include/config.h
789 812 @$(XECHO) Generating $@ ; \
790 813 : Extract the config macros ; \
791   - $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
792   - sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  814 + $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
  815 + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
793 816 rm $@.tmp
794 817  
795 818 # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
796   -$(obj)include/tpl-autoconf.mk: $(obj)include/config.h
  819 +include/tpl-autoconf.mk: include/config.h
797 820 @$(XECHO) Generating $@ ; \
798 821 : Extract the config macros ; \
799 822 $(CPP) $(CFLAGS) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\
800   - -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
801   - sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  823 + -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
  824 + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
802 825 rm $@.tmp
803 826  
804   -$(obj)include/spl-autoconf.mk: $(obj)include/config.h
  827 +include/spl-autoconf.mk: include/config.h
805 828 @$(XECHO) Generating $@ ; \
806 829 : Extract the config macros ; \
807   - $(CPP) $(CFLAGS) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM include/common.h > $@.tmp && \
808   - sed -n -f tools/scripts/define2mk.sed $@.tmp > $@; \
  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 > $@; \
809 832 rm $@.tmp
810 833  
811   -$(obj)include/generated/generic-asm-offsets.h: $(obj)lib/asm-offsets.s
  834 +include/generated/generic-asm-offsets.h: lib/asm-offsets.s
812 835 @$(XECHO) Generating $@
813   - tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
  836 + $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@
814 837  
815   -$(obj)lib/asm-offsets.s: $(obj)include/config.h $(src)lib/asm-offsets.c
816   - @mkdir -p $(obj)lib
  838 +lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c
  839 + @mkdir -p lib
817 840 $(CC) -DDO_DEPS_ONLY \
818 841 $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
819   - -o $@ $(src)lib/asm-offsets.c -c -S
  842 + -o $@ $(srctree)/lib/asm-offsets.c -c -S
820 843  
821   -$(obj)include/generated/asm-offsets.h: $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
  844 +include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s
822 845 @$(XECHO) Generating $@
823   - tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
  846 + $(srctree)/tools/scripts/make-asm-offsets $(CPUDIR)/$(SOC)/asm-offsets.s $@
824 847  
825   -$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/config.h
826   - @mkdir -p $(obj)$(CPUDIR)/$(SOC)
827   - if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
  848 +$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h
  849 + @mkdir -p $(CPUDIR)/$(SOC)
  850 + if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
828 851 $(CC) -DDO_DEPS_ONLY \
829 852 $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
830   - -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
  853 + -o $@ $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
831 854 else \
832 855 touch $@; \
833 856 fi
834 857  
835 858 #########################################################################
836 859 else # !config.mk
837   -all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
838   -$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
  860 +all u-boot.hex u-boot.srec u-boot.bin \
  861 +u-boot.img u-boot.dis u-boot \
839 862 $(filter-out tools,$(SUBDIRS)) \
840   -depend dep tags ctags etags cscope $(obj)System.map:
  863 +depend dep tags ctags etags cscope System.map:
841 864 @echo "System not configured - see README" >&2
842 865 @ exit 1
843 866  
844 867 tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
845   - $(MAKE) $(build) $@ all
  868 + $(MAKE) $(build)=$@ all
846 869 endif # config.mk
847 870  
848 871 # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
849 872 # R_AARCH64_RELATIVE (64-bit).
850   -checkarmreloc: $(obj)u-boot
  873 +checkarmreloc: u-boot
851 874 @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \
852 875 grep R_A | sort -u`"; \
853 876 if test "$$RELOC" != "R_ARM_RELATIVE" -a \
854 877  
855 878  
... ... @@ -877,15 +900,15 @@
877 900 @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
878 901  
879 902 easylogo env gdb:
880   - $(MAKE) $(build) tools/$@ MTD_VERSION=${MTD_VERSION}
  903 + $(MAKE) $(build)=tools/$@ MTD_VERSION=${MTD_VERSION}
881 904  
882 905 gdbtools: gdb
883 906  
884 907 xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
885   - $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
  908 + $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) $(build)=doc/DocBook $@
886 909  
887 910 tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
888   - $(MAKE) $(build) tools HOST_TOOLS_ALL=y
  911 + $(MAKE) $(build)=tools HOST_TOOLS_ALL=y
889 912  
890 913 .PHONY : CHANGELOG
891 914 CHANGELOG:
892 915  
893 916  
894 917  
895 918  
... ... @@ -897,57 +920,52 @@
897 920 #########################################################################
898 921  
899 922 unconfig:
900   - @rm -f $(obj)include/config.h $(obj)include/config.mk \
901   - $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
902   - $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep \
903   - $(obj)include/spl-autoconf.mk \
904   - $(obj)include/tpl-autoconf.mk
  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
905 928  
906 929 %_config:: unconfig
907 930 @$(MKCONFIG) -A $(@:_config=)
908 931  
909   -sinclude $(obj).boards.depend
910   -$(obj).boards.depend: boards.cfg
911   - @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@
912   -
913 932 #########################################################################
914   -#########################################################################
915 933  
916 934 clean:
917   - @rm -f $(obj)examples/standalone/atmel_df_pow2 \
918   - $(obj)examples/standalone/hello_world \
919   - $(obj)examples/standalone/interrupt \
920   - $(obj)examples/standalone/mem_to_mem_idma2intr \
921   - $(obj)examples/standalone/sched \
922   - $(addprefix $(obj)examples/standalone/, smc91111_eeprom smc911x_eeprom) \
923   - $(obj)examples/standalone/test_burst \
924   - $(obj)examples/standalone/timer
925   - @rm -f $(addprefix $(obj)examples/api/, demo demo.bin)
926   - @rm -f $(obj)tools/bmp_logo $(obj)tools/easylogo/easylogo \
927   - $(obj)tools/env/fw_printenv \
928   - $(obj)tools/envcrc \
929   - $(addprefix $(obj)tools/gdb/, gdbcont gdbsend) \
930   - $(obj)tools/gen_eth_addr $(obj)tools/img2srec \
931   - $(obj)tools/dumpimage \
932   - $(addprefix $(obj)tools/, mkenvimage mkimage) \
933   - $(obj)tools/mpc86x_clk \
934   - $(addprefix $(obj)tools/, mk$(BOARD)spl mkexynosspl) \
935   - $(obj)tools/mxsboot \
936   - $(obj)tools/ncb $(obj)tools/ubsha1 \
937   - $(obj)tools/kernel-doc/docproc \
938   - $(obj)tools/proftool
939   - @rm -f $(addprefix $(obj)board/cray/L1/, bootscript.c bootscript.image) \
940   - $(obj)board/matrix_vision/*/bootscript.img \
941   - $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl \
942   - $(obj)u-boot.lds \
943   - $(addprefix $(obj)arch/blackfin/cpu/, init.lds init.elf)
944   - @rm -f $(obj)include/bmp_logo.h
945   - @rm -f $(obj)include/bmp_logo_data.h
946   - @rm -f $(obj)lib/asm-offsets.s
947   - @rm -f $(obj)include/generated/asm-offsets.h
948   - @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
  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
949 967 @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
950   - @$(MAKE) -s -C doc/DocBook/ cleandocs
  968 + @$(MAKE) -f $(srctree)/doc/DocBook/Makefile cleandocs
951 969 @find $(OBJTREE) -type f \
952 970 \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
953 971 -o -name '*.o' -o -name '*.a' -o -name '*.exe' \
954 972  
... ... @@ -962,38 +980,38 @@
962 980 @find $(OBJTREE) -type f \( -name '*.srec' \
963 981 -o -name '*.bin' -o -name u-boot.img \) \
964 982 -print0 | xargs -0 rm -f
965   - @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
966   - $(obj)cscope.* $(obj)*.*~
967   - @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
968   - @rm -f $(obj)u-boot.kwb
969   - @rm -f $(obj)u-boot.pbl
970   - @rm -f $(obj)u-boot.imx
971   - @rm -f $(obj)u-boot-with-spl.imx
972   - @rm -f $(obj)u-boot-with-nand-spl.imx
973   - @rm -f $(obj)u-boot.ubl
974   - @rm -f $(obj)u-boot.ais
975   - @rm -f $(obj)u-boot.dtb
976   - @rm -f $(obj)u-boot.sb
977   - @rm -f $(obj)u-boot.spr
978   - @rm -f $(addprefix $(obj)nand_spl/, u-boot.lds u-boot.lst System.map)
979   - @rm -f $(addprefix $(obj)nand_spl/, u-boot-nand_spl.lds u-boot-spl u-boot-spl.map)
980   - @rm -f $(addprefix $(obj)spl/, u-boot-spl u-boot-spl.bin u-boot-spl.map)
981   - @rm -f $(obj)spl/u-boot-spl.lds
982   - @rm -f $(addprefix $(obj)tpl/, u-boot-tpl u-boot-tpl.bin u-boot-tpl.map)
983   - @rm -f $(obj)tpl/u-boot-spl.lds
984   - @rm -f $(obj)MLO MLO.byteswap
985   - @rm -f $(obj)SPL
986   - @rm -f $(obj)tools/xway-swap-bytes
987   - @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
988   - @rm -fr $(obj)include/generated
989   - @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
990   - @rm -f $(obj)dts/*.tmp
991   - @rm -f $(addprefix $(obj)spl/, u-boot-spl.ais, u-boot-spl-pad.ais)
  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)
992 1010  
993 1011 mrproper \
994 1012 distclean: clobber unconfig
995 1013 ifneq ($(OBJTREE),$(SRCTREE))
996   - rm -rf $(obj)*
  1014 + rm -rf *
997 1015 endif
998 1016  
999 1017 backup:
... ... @@ -1001,4 +1019,13 @@
1001 1019 gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
1002 1020  
1003 1021 #########################################################################
  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)
arch/arm/cpu/arm1136/config.mk
... ... @@ -14,7 +14,7 @@
14 14 ALL-y += $(OBJTREE)/SPL
15 15 endif
16 16 else
17   -ALL-y += $(obj)u-boot.imx
  17 +ALL-y += u-boot.imx
18 18 endif
19 19 endif
arch/arm/cpu/arm926ejs/config.mk
... ... @@ -13,7 +13,7 @@
13 13 ALL-y += $(OBJTREE)/SPL
14 14 endif
15 15 else
16   -ALL-y += $(obj)u-boot.imx
  16 +ALL-y += u-boot.imx
17 17 endif
18 18 endif
arch/arm/cpu/arm926ejs/davinci/config.mk
... ... @@ -4,6 +4,6 @@
4 4 # SPDX-License-Identifier: GPL-2.0+
5 5 #
6 6 ifndef CONFIG_SPL_BUILD
7   -ALL-$(CONFIG_SPL_FRAMEWORK) += $(obj)u-boot.ais
  7 +ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.ais
8 8 endif
arch/arm/cpu/armv7/am33xx/config.mk
... ... @@ -7,6 +7,6 @@
7 7 ALL-y += $(OBJTREE)/MLO
8 8 ALL-$(CONFIG_SPL_SPI_SUPPORT) += $(OBJTREE)/MLO.byteswap
9 9 else
10   -ALL-y += $(obj)u-boot.img
  10 +ALL-y += u-boot.img
11 11 endif
arch/arm/cpu/armv7/config.mk
... ... @@ -20,7 +20,7 @@
20 20 ALL-y += $(OBJTREE)/SPL
21 21 endif
22 22 else
23   -ALL-y += $(obj)u-boot.imx
  23 +ALL-y += u-boot.imx
24 24 endif
25 25 endif
arch/arm/cpu/armv7/omap3/config.mk
... ... @@ -11,6 +11,6 @@
11 11 ifdef CONFIG_SPL_BUILD
12 12 ALL-y += $(OBJTREE)/MLO
13 13 else
14   -ALL-y += $(obj)u-boot.img
  14 +ALL-y += u-boot.img
15 15 endif
arch/arm/cpu/armv7/omap4/config.mk
... ... @@ -11,6 +11,6 @@
11 11 ifdef CONFIG_SPL_BUILD
12 12 ALL-y += $(OBJTREE)/MLO
13 13 else
14   -ALL-y += $(obj)u-boot.img
  14 +ALL-y += u-boot.img
15 15 endif
arch/arm/cpu/armv7/omap5/config.mk
... ... @@ -9,6 +9,6 @@
9 9 ifdef CONFIG_SPL_BUILD
10 10 ALL-y += $(OBJTREE)/MLO
11 11 else
12   -ALL-y += $(obj)u-boot.img
  12 +ALL-y += u-boot.img
13 13 endif
arch/arm/cpu/armv7/socfpga/config.mk
... ... @@ -4,6 +4,6 @@
4 4 # SPDX-License-Identifier: GPL-2.0+
5 5 #
6 6 ifndef CONFIG_SPL_BUILD
7   -ALL-y += $(obj)u-boot.img
  7 +ALL-y += u-boot.img
8 8 endif
arch/blackfin/config.mk
... ... @@ -12,7 +12,7 @@
12 12 ifeq ($(CONFIG_BFIN_CPU),)
13 13 CONFIG_BFIN_CPU := \
14 14 $(shell awk '$$2 == "CONFIG_BFIN_CPU" { print $$3 }' \
15   - $(src)include/configs/$(BOARD).h)
  15 + $(srctree)/include/configs/$(BOARD).h)
16 16 else
17 17 CONFIG_BFIN_CPU := $(strip $(CONFIG_BFIN_CPU:"%"=%))
18 18 endif
19 19  
... ... @@ -28,10 +28,10 @@
28 28 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
29 29  
30 30 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
31   -ALL-y += $(obj)u-boot.ldr
  31 +ALL-y += u-boot.ldr
32 32 endif
33 33 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
34   -CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
  34 +CREATE_LDR_ENV = tools/envcrc --binary > env-ldr.o
35 35 HOSTCFLAGS_NOPED_ADSP := \
36 36 $(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) </dev/null \
37 37 | awk '$$2 ~ /ADSP/ { print "-D" $$2 }')
38 38  
... ... @@ -47,10 +47,10 @@
47 47  
48 48 LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
49 49 LDR_FLAGS += --use-vmas
50   -LDR_FLAGS += --initcode $(obj)$(CPUDIR)/initcode.o
  50 +LDR_FLAGS += --initcode $(CPUDIR)/initcode.o
51 51 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
52 52 LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
53   - --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
  53 + --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):env-ldr.o
54 54 endif
55 55 ifneq (,$(findstring s,$(MAKEFLAGS)))
56 56 LDR_FLAGS += --quiet
arch/blackfin/cpu/Makefile
... ... @@ -25,9 +25,9 @@
25 25  
26 26 # make sure our initcode (which goes into LDR) does not
27 27 # have relocs or external references
28   -$(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
  28 +$(obj)/initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
29 29 READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
30   -$(obj)check_initcode: $(obj)initcode.o
  30 +$(obj)/check_initcode: $(obj)/initcode.o
31 31 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
32 32 @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \
33 33 echo "$< contains external references!" 1>&2 ; \
34 34  
... ... @@ -35,8 +35,8 @@
35 35 fi
36 36 endif
37 37  
38   -$(obj)init.lds: init.lds.S
  38 +$(obj)/init.lds: $(src)/init.lds.S
39 39 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P $^ -o $@
40   -$(obj)init.elf: $(obj)init.lds $(obj)init.o $(obj)initcode.o
  40 +$(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o
41 41 $(LD) $(LDFLAGS) -T $^ -o $@
arch/mips/cpu/mips32/config.mk
... ... @@ -21,5 +21,5 @@
21 21 PLATFORM_LDFLAGS += -m elf32ltsmip
22 22 endif
23 23  
24   -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
  24 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T $(srctree)/$(src)/mips.lds
arch/mips/cpu/mips64/config.mk
... ... @@ -21,5 +21,5 @@
21 21 PLATFORM_LDFLAGS += -m elf64ltsmip
22 22 endif
23 23  
24   -CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 -T mips64.lds
  24 +CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 -T $(srctree)/$(src)/mips64.lds
arch/mips/cpu/xburst/config.mk
... ... @@ -12,5 +12,5 @@
12 12 PLATFORM_LDFLAGS += -m elf32ltsmip
13 13 endif
14 14  
15   -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
  15 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T $(srctree)/$(src)/mips.lds
arch/nds32/config.mk
... ... @@ -10,7 +10,7 @@
10 10  
11 11 CROSS_COMPILE ?= nds32le-linux-
12 12  
13   -CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T nds32.lds
  13 +CONFIG_STANDALONE_LOAD_ADDR = 0x300000 -T $(srctree)/$(src)/nds32.lds
14 14  
15 15 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -mrelax
16 16 PLATFORM_RELFLAGS += -gdwarf-2
arch/powerpc/lib/Makefile
... ... @@ -54,11 +54,11 @@
54 54 # Workaround for local bus unaligned access problems
55 55 # on MPC512x and MPC5200
56 56 ifdef CONFIG_MPC512X
57   -$(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
  57 +$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
58 58 obj-y += memcpy_mpc5200.o
59 59 endif
60 60 ifdef CONFIG_MPC5200
61   -$(obj)ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
  61 +$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
62 62 obj-y += memcpy_mpc5200.o
63 63 endif
64 64 endif
arch/sandbox/cpu/Makefile
... ... @@ -10,8 +10,8 @@
10 10 obj-y := cpu.o os.o start.o state.o
11 11  
12 12 # os.c is build in the system environment, so needs standard includes
13   -$(obj)os.o: CFLAGS := $(filter-out -nostdinc,\
  13 +$(obj)/os.o: CFLAGS := $(filter-out -nostdinc,\
14 14 $(patsubst -I%,-idirafter%,$(CFLAGS)))
15   -$(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,\
  15 +$(obj)/.depend.os: CPPFLAGS := $(filter-out -nostdinc,\
16 16 $(patsubst -I%,-idirafter%,$(CPPFLAGS)))
arch/sparc/config.mk
... ... @@ -7,7 +7,8 @@
7 7  
8 8 CROSS_COMPILE ?= sparc-elf-
9 9  
10   -CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) -T sparc.lds
  10 +CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000 -L $(gcclibdir) \
  11 + -T $(srctree)/$(src)/sparc.lds
11 12  
12 13 PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
arch/x86/lib/Makefile
... ... @@ -23,6 +23,6 @@
23 23 LIBGCC := $(notdir $(NORMAL_LIBGCC))
24 24 extra-y := $(LIBGCC)
25 25  
26   -$(obj)$(LIBGCC): $(NORMAL_LIBGCC)
  26 +$(obj)/$(LIBGCC): $(NORMAL_LIBGCC)
27 27 $(OBJCOPY) $< $@ --prefix-symbols=__normal_
board/ait/cam_enc_4xx/config.mk
... ... @@ -9,7 +9,7 @@
9 9  
10 10 UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
11 11 ifndef CONFIG_SPL_BUILD
12   -ALL-y += $(obj)u-boot.ubl
  12 +ALL-y += u-boot.ubl
13 13 else
14 14 # as SPL_TEXT_BASE is not page-aligned, we need for some
15 15 # linkers the -n flag (Do not page align data), to prevent
board/avionic-design/medcom-wide/Makefile
... ... @@ -9,5 +9,5 @@
9 9  
10 10 obj-y := ../common/tamonten.o
11 11  
12   -include ../../nvidia/common/common.mk
  12 +include $(srctree)/board/nvidia/common/common.mk
board/avionic-design/plutux/Makefile
... ... @@ -9,5 +9,5 @@
9 9  
10 10 obj-y := ../common/tamonten.o
11 11  
12   -include ../../nvidia/common/common.mk
  12 +include $(srctree)/board/nvidia/common/common.mk
board/avionic-design/tec-ng/Makefile
... ... @@ -7,5 +7,5 @@
7 7  
8 8 obj-y := ../common/tamonten-ng.o
9 9  
10   -include ../../nvidia/common/common.mk
  10 +include $(srctree)/board/nvidia/common/common.mk
board/avionic-design/tec/Makefile
... ... @@ -9,5 +9,5 @@
9 9  
10 10 obj-y := ../common/tamonten.o
11 11  
12   -include ../../nvidia/common/common.mk
  12 +include $(srctree)/board/nvidia/common/common.mk
board/compal/paz00/Makefile
... ... @@ -16,5 +16,5 @@
16 16  
17 17 obj-y := paz00.o
18 18  
19   -include ../../nvidia/common/common.mk
  19 +include $(srctree)/board/nvidia/common/common.mk
board/compulab/trimslice/Makefile
... ... @@ -7,5 +7,5 @@
7 7  
8 8 obj-y := trimslice.o
9 9  
10   -include ../../nvidia/common/common.mk
  10 +include $(srctree)/board/nvidia/common/common.mk
board/cray/L1/Makefile
... ... @@ -9,9 +9,9 @@
9 9 obj-y += init.o
10 10 obj-y += bootscript.o
11 11  
12   -$(obj)bootscript.c: $(obj)bootscript.image
13   - od -t x1 -v -A x $^ | awk -f x2c.awk > $@
  12 +$(obj)/bootscript.c: $(obj)/bootscript.image
  13 + od -t x1 -v -A x $^ | awk -f $(srctree)/$(src)/x2c.awk > $@
14 14  
15   -$(obj)bootscript.image: $(src)bootscript.hush $(src)Makefile
16   - -$(OBJTREE)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d $(src)bootscript.hush $@
  15 +$(obj)/bootscript.image: $(src)/bootscript.hush
  16 + -$(OBJTREE)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d $< $@
board/h2200/Makefile
... ... @@ -10,6 +10,6 @@
10 10  
11 11 extra-y := h2200-header.bin
12 12  
13   -$(obj)h2200-header.bin: $(obj)h2200-header.o
  13 +$(obj)/h2200-header.bin: $(obj)/h2200-header.o
14 14 $(OBJCOPY) -O binary $< $@
board/matrix_vision/mvblm7/Makefile
... ... @@ -8,6 +8,6 @@
8 8  
9 9 extra-y := bootscript.img
10 10  
11   -$(obj)bootscript.img:
12   - @mkimage -T script -C none -n M7_script -d bootscript $@
  11 +$(obj)/bootscript.img: $(src)/bootscript
  12 + @mkimage -T script -C none -n M7_script -d $< $@
board/matrix_vision/mvsmr/Makefile
... ... @@ -12,6 +12,6 @@
12 12  
13 13 extra-y := bootscript.img
14 14  
15   -$(obj)bootscript.img: bootscript
  15 +$(obj)/bootscript.img: $(src)/bootscript
16 16 @mkimage -T script -C none -n mvSMR_Script -d $< $@
board/nvidia/common/Makefile
1 1 # Copyright (c) 2011 The Chromium OS Authors.
2 2 # SPDX-License-Identifier: GPL-2.0+
3 3  
4   -include common.mk
  4 +include $(src)/common.mk
board/pcs440ep/config.mk
... ... @@ -10,7 +10,7 @@
10 10 #
11 11  
12 12 # Check the U-Boot Image with a SHA1 checksum
13   -ALL-y += $(obj)u-boot.sha1
  13 +ALL-y += u-boot.sha1
14 14  
15 15 PLATFORM_CPPFLAGS += -DCONFIG_440=1
16 16  
board/samsung/origen/Makefile
... ... @@ -13,7 +13,7 @@
13 13 #
14 14 # TODO:
15 15 # Fix the root cause in tools/mkorigenspl.c and delete the following work-around
16   -$(obj)tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
  16 +$(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
17 17 else
18 18 obj-y += origen.o
19 19 endif
... ... @@ -238,12 +238,11 @@
238 238 obj-y += memsize.o
239 239 obj-y += stdio.o
240 240  
241   -$(obj)env_embedded.o: $(src)env_embedded.c
  241 +$(obj)/env_embedded.o: $(src)/env_embedded.c
242 242 $(CC) $(AFLAGS) -Wa,--no-warn \
243   - -DENV_CRC=$(shell $(obj)../tools/envcrc) \
244   - -c -o $@ $(src)env_embedded.c
  243 + -DENV_CRC=$(shell tools/envcrc) -c -o $@ $<
245 244  
246 245 # SEE README.arm-unaligned-accesses
247   -$(obj)hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
248   -$(obj)fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
  246 +$(obj)/hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
  247 +$(obj)/fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
... ... @@ -6,42 +6,6 @@
6 6 #
7 7 #########################################################################
8 8  
9   -ifeq ($(CURDIR),$(SRCTREE))
10   -dir :=
11   -else
12   -dir := $(subst $(SRCTREE)/,,$(CURDIR))
13   -endif
14   -
15   -ifneq ($(OBJTREE),$(SRCTREE))
16   -# Create object files for SPL in a separate directory
17   -ifeq ($(CONFIG_SPL_BUILD),y)
18   -ifeq ($(CONFIG_TPL_BUILD),y)
19   -obj := $(if $(dir),$(TPLTREE)/$(dir)/,$(TPLTREE)/)
20   -else
21   -obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
22   -endif
23   -else
24   -obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
25   -endif
26   -src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)
27   -
28   -$(shell mkdir -p $(obj))
29   -else
30   -# Create object files for SPL in a separate directory
31   -ifeq ($(CONFIG_SPL_BUILD),y)
32   -ifeq ($(CONFIG_TPL_BUILD),y)
33   -obj := $(if $(dir),$(TPLTREE)/$(dir)/,$(TPLTREE)/)
34   -else
35   -obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
36   -
37   -endif
38   -$(shell mkdir -p $(obj))
39   -else
40   -obj :=
41   -endif
42   -src :=
43   -endif
44   -
45 9 # clean the slate ...
46 10 PLATFORM_RELFLAGS =
47 11 PLATFORM_CPPFLAGS =
48 12  
49 13  
... ... @@ -52,14 +16,14 @@
52 16 # Load generated board configuration
53 17 ifeq ($(CONFIG_TPL_BUILD),y)
54 18 # Include TPL autoconf
55   -sinclude $(OBJTREE)/include/tpl-autoconf.mk
  19 +sinclude include/tpl-autoconf.mk
56 20 else
57 21 ifeq ($(CONFIG_SPL_BUILD),y)
58 22 # Include SPL autoconf
59   -sinclude $(OBJTREE)/include/spl-autoconf.mk
  23 +sinclude include/spl-autoconf.mk
60 24 else
61 25 # Include normal autoconf
62   -sinclude $(OBJTREE)/include/autoconf.mk
  26 +sinclude include/autoconf.mk
63 27 endif
64 28 endif
65 29 sinclude $(OBJTREE)/include/config.mk
doc/DocBook/Makefile
... ... @@ -6,8 +6,6 @@
6 6 # To add a new book the only step required is to add the book to the
7 7 # list of DOCBOOKS.
8 8  
9   -include $(TOPDIR)/config.mk
10   -
11 9 DOCBOOKS := fs.xml linker_lists.xml stdio.xml
12 10  
13 11 ###
... ... @@ -122,7 +120,7 @@
122 120  
123 121  
124 122 index = index.html
125   -main_idx = $(index)
  123 +main_idx = doc/DocBook/$(index)
126 124 build_main_index = rm -rf $(main_idx); \
127 125 echo '<h1>U-Boot Bootloader HTML Documentation</h1>' >> $(main_idx) && \
128 126 echo '<h2>U-Boot Version: $(U_BOOT_VERSION)</h2>' >> $(main_idx) && \
... ... @@ -151,7 +149,7 @@
151 149 @(which xmlto > /dev/null 2>&1) || \
152 150 (echo "*** You need to install xmlto ***"; \
153 151 exit 1)
154   - $(Q)mkdir -p $(obj)man
  152 + $(Q)mkdir -p $(obj)/man
155 153 $(call cmd_db2man)
156 154 @touch $@
157 155  
drivers/bios_emulator/Makefile
... ... @@ -8,7 +8,7 @@
8 8 $(X86DIR)/sys.o \
9 9 $(X86DIR)/debug.o
10 10  
11   -EXTRA_CFLAGS += -I. -I./include \
  11 +EXTRA_CFLAGS += -I$(srctree)/$(src) -I$(srctree)/$(src)/include \
12 12 -D__PPC__ -D__BIG_ENDIAN__
13 13  
14 14 CFLAGS += $(EXTRA_CFLAGS)
... ... @@ -26,7 +26,7 @@
26 26 # Use a constant name for this so we can access it from C code.
27 27 # objcopy doesn't seem to allow us to set the symbol name independently of
28 28 # the filename.
29   -DT_BIN := $(obj)dt.dtb
  29 +DT_BIN := $(obj)/dt.dtb
30 30  
31 31 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
32 32 $(CPP) $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
... ... @@ -38,7 +38,7 @@
38 38 # Run the compiler and get the link script from the linker
39 39 GET_LDS = $(CC) $(CFLAGS) $(LDFLAGS) -Wl,--verbose 2>&1
40 40  
41   -$(obj)dt.o: $(DT_BIN)
  41 +$(obj)/dt.o: $(DT_BIN)
42 42 # We want the output format and arch.
43 43 # We also hope to win a prize for ugliest Makefile / shell interaction
44 44 # We look in the LDSCRIPT first.
... ... @@ -62,7 +62,7 @@
62 62 \
63 63 cd $(dir ${DT_BIN}) && \
64 64 $(OBJCOPY) -I binary -O $${oformat} -B $${oarch} \
65   - $(notdir ${DT_BIN}) $@
  65 + $(notdir ${DT_BIN}) $(notdir $@)
66 66 rm $(DT_BIN)
67 67  
68 68 obj-$(CONFIG_OF_EMBED) := dt.o
examples/api/Makefile
... ... @@ -40,24 +40,24 @@
40 40 SRCS += $(addprefix $(SRCTREE)/examples/api/,$(SOBJ_FILES-y:.o=.S))
41 41  
42 42 # Create a list of object files to be compiled
43   -OBJS += $(addprefix $(obj),$(SOBJ_FILES-y))
44   -OBJS += $(addprefix $(obj),$(COBJ_FILES-y))
45   -OBJS += $(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y)))
46   -OBJS += $(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y)))
  43 +OBJS += $(addprefix $(obj)/,$(SOBJ_FILES-y))
  44 +OBJS += $(addprefix $(obj)/,$(COBJ_FILES-y))
  45 +OBJS += $(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y)))
  46 +OBJS += $(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y)))
47 47  
48 48 #########################################################################
49 49  
50   -$(obj)demo: $(OBJS)
  50 +$(obj)/demo: $(OBJS)
51 51 $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
52 52  
53   -$(obj)demo.bin: $(obj)demo
  53 +$(obj)/demo.bin: $(obj)/demo
54 54 $(OBJCOPY) -O binary $< $@ 2>/dev/null
55 55  
56 56 # Rule to build generic library C files
57   -$(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y))): $(obj)%.o: $(SRCTREE)/lib/%.c
  57 +$(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))): $(obj)/%.o: $(SRCTREE)/lib/%.c
58 58 $(CC) -g $(CFLAGS) -c -o $@ $<
59 59  
60 60 # Rule to build architecture-specific library assembly files
61   -$(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y))): $(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
  61 +$(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y))): $(obj)/%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
62 62 $(CC) -g $(CFLAGS) -c -o $@ $<
examples/standalone/Makefile
... ... @@ -31,7 +31,7 @@
31 31  
32 32 COBJS := $(ELF:=.o)
33 33  
34   -LIB = $(obj)libstubs.o
  34 +LIB = $(obj)/libstubs.o
35 35  
36 36 LIBAOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o
37 37 LIBAOBJS-$(CONFIG_8xx) += test_burst_lib.o
38 38  
... ... @@ -39,11 +39,11 @@
39 39  
40 40 LIBCOBJS = stubs.o
41 41  
42   -LIBOBJS = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
  42 +LIBOBJS = $(addprefix $(obj)/,$(LIBAOBJS) $(LIBCOBJS))
43 43  
44 44 SRCS := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
45   -OBJS := $(addprefix $(obj),$(COBJS))
46   -ELF := $(addprefix $(obj),$(ELF))
  45 +OBJS := $(addprefix $(obj)/,$(COBJS))
  46 +ELF := $(addprefix $(obj)/,$(ELF))
47 47  
48 48 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
49 49  
50 50  
51 51  
... ... @@ -67,14 +67,14 @@
67 67 $(call cmd_link_o_target, $(LIBOBJS))
68 68  
69 69 $(ELF):
70   -$(obj)%: $(obj)%.o $(LIB)
  70 +$(obj)/%: $(obj)/%.o $(LIB)
71 71 $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
72 72 -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
73 73 -L$(gcclibdir) -lgcc
74 74  
75   -$(obj)%.srec: $(obj)%
  75 +$(obj)/%.srec: $(obj)/%
76 76 $(OBJCOPY) -O srec $< $@ 2>/dev/null
77 77  
78   -$(obj)%.bin: $(obj)%
  78 +$(obj)/%.bin: $(obj)/%
79 79 $(OBJCOPY) -O binary $< $@ 2>/dev/null
... ... @@ -15,5 +15,5 @@
15 15 obj-y += log.o orphan.o recovery.o replay.o
16 16  
17 17 # SEE README.arm-unaligned-accesses
18   -$(obj)super.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
  18 +$(obj)/super.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
... ... @@ -67,5 +67,5 @@
67 67 obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
68 68  
69 69 # SEE README.arm-unaligned-accesses
70   -$(obj)bzlib.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
  70 +$(obj)/bzlib.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
... ... @@ -23,7 +23,7 @@
23 23  
24 24 if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then
25 25 # Automatic mode
26   - line=`awk '($0 !~ /^#/ && $7 ~ /^'"$2"'$/) { print $1, $2, $3, $4, $5, $6, $7, $8 }' boards.cfg`
  26 + line=`awk '($0 !~ /^#/ && $7 ~ /^'"$2"'$/) { print $1, $2, $3, $4, $5, $6, $7, $8 }' $srctree/boards.cfg`
27 27 if [ -z "$line" ] ; then
28 28 echo "make: *** No rule to make target \`$2_config'. Stop." >&2
29 29 exit 1
nand_spl/board/amcc/acadia/Makefile
... ... @@ -18,8 +18,8 @@
18 18 SOBJS = start.o resetvec.o cache.o
19 19 COBJS = gpio.o nand_boot.o nand_ecc.o memory.o ndfc.o pll.o
20 20  
21   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
22   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  21 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  22 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 23 __OBJS := $(SOBJS) $(COBJS)
24 24 LNDIR := $(nandobj)board/$(BOARDDIR)
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
... ... @@ -47,50 +47,42 @@
47 47 # create symbolic links for common files
48 48  
49 49 # from cpu directory
50   -$(obj)cache.S:
  50 +$(obj)/cache.S:
51 51 @rm -f $@
52 52 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
53 53  
54   -$(obj)gpio.c:
  54 +$(obj)/gpio.c:
55 55 @rm -f $@
56 56 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/gpio.c $@
57 57  
58   -$(obj)ndfc.c:
  58 +$(obj)/ndfc.c:
59 59 @rm -f $@
60 60 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
61 61  
62   -$(obj)resetvec.S:
  62 +$(obj)/resetvec.S:
63 63 @rm -f $@
64 64 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
65 65  
66   -$(obj)start.S:
  66 +$(obj)/start.S:
67 67 @rm -f $@
68 68 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
69 69  
70 70 # from board directory
71   -$(obj)memory.c:
  71 +$(obj)/memory.c:
72 72 @rm -f $@
73 73 ln -s $(SRCTREE)/board/amcc/acadia/memory.c $@
74 74  
75   -$(obj)pll.c:
  75 +$(obj)/pll.c:
76 76 @rm -f $@
77 77 ln -s $(SRCTREE)/board/amcc/acadia/pll.c $@
78 78  
79 79 # from nand_spl directory
80   -$(obj)nand_boot.c:
  80 +$(obj)/nand_boot.c:
81 81 @rm -f $@
82 82 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
83 83  
84 84 # from drivers/mtd/nand directory
85   -$(obj)nand_ecc.c:
  85 +$(obj)/nand_ecc.c:
86 86 @rm -f $@
87 87 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
88   -
89   -#########################################################################
90   -
91   -$(obj)%.o: $(obj)%.S
92   - $(CC) $(AFLAGS) -c -o $@ $<
93   -
94   -$(obj)%.o: $(obj)%.c
95   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/amcc/bamboo/Makefile
... ... @@ -18,8 +18,8 @@
18 18 SOBJS = start.o init.o resetvec.o
19 19 COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o
20 20  
21   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
22   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  21 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  22 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 23 __OBJS := $(SOBJS) $(COBJS)
24 24 LNDIR := $(nandobj)board/$(BOARDDIR)
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
... ... @@ -41,44 +41,30 @@
41 41 # create symbolic links for common files
42 42  
43 43 # from cpu directory
44   -$(obj)ndfc.c:
  44 +$(obj)/ndfc.c:
45 45 @rm -f $@
46 46 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
47 47  
48   -$(obj)resetvec.S:
  48 +$(obj)/resetvec.S:
49 49 @rm -f $@
50 50 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
51 51  
52   -$(obj)start.S:
  52 +$(obj)/start.S:
53 53 @rm -f $@
54 54 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
55 55  
56 56 # from board directory
57   -$(obj)init.S:
  57 +$(obj)/init.S:
58 58 @rm -f $@
59 59 ln -s $(SRCTREE)/board/amcc/bamboo/init.S $@
60 60  
61 61 # from nand_spl directory
62   -$(obj)nand_boot.c:
  62 +$(obj)/nand_boot.c:
63 63 @rm -f $@
64 64 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
65 65  
66 66 # from drivers/mtd/nand directory
67   -$(obj)nand_ecc.c:
  67 +$(obj)/nand_ecc.c:
68 68 @rm -f $@
69 69 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
70   -
71   -ifneq ($(OBJTREE), $(SRCTREE))
72   -$(obj)sdram.c:
73   - @rm -f $@
74   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/sdram.c $@
75   -endif
76   -
77   -#########################################################################
78   -
79   -$(obj)%.o: $(obj)%.S
80   - $(CC) $(AFLAGS) -c -o $@ $<
81   -
82   -$(obj)%.o: $(obj)%.c
83   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/amcc/canyonlands/Makefile
... ... @@ -23,8 +23,8 @@
23 23 COBJS += nand_ecc.o
24 24 COBJS += ndfc.o
25 25  
26   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
27   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  26 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  27 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
28 28 __OBJS := $(SOBJS) $(COBJS)
29 29 LNDIR := $(nandobj)board/$(BOARDDIR)
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
... ... @@ -46,44 +46,30 @@
46 46 # create symbolic links for common files
47 47  
48 48 # from cpu directory
49   -$(obj)ndfc.c:
  49 +$(obj)/ndfc.c:
50 50 @rm -f $@
51 51 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
52 52  
53   -$(obj)resetvec.S:
  53 +$(obj)/resetvec.S:
54 54 @rm -f $@
55 55 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
56 56  
57   -$(obj)start.S:
  57 +$(obj)/start.S:
58 58 @rm -f $@
59 59 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
60 60  
61 61 # from board directory
62   -$(obj)init.S:
  62 +$(obj)/init.S:
63 63 @rm -f $@
64 64 ln -s $(SRCTREE)/board/amcc/canyonlands/init.S $@
65 65  
66 66 # from nand_spl directory
67   -$(obj)nand_boot.c:
  67 +$(obj)/nand_boot.c:
68 68 @rm -f $@
69 69 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
70 70  
71 71 # from drivers/mtd/nand directory
72   -$(obj)nand_ecc.c:
  72 +$(obj)/nand_ecc.c:
73 73 @rm -f $@
74 74 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
75   -
76   -ifneq ($(OBJTREE), $(SRCTREE))
77   -$(obj)ddr2_fixed.c:
78   - @rm -f $@
79   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/ddr2_fixed.c $@
80   -endif
81   -
82   -#########################################################################
83   -
84   -$(obj)%.o: $(obj)%.S
85   - $(CC) $(AFLAGS) -c -o $@ $<
86   -
87   -$(obj)%.o: $(obj)%.c
88   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/amcc/kilauea/Makefile
... ... @@ -18,8 +18,8 @@
18 18 SOBJS = start.o resetvec.o cache.o
19 19 COBJS = 44x_spd_ddr2.o nand_boot.o nand_ecc.o ndfc.o
20 20  
21   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
22   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  21 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  22 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 23 __OBJS := $(SOBJS) $(COBJS)
24 24 LNDIR := $(nandobj)board/$(BOARDDIR)
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
... ... @@ -41,45 +41,37 @@
41 41 # create symbolic links for common files
42 42  
43 43 # from cpu directory
44   -$(obj)44x_spd_ddr2.c: $(obj)ecc.h
  44 +$(obj)/44x_spd_ddr2.c: $(obj)/ecc.h
45 45 @rm -f $@
46 46 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c $@
47 47  
48   -$(obj)cache.S:
  48 +$(obj)/cache.S:
49 49 @rm -f $@
50 50 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
51 51  
52   -$(obj)ecc.h:
  52 +$(obj)/ecc.h:
53 53 @rm -f $@
54 54 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/ecc.h $@
55 55  
56   -$(obj)ndfc.c:
  56 +$(obj)/ndfc.c:
57 57 @rm -f $@
58 58 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
59 59  
60   -$(obj)resetvec.S:
  60 +$(obj)/resetvec.S:
61 61 @rm -f $@
62 62 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
63 63  
64   -$(obj)start.S:
  64 +$(obj)/start.S:
65 65 @rm -f $@
66 66 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
67 67  
68 68 # from nand_spl directory
69   -$(obj)nand_boot.c:
  69 +$(obj)/nand_boot.c:
70 70 @rm -f $@
71 71 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
72 72  
73 73 # from drivers/nand directory
74   -$(obj)nand_ecc.c:
  74 +$(obj)/nand_ecc.c:
75 75 @rm -f $@
76 76 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
77   -
78   -#########################################################################
79   -
80   -$(obj)%.o: $(obj)%.S
81   - $(CC) $(AFLAGS) -c -o $@ $<
82   -
83   -$(obj)%.o: $(obj)%.c
84   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/amcc/sequoia/Makefile
... ... @@ -18,8 +18,8 @@
18 18 SOBJS = start.o init.o resetvec.o
19 19 COBJS = denali_data_eye.o nand_boot.o nand_ecc.o ndfc.o sdram.o
20 20  
21   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
22   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  21 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  22 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 23 __OBJS := $(SOBJS) $(COBJS)
24 24 LNDIR := $(nandobj)board/$(BOARDDIR)
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
... ... @@ -41,48 +41,40 @@
41 41 # create symbolic links for common files
42 42  
43 43 # from cpu directory
44   -$(obj)denali_data_eye.c:
  44 +$(obj)/denali_data_eye.c:
45 45 @rm -f $@
46 46 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/denali_data_eye.c $@
47 47  
48   -$(obj)ndfc.c:
  48 +$(obj)/ndfc.c:
49 49 @rm -f $@
50 50 ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
51 51  
52   -$(obj)resetvec.S:
  52 +$(obj)/resetvec.S:
53 53 @rm -f $@
54 54 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
55 55  
56   -$(obj)start.S:
  56 +$(obj)/start.S:
57 57 @rm -f $@
58 58 ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
59 59  
60 60 # from board directory
61   -$(obj)init.S:
  61 +$(obj)/init.S:
62 62 @rm -f $@
63 63 ln -s $(SRCTREE)/board/amcc/sequoia/init.S $@
64 64  
65   -$(obj)sdram.c:
  65 +$(obj)/sdram.c:
66 66 @rm -f $@
67   - @rm -f $(obj)sdram.h
  67 + @rm -f $(obj)/sdram.h
68 68 ln -s $(SRCTREE)/board/amcc/sequoia/sdram.c $@
69   - ln -s $(SRCTREE)/board/amcc/sequoia/sdram.h $(obj)sdram.h
  69 + ln -s $(SRCTREE)/board/amcc/sequoia/sdram.h $(obj)/sdram.h
70 70  
71 71 # from nand_spl directory
72   -$(obj)nand_boot.c:
  72 +$(obj)/nand_boot.c:
73 73 @rm -f $@
74 74 ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
75 75  
76 76 # from drivers/mtd/nand directory
77   -$(obj)nand_ecc.c:
  77 +$(obj)/nand_ecc.c:
78 78 @rm -f $@
79 79 ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
80   -
81   -#########################################################################
82   -
83   -$(obj)%.o: $(obj)%.S
84   - $(CC) $(AFLAGS) -c -o $@ $<
85   -
86   -$(obj)%.o: $(obj)%.c
87   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/mpc8315erdb/Makefile
... ... @@ -20,8 +20,8 @@
20 20 COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
21 21 time.o cache.o
22 22  
23   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
24   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  23 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  24 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
25 25 __OBJS := $(SOBJS) $(COBJS)
26 26 LNDIR := $(nandobj)board/$(BOARDDIR)
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
... ... @@ -42,38 +42,30 @@
42 42  
43 43 # create symbolic links for common files
44 44  
45   -$(obj)start.S:
  45 +$(obj)/start.S:
46 46 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
47 47  
48   -$(obj)nand_boot_fsl_elbc.c:
  48 +$(obj)/nand_boot_fsl_elbc.c:
49 49 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
50 50  
51   -$(obj)sdram.c:
  51 +$(obj)/sdram.c:
52 52 ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
53 53  
54   -$(obj)$(BOARD).c:
  54 +$(obj)/$(BOARD).c:
55 55 ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
56 56  
57   -$(obj)ns16550.c:
  57 +$(obj)/ns16550.c:
58 58 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
59 59  
60   -$(obj)spl_minimal.c:
  60 +$(obj)/spl_minimal.c:
61 61 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
62 62  
63   -$(obj)cache.c:
  63 +$(obj)/cache.c:
64 64 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
65 65  
66   -$(obj)time.c:
  66 +$(obj)/time.c:
67 67 ln -sf $(SRCTREE)/arch/powerpc/lib/time.c $@
68 68  
69   -$(obj)ticks.S:
  69 +$(obj)/ticks.S:
70 70 ln -sf $(SRCTREE)/arch/powerpc/lib/ticks.S $@
71   -
72   -#########################################################################
73   -
74   -$(obj)%.o: $(obj)%.S
75   - $(CC) $(AFLAGS) -c -o $@ $<
76   -
77   -$(obj)%.o: $(obj)%.c
78   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/mpc8536ds/Makefile
... ... @@ -22,8 +22,8 @@
22 22 COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
23 23 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24 24  
25   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
26   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  25 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  26 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
27 27 __OBJS := $(SOBJS) $(COBJS)
28 28 LNDIR := $(nandobj)board/$(BOARDDIR)
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
37 37  
38 38  
39 39  
40 40  
41 41  
... ... @@ -45,65 +45,51 @@
45 45  
46 46 # create symbolic links for common files
47 47  
48   -$(obj)cache.c:
  48 +$(obj)/cache.c:
49 49 @rm -f $@
50 50 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
51 51  
52   -$(obj)cpu_init_early.c:
  52 +$(obj)/cpu_init_early.c:
53 53 @rm -f $@
54 54 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
55 55  
56   -$(obj)spl_minimal.c:
  56 +$(obj)/spl_minimal.c:
57 57 @rm -f $@
58 58 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
59 59  
60   -$(obj)fsl_law.c:
  60 +$(obj)/fsl_law.c:
61 61 @rm -f $@
62 62 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
63 63  
64   -$(obj)law.c:
  64 +$(obj)/law.c:
65 65 @rm -f $@
66 66 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
67 67  
68   -$(obj)nand_boot_fsl_elbc.c:
  68 +$(obj)/nand_boot_fsl_elbc.c:
69 69 @rm -f $@
70 70 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
71 71  
72   -$(obj)ns16550.c:
  72 +$(obj)/ns16550.c:
73 73 @rm -f $@
74 74 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
75 75  
76   -$(obj)resetvec.S:
  76 +$(obj)/resetvec.S:
77 77 @rm -f $@
78 78 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
79 79  
80   -$(obj)fixed_ivor.S:
  80 +$(obj)/fixed_ivor.S:
81 81 @rm -f $@
82 82 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
83 83  
84   -$(obj)start.S: $(obj)fixed_ivor.S
  84 +$(obj)/start.S: $(obj)/fixed_ivor.S
85 85 @rm -f $@
86 86 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
87 87  
88   -$(obj)tlb.c:
  88 +$(obj)/tlb.c:
89 89 @rm -f $@
90 90 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
91 91  
92   -$(obj)tlb_table.c:
  92 +$(obj)/tlb_table.c:
93 93 @rm -f $@
94 94 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
95   -
96   -ifneq ($(OBJTREE), $(SRCTREE))
97   -$(obj)nand_boot.c:
98   - @rm -f $@
99   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
100   -endif
101   -
102   -#########################################################################
103   -
104   -$(obj)%.o: $(obj)%.S
105   - $(CC) $(AFLAGS) -c -o $@ $<
106   -
107   -$(obj)%.o: $(obj)%.c
108   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/mpc8569mds/Makefile
... ... @@ -22,8 +22,8 @@
22 22 COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
23 23 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24 24  
25   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
26   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  25 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  26 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
27 27 __OBJS := $(SOBJS) $(COBJS)
28 28 LNDIR := $(nandobj)board/$(BOARDDIR)
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
37 37  
38 38  
39 39  
40 40  
41 41  
... ... @@ -45,65 +45,51 @@
45 45  
46 46 # create symbolic links for common files
47 47  
48   -$(obj)cache.c:
  48 +$(obj)/cache.c:
49 49 @rm -f $@
50 50 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
51 51  
52   -$(obj)cpu_init_early.c:
  52 +$(obj)/cpu_init_early.c:
53 53 @rm -f $@
54 54 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
55 55  
56   -$(obj)spl_minimal.c:
  56 +$(obj)/spl_minimal.c:
57 57 @rm -f $@
58 58 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
59 59  
60   -$(obj)fsl_law.c:
  60 +$(obj)/fsl_law.c:
61 61 @rm -f $@
62 62 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
63 63  
64   -$(obj)law.c:
  64 +$(obj)/law.c:
65 65 @rm -f $@
66 66 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
67 67  
68   -$(obj)nand_boot_fsl_elbc.c:
  68 +$(obj)/nand_boot_fsl_elbc.c:
69 69 @rm -f $@
70 70 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
71 71  
72   -$(obj)ns16550.c:
  72 +$(obj)/ns16550.c:
73 73 @rm -f $@
74 74 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
75 75  
76   -$(obj)resetvec.S:
  76 +$(obj)/resetvec.S:
77 77 @rm -f $@
78 78 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
79 79  
80   -$(obj)fixed_ivor.S:
  80 +$(obj)/fixed_ivor.S:
81 81 @rm -f $@
82 82 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
83 83  
84   -$(obj)start.S: $(obj)fixed_ivor.S
  84 +$(obj)/start.S: $(obj)/fixed_ivor.S
85 85 @rm -f $@
86 86 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
87 87  
88   -$(obj)tlb.c:
  88 +$(obj)/tlb.c:
89 89 @rm -f $@
90 90 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
91 91  
92   -$(obj)tlb_table.c:
  92 +$(obj)/tlb_table.c:
93 93 @rm -f $@
94 94 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
95   -
96   -ifneq ($(OBJTREE), $(SRCTREE))
97   -$(obj)nand_boot.c:
98   - @rm -f $@
99   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
100   -endif
101   -
102   -#########################################################################
103   -
104   -$(obj)%.o: $(obj)%.S
105   - $(CC) $(AFLAGS) -c -o $@ $<
106   -
107   -$(obj)%.o: $(obj)%.c
108   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/mpc8572ds/Makefile
... ... @@ -22,8 +22,8 @@
22 22 COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
23 23 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24 24  
25   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
26   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  25 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  26 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
27 27 __OBJS := $(SOBJS) $(COBJS)
28 28 LNDIR := $(nandobj)board/$(BOARDDIR)
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
37 37  
38 38  
39 39  
40 40  
41 41  
... ... @@ -45,65 +45,51 @@
45 45  
46 46 # create symbolic links for common files
47 47  
48   -$(obj)cache.c:
  48 +$(obj)/cache.c:
49 49 @rm -f $@
50 50 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
51 51  
52   -$(obj)cpu_init_early.c:
  52 +$(obj)/cpu_init_early.c:
53 53 @rm -f $@
54 54 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
55 55  
56   -$(obj)spl_minimal.c:
  56 +$(obj)/spl_minimal.c:
57 57 @rm -f $@
58 58 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
59 59  
60   -$(obj)fsl_law.c:
  60 +$(obj)/fsl_law.c:
61 61 @rm -f $@
62 62 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
63 63  
64   -$(obj)law.c:
  64 +$(obj)/law.c:
65 65 @rm -f $@
66 66 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
67 67  
68   -$(obj)nand_boot_fsl_elbc.c:
  68 +$(obj)/nand_boot_fsl_elbc.c:
69 69 @rm -f $@
70 70 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
71 71  
72   -$(obj)ns16550.c:
  72 +$(obj)/ns16550.c:
73 73 @rm -f $@
74 74 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
75 75  
76   -$(obj)resetvec.S:
  76 +$(obj)/resetvec.S:
77 77 @rm -f $@
78 78 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
79 79  
80   -$(obj)fixed_ivor.S:
  80 +$(obj)/fixed_ivor.S:
81 81 @rm -f $@
82 82 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
83 83  
84   -$(obj)start.S: $(obj)fixed_ivor.S
  84 +$(obj)/start.S: $(obj)/fixed_ivor.S
85 85 @rm -f $@
86 86 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
87 87  
88   -$(obj)tlb.c:
  88 +$(obj)/tlb.c:
89 89 @rm -f $@
90 90 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
91 91  
92   -$(obj)tlb_table.c:
  92 +$(obj)/tlb_table.c:
93 93 @rm -f $@
94 94 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
95   -
96   -ifneq ($(OBJTREE), $(SRCTREE))
97   -$(obj)nand_boot.c:
98   - @rm -f $@
99   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
100   -endif
101   -
102   -#########################################################################
103   -
104   -$(obj)%.o: $(obj)%.S
105   - $(CC) $(AFLAGS) -c -o $@ $<
106   -
107   -$(obj)%.o: $(obj)%.c
108   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/p1023rds/Makefile
... ... @@ -18,8 +18,8 @@
18 18 COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
19 19 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
20 20  
21   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
22   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  21 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  22 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
23 23 __OBJS := $(SOBJS) $(COBJS)
24 24 LNDIR := $(nandobj)board/$(BOARDDIR)
25 25  
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
37 37  
... ... @@ -41,65 +41,51 @@
41 41  
42 42 # create symbolic links for common files
43 43  
44   -$(obj)cache.c:
  44 +$(obj)/cache.c:
45 45 @rm -f $@
46 46 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
47 47  
48   -$(obj)cpu_init_early.c:
  48 +$(obj)/cpu_init_early.c:
49 49 @rm -f $@
50 50 ln -sf $(SRCTREE)/$(CPUDIR)/cpu_init_early.c $@
51 51  
52   -$(obj)spl_minimal.c:
  52 +$(obj)/spl_minimal.c:
53 53 @rm -f $@
54 54 ln -sf $(SRCTREE)/$(CPUDIR)/spl_minimal.c $@
55 55  
56   -$(obj)fsl_law.c:
  56 +$(obj)/fsl_law.c:
57 57 @rm -f $@
58 58 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
59 59  
60   -$(obj)law.c:
  60 +$(obj)/law.c:
61 61 @rm -f $@
62 62 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
63 63  
64   -$(obj)nand_boot_fsl_elbc.c:
  64 +$(obj)/nand_boot_fsl_elbc.c:
65 65 @rm -f $@
66 66 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
67 67  
68   -$(obj)ns16550.c:
  68 +$(obj)/ns16550.c:
69 69 @rm -f $@
70 70 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
71 71  
72   -$(obj)resetvec.S:
  72 +$(obj)/resetvec.S:
73 73 @rm -f $@
74 74 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
75 75  
76   -$(obj)fixed_ivor.S:
  76 +$(obj)/fixed_ivor.S:
77 77 @rm -f $@
78 78 ln -sf $(SRCTREE)/$(CPUDIR)/fixed_ivor.S $@
79 79  
80   -$(obj)start.S: $(obj)fixed_ivor.S
  80 +$(obj)/start.S: $(obj)/fixed_ivor.S
81 81 @rm -f $@
82 82 ln -sf $(SRCTREE)/$(CPUDIR)/start.S $@
83 83  
84   -$(obj)tlb.c:
  84 +$(obj)/tlb.c:
85 85 @rm -f $@
86 86 ln -sf $(SRCTREE)/$(CPUDIR)/tlb.c $@
87 87  
88   -$(obj)tlb_table.c:
  88 +$(obj)/tlb_table.c:
89 89 @rm -f $@
90 90 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
91   -
92   -ifneq ($(OBJTREE), $(SRCTREE))
93   -$(obj)nand_boot.c:
94   - @rm -f $@
95   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
96   -endif
97   -
98   -#########################################################################
99   -
100   -$(obj)%.o: $(obj)%.S
101   - $(CC) $(AFLAGS) -c -o $@ $<
102   -
103   -$(obj)%.o: $(obj)%.c
104   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/freescale/p1_p2_rdb/Makefile
... ... @@ -22,8 +22,8 @@
22 22 COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
23 23 nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
24 24  
25   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
26   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  25 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  26 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
27 27 __OBJS := $(SOBJS) $(COBJS)
28 28 LNDIR := $(nandobj)board/$(BOARDDIR)
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
36 36  
37 37  
38 38  
39 39  
40 40  
41 41  
... ... @@ -45,65 +45,51 @@
45 45  
46 46 # create symbolic links for common files
47 47  
48   -$(obj)cache.c:
  48 +$(obj)/cache.c:
49 49 @rm -f $@
50 50 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
51 51  
52   -$(obj)cpu_init_early.c:
  52 +$(obj)/cpu_init_early.c:
53 53 @rm -f $@
54 54 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
55 55  
56   -$(obj)spl_minimal.c:
  56 +$(obj)/spl_minimal.c:
57 57 @rm -f $@
58 58 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
59 59  
60   -$(obj)fsl_law.c:
  60 +$(obj)/fsl_law.c:
61 61 @rm -f $@
62 62 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
63 63  
64   -$(obj)law.c:
  64 +$(obj)/law.c:
65 65 @rm -f $@
66 66 ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
67 67  
68   -$(obj)nand_boot_fsl_elbc.c:
  68 +$(obj)/nand_boot_fsl_elbc.c:
69 69 @rm -f $@
70 70 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
71 71  
72   -$(obj)ns16550.c:
  72 +$(obj)/ns16550.c:
73 73 @rm -f $@
74 74 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
75 75  
76   -$(obj)resetvec.S:
  76 +$(obj)/resetvec.S:
77 77 @rm -f $@
78 78 ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
79 79  
80   -$(obj)fixed_ivor.S:
  80 +$(obj)/fixed_ivor.S:
81 81 @rm -f $@
82 82 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
83 83  
84   -$(obj)start.S: $(obj)fixed_ivor.S
  84 +$(obj)/start.S: $(obj)/fixed_ivor.S
85 85 @rm -f $@
86 86 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
87 87  
88   -$(obj)tlb.c:
  88 +$(obj)/tlb.c:
89 89 @rm -f $@
90 90 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
91 91  
92   -$(obj)tlb_table.c:
  92 +$(obj)/tlb_table.c:
93 93 @rm -f $@
94 94 ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
95   -
96   -ifneq ($(OBJTREE), $(SRCTREE))
97   -$(obj)nand_boot.c:
98   - @rm -f $@
99   - ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
100   -endif
101   -
102   -#########################################################################
103   -
104   -$(obj)%.o: $(obj)%.S
105   - $(CC) $(AFLAGS) -c -o $@ $<
106   -
107   -$(obj)%.o: $(obj)%.c
108   - $(CC) $(CFLAGS) -c -o $@ $<
nand_spl/board/sheldon/simpc8313/Makefile
... ... @@ -19,8 +19,8 @@
19 19 COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
20 20 time.o cache.o
21 21  
22   -SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
23   -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  22 +SRCS := $(addprefix $(obj)/,$(SOBJS:.o=.S) $(COBJS:.o=.c))
  23 +OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
24 24 __OBJS := $(SOBJS) $(COBJS)
25 25 LNDIR := $(nandobj)board/$(BOARDDIR)
26 26  
27 27  
28 28  
29 29  
30 30  
31 31  
32 32  
33 33  
34 34  
35 35  
... ... @@ -41,47 +41,39 @@
41 41  
42 42 # create symbolic links for common files
43 43  
44   -$(obj)start.S:
  44 +$(obj)/start.S:
45 45 @rm -f $@
46 46 ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
47 47  
48   -$(obj)nand_boot_fsl_elbc.c:
  48 +$(obj)/nand_boot_fsl_elbc.c:
49 49 @rm -f $@
50 50 ln -s $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
51 51  
52   -$(obj)sdram.c:
  52 +$(obj)/sdram.c:
53 53 @rm -f $@
54 54 ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
55 55  
56   -$(obj)$(BOARD).c:
  56 +$(obj)/$(BOARD).c:
57 57 @rm -f $@
58 58 ln -s $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
59 59  
60   -$(obj)ns16550.c:
  60 +$(obj)/ns16550.c:
61 61 @rm -f $@
62 62 ln -s $(SRCTREE)/drivers/serial/ns16550.c $@
63 63  
64   -$(obj)spl_minimal.c:
  64 +$(obj)/spl_minimal.c:
65 65 @rm -f $@
66 66 ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
67 67  
68   -$(obj)cache.c:
  68 +$(obj)/cache.c:
69 69 @rm -f $@
70 70 ln -s $(SRCTREE)/arch/powerpc/lib/cache.c $@
71 71  
72   -$(obj)time.c:
  72 +$(obj)/time.c:
73 73 @rm -f $@
74 74 ln -s $(SRCTREE)/arch/powerpc/lib/time.c $@
75 75  
76   -$(obj)ticks.S:
  76 +$(obj)/ticks.S:
77 77 @rm -f $@
78 78 ln -s $(SRCTREE)/arch/powerpc/lib/ticks.S $@
79   -
80   -#########################################################################
81   -
82   -$(obj)%.o: $(obj)%.S
83   - $(CC) $(AFLAGS) -c -o $@ $<
84   -
85   -$(obj)%.o: $(obj)%.c
86   - $(CC) $(CFLAGS) -c -o $@ $<
post/lib_powerpc/fpu/Makefile
... ... @@ -18,7 +18,7 @@
18 18 CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
19 19 CFLAGS += -mhard-float -fkeep-inline-functions
20 20  
21   -$(addprefix $(obj),$(obj-y)): $(obj)%.o: %.c
  21 +$(addprefix $(obj)/,$(obj-y)): $(obj)/%.o: $(src)/%.c
22 22 $(CC) $(ALL_CFLAGS) -o $@.fp $< -c
23 23 $(OBJCOPY) -R .gnu.attributes $@.fp $@
24 24 rm -f $@.fp
... ... @@ -6,41 +6,42 @@
6 6 #
7 7 #########################################################################
8 8  
9   -_depend: $(obj).depend
  9 +_depend: $(obj)/.depend
10 10  
11 11 # Split the source files into two camps: those in the current directory, and
12 12 # those somewhere else. For the first camp we want to support CPPFLAGS_<fname>
13 13 # and for the second we don't / can't.
14   -PWD_SRCS := $(filter $(notdir $(SRCS)),$(SRCS))
15   -OTHER_SRCS := $(filter-out $(notdir $(SRCS)),$(SRCS))
  14 +PWD_SRCS := $(foreach f,$(SRCS), $(if \
  15 + $(filter $(if $(KBUILD_SRC),$(srctree)/)$(src)/$(notdir $f),$f), $f))
  16 +OTHER_SRCS := $(filter-out $(PWD_SRCS),$(SRCS))
16 17  
17 18 # This is a list of dependency files to generate
18   -DEPS := $(basename $(patsubst %,$(obj).depend.%,$(PWD_SRCS)))
  19 +DEPS := $(basename $(addprefix $(obj)/.depend., $(notdir $(PWD_SRCS))))
19 20  
20 21 # Join all the dependencies into a single file, in three parts
21 22 # 1 .Concatenate all the generated depend files together
22 23 # 2. Add in the deps from OTHER_SRCS which we couldn't process
23 24 # 3. Add in the HOSTSRCS
24   -$(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(DEPS) $(OTHER_SRCS) \
  25 +$(obj)/.depend: $(TOPDIR)/config.mk $(DEPS) $(OTHER_SRCS) \
25 26 $(HOSTSRCS)
26 27 cat /dev/null $(DEPS) >$@
27 28 @for f in $(OTHER_SRCS); do \
28 29 g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
29   - $(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
  30 + $(CC) -M $(CPPFLAGS) -MQ $(obj)/$$g $$f >> $@ ; \
30 31 done
31 32 @for f in $(HOSTSRCS); do \
32 33 g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
33   - $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
  34 + $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)/$$g $$f >> $@ ; \
34 35 done
35 36  
36 37 MAKE_DEPEND = $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS_DEP) \
37 38 -MQ $(addsuffix .o,$(obj)$(basename $<)) $< >$@
38 39  
39 40  
40   -$(obj).depend.%: %.c
  41 +$(obj)/.depend.%: $(src)/%.c
41 42 $(MAKE_DEPEND)
42 43  
43   -$(obj).depend.%: %.S
  44 +$(obj)/.depend.%: $(src)/%.S
44 45 $(MAKE_DEPEND)
45 46  
46 47 #########################################################################
scripts/Kbuild.include
... ... @@ -165,9 +165,7 @@
165 165 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
166 166 # Usage:
167 167 # $(Q)$(MAKE) $(build)=dir
168   -#build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
169   -# temporary
170   -build := -f $(srctree)/scripts/Makefile.build -C
  168 +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
171 169  
172 170 ###
173 171 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
scripts/Makefile.build
... ... @@ -2,17 +2,28 @@
2 2 .PHONY: all
3 3 all:
4 4  
  5 +ifeq ($(CONFIG_TPL_BUILD),y)
  6 + src := $(patsubst tpl/%,%,$(obj))
  7 +else
  8 + ifeq ($(CONFIG_SPL_BUILD),y)
  9 + src := $(patsubst spl/%,%,$(obj))
  10 + else
  11 + src := $(obj)
  12 + endif
  13 +endif
  14 +
5 15 include $(srctree)/scripts/Kbuild.include
6   -include $(TOPDIR)/config.mk
  16 +include $(srctree)/config.mk
7 17  
8 18 # variable LIB is used in examples/standalone/Makefile
9   -__LIB := $(obj)built-in.o
10   -LIBGCC = $(obj)libgcc.o
  19 +__LIB := $(obj)/built-in.o
  20 +LIBGCC = $(obj)/libgcc.o
11 21 SRCS :=
12 22 subdir-y :=
13 23 obj-dirs :=
14 24  
15   -include Makefile
  25 +kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
  26 +include $(kbuild-dir)/Makefile
16 27  
17 28 # Do not include host rules unless needed
18 29 ifneq ($(hostprogs-y)$(hostprogs-m),)
19 30  
20 31  
21 32  
22 33  
23 34  
24 35  
25 36  
... ... @@ -28,31 +39,37 @@
28 39 subdir-y += $(patsubst %/,%,$(filter %/, $(obj-y)))
29 40 obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
30 41 subdir-obj-y := $(filter %/built-in.o, $(obj-y))
31   -subdir-obj-y := $(addprefix $(obj),$(subdir-obj-y))
  42 +subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
32 43  
33   -SRCS += $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) \
34   - $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S))
35   -OBJS := $(addprefix $(obj),$(obj-y))
  44 +SRCS += $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) \
  45 + $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S)
36 46  
  47 +SRCS := $(addprefix $(if $(KBUILD_SRC),$(srctree)/$(src)/,$(src)/),$(SRCS))
  48 +SRCS := $(wildcard $(SRCS))
  49 +
  50 +OBJS := $(addprefix $(obj)/,$(obj-y))
  51 +
37 52 # $(obj-dirs) is a list of directories that contain object files
38 53  
39 54 obj-dirs += $(dir $(OBJS))
40 55  
  56 +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
  57 +
41 58 # Create directories for object files if directory does not exist
42 59 # Needed when obj-y := dir/file.o syntax is used
43 60 _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
44 61  
45   -LGOBJS := $(addprefix $(obj),$(sort $(lib-y)))
  62 +LGOBJS := $(addprefix $(obj)/,$(sort $(lib-y)))
46 63  
47   -all: $(__LIB) $(addprefix $(obj),$(extra-y) $(always)) $(subdir-y)
  64 +all: $(__LIB) $(addprefix $(obj)/,$(extra-y) $(always)) $(subdir-y)
48 65  
49   -$(__LIB): $(obj).depend $(OBJS)
  66 +$(__LIB): $(obj)/.depend $(OBJS)
50 67 $(call cmd_link_o_target, $(OBJS))
51 68  
52 69 ifneq ($(strip $(lib-y)),)
53 70 all: $(LIBGCC)
54 71  
55   -$(LIBGCC): $(obj).depend $(LGOBJS)
  72 +$(LIBGCC): $(obj)/.depend $(LGOBJS)
56 73 $(call cmd_link_o_target, $(LGOBJS))
57 74 endif
58 75  
... ... @@ -63,7 +80,7 @@
63 80  
64 81 ifneq ($(subdir-y),)
65 82 $(subdir-y): FORCE
66   - $(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build
  83 + $(MAKE) $(build)=$(obj)/$@
67 84 endif
68 85  
69 86 #########################################################################
70 87  
71 88  
72 89  
73 90  
... ... @@ -78,18 +95,18 @@
78 95 # See rules.mk
79 96 EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $<))) \
80 97 $(CPPFLAGS_$(BCURDIR))
81   -$(obj)%.s: %.S
  98 +$(obj)/%.s: $(src)/%.S
82 99 $(CPP) $(ALL_AFLAGS) -o $@ $<
83   -$(obj)%.o: %.S
  100 +$(obj)/%.o: $(src)/%.S
84 101 $(CC) $(ALL_AFLAGS) -o $@ $< -c
85   -$(obj)%.o: %.c
  102 +$(obj)/%.o: $(src)/%.c
86 103 ifneq ($(CHECKSRC),0)
87 104 $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $<
88 105 endif
89 106 $(CC) $(ALL_CFLAGS) -o $@ $< -c
90   -$(obj)%.i: %.c
  107 +$(obj)/%.i: $(src)/%.c
91 108 $(CPP) $(ALL_CFLAGS) -o $@ $< -c
92   -$(obj)%.s: %.c
  109 +$(obj)/%.s: $(src)/%.c
93 110 $(CC) $(ALL_CFLAGS) -o $@ $< -c -S
94 111  
95 112 # If the list of objects to link is empty, just create an empty built-in.o
96 113  
... ... @@ -99,11 +116,11 @@
99 116  
100 117 #########################################################################
101 118  
102   -# defines $(obj).depend target
  119 +# defines $(obj)/.depend target
103 120  
104 121 include $(TOPDIR)/rules.mk
105 122  
106   -sinclude $(obj).depend
  123 +sinclude $(obj)/.depend
107 124  
108 125 #########################################################################
109 126  
scripts/Makefile.host.tmp
... ... @@ -21,11 +21,11 @@
21 21  
22 22 host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs))))
23 23  
24   -__hostprogs := $(addprefix $(obj),$(__hostprogs))
25   -host-csingle := $(addprefix $(obj),$(host-csingle))
26   -host-cmulti := $(addprefix $(obj),$(host-cmulti))
27   -host-cobjs := $(addprefix $(obj),$(host-cobjs))
28   -host-objdirs := $(addprefix $(obj),$(host-objdirs))
  24 +__hostprogs := $(addprefix $(obj)/,$(__hostprogs))
  25 +host-csingle := $(addprefix $(obj)/,$(host-csingle))
  26 +host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
  27 +host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
  28 +host-objdirs := $(addprefix $(obj)/,$(host-objdirs))
29 29  
30 30 obj-dirs += $(host-objdirs)
31 31  
32 32  
33 33  
... ... @@ -49,13 +49,13 @@
49 49 #####
50 50 # Compile programs on the host
51 51  
52   -$(host-csingle): $(obj)%: %.c
  52 +$(host-csingle): $(obj)/%: $(src)/%.c
53 53 $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTLDFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $<
54 54  
55   -$(host-cmulti): $(obj)%: $(host-cobjs)
56   - $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj),$($(@F)-objs)) $(HOSTLOADLIBES_$(@F))
  55 +$(host-cmulti): $(obj)/%: $(host-cobjs)
  56 + $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(@F)-objs)) $(HOSTLOADLIBES_$(@F))
57 57  
58   -$(host-cobjs): $(obj)%.o: %.c
  58 +$(host-cobjs): $(obj)/%.o: $(src)/%.c
59 59 $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
60 60  
61 61 targets += $(host-csingle) $(host-cmulti) $(host-cobjs)
... ... @@ -14,6 +14,11 @@
14 14 # Based on top-level Makefile.
15 15 #
16 16  
  17 +src := $(obj)
  18 +
  19 +# Create output directory if not already present
  20 +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
  21 +
17 22 include $(srctree)/scripts/Kbuild.include
18 23  
19 24 CONFIG_SPL_BUILD := y
... ... @@ -37,14 +42,6 @@
37 42  
38 43 include $(TOPDIR)/config.mk
39 44  
40   -# We want the final binaries in this directory
41   -ifeq ($(CONFIG_TPL_BUILD),y)
42   -obj := $(OBJTREE)/tpl/
43   -SPLTREE := $(TPLTREE)
44   -else
45   -obj := $(OBJTREE)/spl/
46   -endif
47   -
48 45 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)
49 46  
50 47 ifdef CONFIG_SPL_START_S_PATH
51 48  
52 49  
... ... @@ -113,12 +110,14 @@
113 110 PLATFORM_LIBS := $(filter-out %/libgcc.o, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
114 111 endif
115 112  
116   -START := $(addprefix $(SPLTREE)/,$(head-y))
117   -LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
  113 +LIBS-y := $(sort $(LIBS-y))
118 114  
119   -__START := $(subst $(obj),,$(START))
120   -__LIBS := $(subst $(obj),,$(LIBS))
  115 +__START := $(head-y)
  116 +__LIBS := $(LIBS-y)
121 117  
  118 +START := $(addprefix $(obj)/,$(head-y))
  119 +LIBS := $(addprefix $(obj)/,$(LIBS-y))
  120 +
122 121 # Linker Script
123 122 ifdef CONFIG_SPL_LDSCRIPT
124 123 # need to strip off double quotes
125 124  
126 125  
127 126  
128 127  
... ... @@ -148,21 +147,21 @@
148 147 $(shell $(LD) --version | \
149 148 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
150 149  
151   -$(OBJTREE)/MLO: $(obj)u-boot-spl.bin
  150 +$(OBJTREE)/MLO: $(obj)/u-boot-spl.bin
152 151 $(OBJTREE)/tools/mkimage -T omapimage \
153 152 -a $(CONFIG_SPL_TEXT_BASE) -d $< $@
154 153  
155   -$(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin
  154 +$(OBJTREE)/MLO.byteswap: $(obj)/u-boot-spl.bin
156 155 $(OBJTREE)/tools/mkimage -T omapimage -n byteswap \
157 156 -a $(CONFIG_SPL_TEXT_BASE) -d $< $@
158 157  
159   -$(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend
160   - $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $@
  158 +$(objtree)/SPL : $(obj)/u-boot-spl.bin depend
  159 + $(MAKE) $(build)=spl/arch/arm/imx-common $@
161 160  
162   -ALL-y += $(obj)$(SPL_BIN).bin
  161 +ALL-y += $(obj)/$(SPL_BIN).bin
163 162  
164 163 ifdef CONFIG_SAMSUNG
165   -ALL-y += $(obj)$(BOARD)-spl.bin
  164 +ALL-y += $(obj)/$(BOARD)-spl.bin
166 165 endif
167 166  
168 167 all: $(ALL-y)
169 168  
170 169  
... ... @@ -173,16 +172,16 @@
173 172 else
174 173 VAR_SIZE_PARAM =
175 174 endif
176   -$(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
  175 +$(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin
177 176 $(if $(wildcard $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
178 177 $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
179 178 $(OBJTREE)/tools/mkexynosspl) $(VAR_SIZE_PARAM) $< $@
180 179 endif
181 180  
182   -$(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN)
  181 +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)
183 182 $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@
184 183  
185   -LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
  184 +LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
186 185 ifneq ($(CONFIG_SPL_TEXT_BASE),)
187 186 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
188 187 endif
189 188  
190 189  
191 190  
... ... @@ -192,19 +191,19 @@
192 191 --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
193 192 -Map $(SPL_BIN).map -o $(SPL_BIN)
194 193  
195   -$(obj)$(SPL_BIN): depend $(START) $(LIBS) $(obj)u-boot-spl.lds
  194 +$(obj)/$(SPL_BIN): depend $(START) $(LIBS) $(obj)/u-boot-spl.lds
196 195 $(GEN_UBOOT)
197 196  
198 197 $(START):
199 198 @:
200 199  
201 200 $(LIBS): depend
202   - $(MAKE) $(build) $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
  201 + $(MAKE) $(build)=$(patsubst %/,%,$(dir $@))
203 202  
204   -$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
  203 +$(obj)/u-boot-spl.lds: $(LDSCRIPT) depend
205 204 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P - < $< > $@
206 205  
207   -depend: $(obj).depend
  206 +depend: $(obj)/.depend
208 207 .PHONY: depend
209 208  
210 209 # defines $(obj).depend target
... ... @@ -142,8 +142,8 @@
142 142 always := $(hostprogs-y)
143 143  
144 144 # Generated LCD/video logo
145   -LOGO_H = $(OBJTREE)/include/bmp_logo.h
146   -LOGO_DATA_H = $(OBJTREE)/include/bmp_logo_data.h
  145 +LOGO_H = $(objtree)/include/bmp_logo.h
  146 +LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
147 147 LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H)
148 148 LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_DATA_H)
149 149 LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H)
150 150  
151 151  
... ... @@ -151,14 +151,14 @@
151 151  
152 152 # Generic logo
153 153 ifeq ($(LOGO_BMP),)
154   -LOGO_BMP= logos/denx.bmp
  154 +LOGO_BMP= $(srctree)/$(src)/logos/denx.bmp
155 155  
156 156 # Use board logo and fallback to vendor
157 157 ifneq ($(wildcard logos/$(BOARD).bmp),)
158   -LOGO_BMP= logos/$(BOARD).bmp
  158 +LOGO_BMP= $(srctree)/$(src)/logos/$(BOARD).bmp
159 159 else
160 160 ifneq ($(wildcard logos/$(VENDOR).bmp),)
161   -LOGO_BMP= logos/$(VENDOR).bmp
  161 +LOGO_BMP= $(srctree)/$(src)/logos/$(VENDOR).bmp
162 162 endif
163 163 endif
164 164  
165 165  
... ... @@ -187,9 +187,9 @@
187 187  
188 188 subdir-y := kernel-doc
189 189  
190   -$(LOGO_H): $(obj)bmp_logo $(LOGO_BMP)
191   - $(obj)./bmp_logo --gen-info $(LOGO_BMP) > $@
  190 +$(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
  191 + $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@
192 192  
193   -$(LOGO_DATA_H): $(obj)bmp_logo $(LOGO_BMP)
194   - $(obj)./bmp_logo --gen-data $(LOGO_BMP) > $@
  193 +$(LOGO_DATA_H): $(obj)/bmp_logo $(LOGO_BMP)
  194 + $(obj)/bmp_logo --gen-data $(LOGO_BMP) > $@