summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-02-04 17:24:28 +0900
committerTom Rini <trini@ti.com>2014-02-19 11:07:50 -0500
commit6825a95b0ba72c4e5667d02d8b31986e2e9abd5a (patch)
treef4c6e81fa45afba6662781eeee3f32b11f0b090d /arch
parent22433fc54b19b0578c43a9983fa45f22ca262a0f (diff)
downloadu-boot-imx-6825a95b0ba72c4e5667d02d8b31986e2e9abd5a.zip
u-boot-imx-6825a95b0ba72c4e5667d02d8b31986e2e9abd5a.tar.gz
u-boot-imx-6825a95b0ba72c4e5667d02d8b31986e2e9abd5a.tar.bz2
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/imx-common/Makefile2
-rw-r--r--arch/blackfin/cpu/Makefile5
-rw-r--r--arch/blackfin/lib/Makefile5
-rw-r--r--arch/m68k/cpu/mcf5227x/Makefile2
-rw-r--r--arch/m68k/cpu/mcf523x/Makefile2
-rw-r--r--arch/m68k/cpu/mcf52x2/Makefile2
-rw-r--r--arch/m68k/cpu/mcf532x/Makefile2
-rw-r--r--arch/m68k/cpu/mcf5445x/Makefile2
-rw-r--r--arch/m68k/cpu/mcf547x_8x/Makefile2
-rw-r--r--arch/powerpc/cpu/mpc8xx/Makefile2
-rw-r--r--arch/powerpc/lib/Makefile4
-rw-r--r--arch/sandbox/cpu/Makefile11
12 files changed, 23 insertions, 18 deletions
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index ee5c872..9dda59d 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -25,7 +25,7 @@ obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
$(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/%
mkdir -p $(dir $@)
- $(CC) -E -x c $< $(CPPFLAGS) -o $@
+ $(CPP) $(cpp_flags) -x c -o $@ $<
$(OBJTREE)/u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp
$(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
diff --git a/arch/blackfin/cpu/Makefile b/arch/blackfin/cpu/Makefile
index 369dc74..dd4d2d1 100644
--- a/arch/blackfin/cpu/Makefile
+++ b/arch/blackfin/cpu/Makefile
@@ -25,7 +25,7 @@ extra-y += check_initcode
# make sure our initcode (which goes into LDR) does not
# have relocs or external references
-$(obj)/initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
+CFLAGS_REMOVE_initcode.o := -ffunction-sections -fdata-sections
READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
$(obj)/check_initcode: $(obj)/initcode.o
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
@@ -35,7 +35,6 @@ ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
fi
endif
-$(obj)/init.lds: $(src)/init.lds.S
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P $^ -o $@
+CPPFLAGS_init.lds := -ansi
$(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o
$(LD) $(LDFLAGS) -T $^ -o $@
diff --git a/arch/blackfin/lib/Makefile b/arch/blackfin/lib/Makefile
index a5c552f..4ba7bf6 100644
--- a/arch/blackfin/lib/Makefile
+++ b/arch/blackfin/lib/Makefile
@@ -9,7 +9,10 @@
# SPDX-License-Identifier: GPL-2.0+
#
-CFLAGS += -DBFIN_BOARD_NAME='"$(BOARD)"'
+# Unnecessary.
+# Use CONFIG_SYS_BOARD instead of BFIN_BOARD_NAME
+# and delete this.
+ccflags-y += -DBFIN_BOARD_NAME='"$(BOARD)"'
obj-y += ins.o
obj-y += memcmp.o
diff --git a/arch/m68k/cpu/mcf5227x/Makefile b/arch/m68k/cpu/mcf5227x/Makefile
index a47fd56..e0c5db6 100644
--- a/arch/m68k/cpu/mcf5227x/Makefile
+++ b/arch/m68k/cpu/mcf5227x/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y = start.o
obj-y = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf523x/Makefile b/arch/m68k/cpu/mcf523x/Makefile
index a47fd56..e0c5db6 100644
--- a/arch/m68k/cpu/mcf523x/Makefile
+++ b/arch/m68k/cpu/mcf523x/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y = start.o
obj-y = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf52x2/Makefile b/arch/m68k/cpu/mcf52x2/Makefile
index d9bf900..b92fd86 100644
--- a/arch/m68k/cpu/mcf52x2/Makefile
+++ b/arch/m68k/cpu/mcf52x2/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y = start.o
obj-y = interrupts.o cpu.o speed.o cpu_init.o
diff --git a/arch/m68k/cpu/mcf532x/Makefile b/arch/m68k/cpu/mcf532x/Makefile
index 97aa3f1..9c53c50 100644
--- a/arch/m68k/cpu/mcf532x/Makefile
+++ b/arch/m68k/cpu/mcf532x/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y := start.o
obj-y = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf5445x/Makefile b/arch/m68k/cpu/mcf5445x/Makefile
index b506719..9be91ed 100644
--- a/arch/m68k/cpu/mcf5445x/Makefile
+++ b/arch/m68k/cpu/mcf5445x/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y = start.o
obj-y = cpu.o speed.o cpu_init.o interrupts.o pci.o
diff --git a/arch/m68k/cpu/mcf547x_8x/Makefile b/arch/m68k/cpu/mcf547x_8x/Makefile
index 0fa50bf..4f82099 100644
--- a/arch/m68k/cpu/mcf547x_8x/Makefile
+++ b/arch/m68k/cpu/mcf547x_8x/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y = start.o
obj-y = cpu.o speed.o cpu_init.o pci.o interrupts.o slicetimer.o
diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile
index d40bdab..f83fd5e 100644
--- a/arch/powerpc/cpu/mpc8xx/Makefile
+++ b/arch/powerpc/cpu/mpc8xx/Makefile
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# CFLAGS += -DET_DEBUG
+# ccflags-y += -DET_DEBUG
extra-y += start.o
extra-y += traps.o
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index ac780d4..e6d8be5 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -54,11 +54,11 @@ ifndef CONFIG_SPL_BUILD
# Workaround for local bus unaligned access problems
# on MPC512x and MPC5200
ifdef CONFIG_MPC512X
-$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
+AFLAGS_ppcstring.o += -Dmemcpy=__memcpy
obj-y += memcpy_mpc5200.o
endif
ifdef CONFIG_MPC5200
-$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
+AFLAGS_ppcstring.o += -Dmemcpy=__memcpy
obj-y += memcpy_mpc5200.o
endif
endif
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index c5f5426..63deded 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -10,7 +10,10 @@
obj-y := cpu.o os.o start.o state.o
# os.c is build in the system environment, so needs standard includes
-$(obj)/os.o: CFLAGS := $(filter-out -nostdinc,\
- $(patsubst -I%,-idirafter%,$(CFLAGS)))
-$(obj)/.depend.os: CPPFLAGS := $(filter-out -nostdinc,\
- $(patsubst -I%,-idirafter%,$(CPPFLAGS)))
+# CFLAGS_REMOVE_os.o cannot be used to drop header include path
+quiet_cmd_cc_os.o = CC $(quiet_modtag) $@
+cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
+ $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
+
+$(obj)/os.o: $(src)/os.c FORCE
+ $(call if_changed_dep,cc_os.o)