kbuild: rename TOPDIR to stctree
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Tue, 11 Mar 2014 02:05:19 +0000 (11:05 +0900)
committerTom Rini <trini@ti.com>
Wed, 12 Mar 2014 21:04:55 +0000 (17:04 -0400)
Prior to Kbuild, $(TOPDIR) or $(SRCTREE) was used for
pointing to the top of source directory.
(No difference between the two.)

In Kbuild style, $(srctree) is used instead.
This commit renames TOPDIR to srctree and delete the
defition of TOPDIR.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
19 files changed:
Makefile
arch/m68k/cpu/mcf52x2/config.mk
arch/m68k/cpu/mcf532x/config.mk
arch/m68k/cpu/mcf5445x/config.mk
arch/powerpc/cpu/ppc4xx/config.mk
board/hymod/config.mk
board/korat/config.mk
config.mk
doc/README.SPL
doc/README.TPL
doc/README.commands
nand_spl/board/freescale/mpc8315erdb/Makefile
nand_spl/board/freescale/mpc8536ds/Makefile
nand_spl/board/freescale/mpc8569mds/Makefile
nand_spl/board/freescale/mpc8572ds/Makefile
nand_spl/board/freescale/p1023rds/Makefile
nand_spl/board/freescale/p1_p2_rdb/Makefile
nand_spl/board/sheldon/simpc8313/Makefile
spl/Makefile

index 1b1cfb85ed1c7833ddb7fa0bdb05d7bf3bfb1b75..f18f3eb4f528c62a61732e7c93d3fb8fcadb5332 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -169,8 +169,7 @@ OBJTREE             := $(objtree)
 SPLTREE                := $(OBJTREE)/spl
 TPLTREE                := $(OBJTREE)/tpl
 SRCTREE                := $(srctree)
-TOPDIR         := $(SRCTREE)
-export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
+export SRCTREE OBJTREE SPLTREE TPLTREE
 
 MKCONFIG       := $(SRCTREE)/mkconfig
 export MKCONFIG
@@ -490,7 +489,7 @@ endif
 # standard location.
 
 ifndef LDSCRIPT
-       #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
+       #LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds.debug
        ifdef CONFIG_SYS_LDSCRIPT
                # need to strip off double quotes
                LDSCRIPT := $(srctree)/$(CONFIG_SYS_LDSCRIPT:"%"=%)
@@ -500,19 +499,19 @@ endif
 # If there is no specified link script, we look in a number of places for it
 ifndef LDSCRIPT
        ifeq ($(CONFIG_NAND_U_BOOT),y)
-               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+               LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-nand.lds
                ifeq ($(wildcard $(LDSCRIPT)),)
-                       LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+                       LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-nand.lds
                endif
        endif
        ifeq ($(wildcard $(LDSCRIPT)),)
-               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+               LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds
        endif
        ifeq ($(wildcard $(LDSCRIPT)),)
-               LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
+               LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot.lds
        endif
        ifeq ($(wildcard $(LDSCRIPT)),)
-               LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
+               LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot.lds
        endif
 endif
 
@@ -666,7 +665,7 @@ export PLATFORM_LIBS
 # Pass the version down so we can handle backwards compatibility
 # on the fly.
 LDPPFLAGS += \
-       -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+       -include $(srctree)/include/u-boot/u-boot.lds.h \
        -DCPUDIR=$(CPUDIR) \
        $(shell $(LD) --version | \
          sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
@@ -1240,7 +1239,7 @@ distclean: mrproper
                -type f -print | xargs rm -f
 
 backup:
-       F=`basename $(TOPDIR)` ; cd .. ; \
+       F=`basename $(srctree)` ; cd .. ; \
        gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
 
 help:
index 25f98deb14f6499c6fbe0b92091c192f0faefc70..ebf75e6f159981ba66781755b2eff3cdecd29952 100644 (file)
@@ -8,13 +8,13 @@
 #
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
-is5208:=$(shell grep CONFIG_M5208 $(TOPDIR)/include/$(cfg))
-is5249:=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg))
-is5253:=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg))
-is5271:=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg))
-is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
-is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg))
-is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
+is5208:=$(shell grep CONFIG_M5208 $(srctree)/include/$(cfg))
+is5249:=$(shell grep CONFIG_M5249 $(srctree)/include/$(cfg))
+is5253:=$(shell grep CONFIG_M5253 $(srctree)/include/$(cfg))
+is5271:=$(shell grep CONFIG_M5271 $(srctree)/include/$(cfg))
+is5272:=$(shell grep CONFIG_M5272 $(srctree)/include/$(cfg))
+is5275:=$(shell grep CONFIG_M5275 $(srctree)/include/$(cfg))
+is5282:=$(shell grep CONFIG_M5282 $(srctree)/include/$(cfg))
 
 ifneq (,$(findstring CONFIG_M5208,$(is5208)))
 PLATFORM_CPPFLAGS += -mcpu=5208
index 0604ab0f424cc2bf16c2ff11355164c58b02534f..0a248c3da05846bb8875cb793fc56d97eef09e70 100644 (file)
@@ -8,8 +8,8 @@
 #
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
-is5301x:=$(shell grep CONFIG_MCF5301x $(TOPDIR)/include/$(cfg))
-is532x:=$(shell grep CONFIG_MCF532x $(TOPDIR)/include/$(cfg))
+is5301x:=$(shell grep CONFIG_MCF5301x $(srctree)/include/$(cfg))
+is532x:=$(shell grep CONFIG_MCF532x $(srctree)/include/$(cfg))
 
 ifneq (,$(findstring CONFIG_MCF5301x,$(is5301x)))
 PLATFORM_CPPFLAGS += -mcpu=53015 -fPIC
index 6da08d514da21dae306f36dbdf683fdaa38c30d9..2f310a5d7742268e96a2d75ad0d1bac679b990d5 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
-is5441x:=$(shell grep CONFIG_MCF5441x $(TOPDIR)/include/$(cfg))
+is5441x:=$(shell grep CONFIG_MCF5441x $(srctree)/include/$(cfg))
 
 ifneq (,$(findstring CONFIG_MCF5441x,$(is5441x)))
 PLATFORM_CPPFLAGS += -mcpu=54418 -fPIC
index 71c2a6c729f5762321746d50c2df87c0783bea44..907a3dda7f7f6cf760723c44c6eb2a3db11db64a 100644 (file)
@@ -8,7 +8,7 @@
 PLATFORM_CPPFLAGS += -DCONFIG_4xx -mstring -msoft-float
 
 cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
-is440:=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg))
+is440:=$(shell grep CONFIG_440 $(srctree)/include/$(cfg))
 
 ifneq (,$(findstring CONFIG_440,$(is440)))
 PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
index ee15890c5b7e58c09c72e01477d5ea9baee0d5ea..2eeea50377a4087f1920074aa595ef3cb9706fd2 100644 (file)
@@ -9,6 +9,6 @@
 # HYMOD boards
 #
 
-PLATFORM_CPPFLAGS += -I$(TOPDIR)
+PLATFORM_CPPFLAGS += -I$(srctree)
 
 OBJCOPYFLAGS = --remove-section=.ppcenv
index f8dba2baae495d97539535fbf0a7d01ec126723b..42e0060094d96dfee99c3bb7b63ab37bc9dfa66f 100644 (file)
@@ -23,5 +23,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8CFF0000
 endif
 
 ifndef CONFIG_KORAT_PERMANENT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-F7FC.lds
+LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-F7FC.lds
 endif
index 4657577f9d0e5958a9618d8d62a7c4df8e6a0a4c..9bf4eda56361db6f5c9c566097f83988f1336f7b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -29,11 +29,11 @@ ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR)))
 CPUDIR=arch/$(ARCH)/cpu
 endif
 
-sinclude $(TOPDIR)/arch/$(ARCH)/config.mk      # include architecture dependend rules
-sinclude $(TOPDIR)/$(CPUDIR)/config.mk         # include  CPU  specific rules
+sinclude $(srctree)/arch/$(ARCH)/config.mk     # include architecture dependend rules
+sinclude $(srctree)/$(CPUDIR)/config.mk                # include  CPU  specific rules
 
 ifdef  SOC
-sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk  # include  SoC  specific rules
+sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include  SoC  specific rules
 endif
 ifneq ($(BOARD),)
 ifdef  VENDOR
@@ -43,7 +43,7 @@ BOARDDIR = $(BOARD)
 endif
 endif
 ifdef  BOARD
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
+sinclude $(srctree)/board/$(BOARDDIR)/config.mk        # include board specific rules
 endif
 
 #########################################################################
index b1bc3ca569d40e96dc780491c3195475508a146d..57a39a489b9afe74249a97afc0be2decfd2bcde6 100644 (file)
@@ -13,7 +13,7 @@ can be reused. No code duplication or symlinking is necessary anymore.
 How it works
 ------------
 
-There is a new directory TOPDIR/spl which contains only a Makefile.
+There is a new directory $(srctree)/spl which contains only a Makefile.
 The object files are built separately for SPL and placed in this directory.
 The final binaries which are generated are u-boot-spl, u-boot-spl.bin and
 u-boot-spl.map.
index 1df03b958ea6ad454c66e78475b2599f06b80738..980debe777f53a6d1a2ba950a8945e534848fc35 100644 (file)
@@ -19,7 +19,7 @@ board can be reused. No code duplication or symlinking is necessary anymore.
 How it works
 ------------
 
-There has been a directory TOPDIR/spl which contains only a Makefile. The
+There has been a directory $(srctree)/spl which contains only a Makefile. The
 Makefile is shared by SPL and TPL.
 
 The object files are built separately for SPL/TPL and placed in the
index 9eb367104fd9a1bc77ede04bc11c1ead51b602b9..afd5577b0a9ce66b86c52f7cae595eb7d914e556 100644 (file)
@@ -28,7 +28,7 @@ these symbols when linking full U-Boot even though they are not
 referenced in the source code as such.
 
 If a new board is defined do not forget to define the command section
-by writing in u-boot.lds ($(TOPDIR)/board/boardname/u-boot.lds) these
+by writing in u-boot.lds ($(srctree)/board/boardname/u-boot.lds) these
 3 lines:
 
        .u_boot_list : {
index f41a13a0b0be24ed2c8a65c9a24fce86be2c7d9d..4eec00f03cfb34ecd07dfd4638fa059979db0d11 100644 (file)
@@ -10,7 +10,7 @@ PAD_TO := 0xfff04000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDSCRIPT= $(srctree)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
           $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index f5718628ebe06020ba59e678e561e7c3c36cf6ef..9a9823d0328a296829cc616ad926945a177a93f5 100644 (file)
@@ -12,7 +12,7 @@ PAD_TO := 0xfff01000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
+LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
                $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index f5718628ebe06020ba59e678e561e7c3c36cf6ef..9a9823d0328a296829cc616ad926945a177a93f5 100644 (file)
@@ -12,7 +12,7 @@ PAD_TO := 0xfff01000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
+LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
                $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index f5718628ebe06020ba59e678e561e7c3c36cf6ef..9a9823d0328a296829cc616ad926945a177a93f5 100644 (file)
@@ -12,7 +12,7 @@ PAD_TO := 0xfff01000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
+LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
                $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index b7eedcd852f12dc8e68511695dcedd974f3f5592..9e8698b2f6e8e1b6da6520020ded08cfc88eb446 100644 (file)
@@ -8,7 +8,7 @@ PAD_TO := 0xfff01000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
+LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
                $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index f5718628ebe06020ba59e678e561e7c3c36cf6ef..9a9823d0328a296829cc616ad926945a177a93f5 100644 (file)
@@ -12,7 +12,7 @@ PAD_TO := 0xfff01000
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
+LDSCRIPT= $(srctree)/$(CPUDIR)/u-boot-nand_spl.lds
 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
                $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index 8b29e97860bc2bf6e83c788ef947877e8618f207..e08a9a03b5025f204c1a7fb4c4d70b448dcbbd11 100644 (file)
@@ -11,7 +11,7 @@ include $(srctree)/$(src)/config.mk
 
 nandobj        := $(OBJTREE)/nand_spl/
 
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDSCRIPT= $(srctree)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
           $(LDFLAGS) $(LDFLAGS_FINAL)
 asflags-y += -DCONFIG_NAND_SPL
index bb3d3495e487e3e7ade3ad29e346d93974028070..640db8b95ca45e43fcd8742b94b3162a93f6202d 100644 (file)
@@ -44,7 +44,7 @@ else
   -include include/spl-autoconf.mk
 endif
 
-include $(TOPDIR)/config.mk
+include $(srctree)/config.mk
 
 # Enable garbage collection of un-used sections for SPL
 KBUILD_CFLAGS += -ffunction-sections -fdata-sections
@@ -149,13 +149,13 @@ LDSCRIPT := $(addprefix $(SRCTREE)/,$(CONFIG_SPL_LDSCRIPT:"%"=%))
 endif
 
 ifeq ($(wildcard $(LDSCRIPT)),)
-       LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+       LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-spl.lds
 endif
 ifeq ($(wildcard $(LDSCRIPT)),)
-       LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+       LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-spl.lds
 endif
 ifeq ($(wildcard $(LDSCRIPT)),)
-       LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot-spl.lds
+       LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot-spl.lds
 endif
 ifeq ($(wildcard $(LDSCRIPT)),)
 $(error could not find linker script)
@@ -165,7 +165,7 @@ endif
 # Pass the version down so we can handle backwards compatibility
 # on the fly.
 LDPPFLAGS += \
-       -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+       -include $(srctree)/include/u-boot/u-boot.lds.h \
        -include $(OBJTREE)/include/config.h \
        -DCPUDIR=$(CPUDIR) \
        $(shell $(LD) --version | \