summaryrefslogtreecommitdiff
path: root/nand_spl/board
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-02-20 12:16:05 (GMT)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-02-20 12:16:05 (GMT)
commit3e11350255d9c5d4bd03c2a65769da84c05d3294 (patch)
tree2ebc3d0fa0592479020d2d9dc7228b4d15ed2eaa /nand_spl/board
parente7538fee991308c16f76f7eca2517089f2a30ff4 (diff)
parent0a8e823ad0c5a602c93c2e8a54caf622ade6d3fb (diff)
downloadu-boot-fsl-qoriq-3e11350255d9c5d4bd03c2a65769da84c05d3294.tar.xz
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts: Makefile drivers/net/npe/Makefile These two conflicts arise from commit 0b2d3f20 ("ARM: NET: Remove the IXP NPE ethernet driver") and are resolved by deleting the drivers/net/npe/Makefile file and removing the CONFIG_IXP4XX_NPE line from Makefile.
Diffstat (limited to 'nand_spl/board')
-rw-r--r--nand_spl/board/amcc/acadia/Makefile45
-rw-r--r--nand_spl/board/amcc/bamboo/Makefile45
-rw-r--r--nand_spl/board/amcc/canyonlands/Makefile45
-rw-r--r--nand_spl/board/amcc/kilauea/Makefile43
-rw-r--r--nand_spl/board/amcc/sequoia/Makefile47
-rw-r--r--nand_spl/board/freescale/mpc8315erdb/Makefile47
-rw-r--r--nand_spl/board/freescale/mpc8536ds/Makefile59
-rw-r--r--nand_spl/board/freescale/mpc8569mds/Makefile59
-rw-r--r--nand_spl/board/freescale/mpc8572ds/Makefile59
-rw-r--r--nand_spl/board/freescale/p1023rds/Makefile60
-rw-r--r--nand_spl/board/freescale/p1_p2_rdb/Makefile59
-rw-r--r--nand_spl/board/sheldon/simpc8313/Makefile48
12 files changed, 190 insertions, 426 deletions
diff --git a/nand_spl/board/amcc/acadia/Makefile b/nand_spl/board/amcc/acadia/Makefile
index 022a205..d256abf 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -5,7 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
nandobj := $(OBJTREE)/nand_spl/
@@ -13,17 +12,18 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
$(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o cache.o
COBJS = gpio.o nand_boot.o nand_ecc.o memory.o ndfc.o pll.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin \
$(nandobj)System.map
@@ -43,61 +43,46 @@ $(nandobj)System.map: $(nandobj)u-boot-spl
sort > $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
# from cpu directory
-$(obj)cache.S:
+$(obj)/cache.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
-$(obj)gpio.c:
+$(obj)/gpio.c:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/gpio.c $@
-$(obj)ndfc.c:
+$(obj)/ndfc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
# from board directory
-$(obj)memory.c:
+$(obj)/memory.c:
@rm -f $@
ln -s $(SRCTREE)/board/amcc/acadia/memory.c $@
-$(obj)pll.c:
+$(obj)/pll.c:
@rm -f $@
ln -s $(SRCTREE)/board/amcc/acadia/pll.c $@
# from nand_spl directory
-$(obj)nand_boot.c:
+$(obj)/nand_boot.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
# from drivers/mtd/nand directory
-$(obj)nand_ecc.c:
+$(obj)/nand_ecc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/amcc/bamboo/Makefile b/nand_spl/board/amcc/bamboo/Makefile
index d413a48..4f36d6c 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -5,7 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
nandobj := $(OBJTREE)/nand_spl/
@@ -13,17 +12,18 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
$(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o init.o resetvec.o
COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -37,55 +37,34 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
# from cpu directory
-$(obj)ndfc.c:
+$(obj)/ndfc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
# from board directory
-$(obj)init.S:
+$(obj)/init.S:
@rm -f $@
ln -s $(SRCTREE)/board/amcc/bamboo/init.S $@
# from nand_spl directory
-$(obj)nand_boot.c:
+$(obj)/nand_boot.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
# from drivers/mtd/nand directory
-$(obj)nand_ecc.c:
+$(obj)/nand_ecc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)sdram.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/sdram.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/amcc/canyonlands/Makefile b/nand_spl/board/amcc/canyonlands/Makefile
index b2ef03f..5c9c8e8 100644
--- a/nand_spl/board/amcc/canyonlands/Makefile
+++ b/nand_spl/board/amcc/canyonlands/Makefile
@@ -5,7 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
nandobj := $(OBJTREE)/nand_spl/
@@ -13,8 +12,8 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
$(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS := start.o
SOBJS += init.o
@@ -24,11 +23,12 @@ COBJS += nand_boot.o
COBJS += nand_ecc.o
COBJS += ndfc.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -42,55 +42,34 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
# from cpu directory
-$(obj)ndfc.c:
+$(obj)/ndfc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
# from board directory
-$(obj)init.S:
+$(obj)/init.S:
@rm -f $@
ln -s $(SRCTREE)/board/amcc/canyonlands/init.S $@
# from nand_spl directory
-$(obj)nand_boot.c:
+$(obj)/nand_boot.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
# from drivers/mtd/nand directory
-$(obj)nand_ecc.c:
+$(obj)/nand_ecc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)ddr2_fixed.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/ddr2_fixed.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/amcc/kilauea/Makefile b/nand_spl/board/amcc/kilauea/Makefile
index 5899b9e..cfe3082 100644
--- a/nand_spl/board/amcc/kilauea/Makefile
+++ b/nand_spl/board/amcc/kilauea/Makefile
@@ -5,7 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
nandobj := $(OBJTREE)/nand_spl/
@@ -13,17 +12,18 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
$(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o cache.o
COBJS = 44x_spd_ddr2.o nand_boot.o nand_ecc.o ndfc.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -37,56 +37,41 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
# from cpu directory
-$(obj)44x_spd_ddr2.c: $(obj)ecc.h
+$(obj)/44x_spd_ddr2.c: $(obj)/ecc.h
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c $@
-$(obj)cache.S:
+$(obj)/cache.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
-$(obj)ecc.h:
+$(obj)/ecc.h:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/ecc.h $@
-$(obj)ndfc.c:
+$(obj)/ndfc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
# from nand_spl directory
-$(obj)nand_boot.c:
+$(obj)/nand_boot.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
# from drivers/nand directory
-$(obj)nand_ecc.c:
+$(obj)/nand_ecc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/amcc/sequoia/Makefile b/nand_spl/board/amcc/sequoia/Makefile
index fea6c4e..de02886 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -5,7 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-include $(TOPDIR)/config.mk
include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
nandobj := $(OBJTREE)/nand_spl/
@@ -13,17 +12,18 @@ nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
$(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o init.o resetvec.o
COBJS = denali_data_eye.o nand_boot.o nand_ecc.o ndfc.o sdram.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -37,59 +37,44 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
# from cpu directory
-$(obj)denali_data_eye.c:
+$(obj)/denali_data_eye.c:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/denali_data_eye.c $@
-$(obj)ndfc.c:
+$(obj)/ndfc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
# from board directory
-$(obj)init.S:
+$(obj)/init.S:
@rm -f $@
ln -s $(SRCTREE)/board/amcc/sequoia/init.S $@
-$(obj)sdram.c:
+$(obj)/sdram.c:
@rm -f $@
- @rm -f $(obj)sdram.h
+ @rm -f $(obj)/sdram.h
ln -s $(SRCTREE)/board/amcc/sequoia/sdram.c $@
- ln -s $(SRCTREE)/board/amcc/sequoia/sdram.h $(obj)sdram.h
+ ln -s $(SRCTREE)/board/amcc/sequoia/sdram.h $(obj)/sdram.h
# from nand_spl directory
-$(obj)nand_boot.c:
+$(obj)/nand_boot.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
# from drivers/mtd/nand directory
-$(obj)nand_ecc.c:
+$(obj)/nand_ecc.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/mpc8315erdb/Makefile b/nand_spl/board/freescale/mpc8315erdb/Makefile
index c49a6e0..a685674 100644
--- a/nand_spl/board/freescale/mpc8315erdb/Makefile
+++ b/nand_spl/board/freescale/mpc8315erdb/Makefile
@@ -6,28 +6,26 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
PAD_TO := 0xfff04000
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o ticks.o
COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
time.o cache.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -41,48 +39,33 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
-$(obj)start.S:
+$(obj)/start.S:
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)sdram.c:
+$(obj)/sdram.c:
ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
-$(obj)$(BOARD).c:
+$(obj)/$(BOARD).c:
ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
-$(obj)cache.c:
+$(obj)/cache.c:
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)time.c:
+$(obj)/time.c:
ln -sf $(SRCTREE)/arch/powerpc/lib/time.c $@
-$(obj)ticks.S:
+$(obj)/ticks.S:
ln -sf $(SRCTREE)/arch/powerpc/lib/ticks.S $@
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/mpc8536ds/Makefile b/nand_spl/board/freescale/mpc8536ds/Makefile
index 6233081..f0beaed 100644
--- a/nand_spl/board/freescale/mpc8536ds/Makefile
+++ b/nand_spl/board/freescale/mpc8536ds/Makefile
@@ -7,29 +7,27 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
PAD_TO := 0xfff01000
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o
COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -43,76 +41,55 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-ansi -D__ASSEMBLY__ -P - <$< >$@
# create symbolic links for common files
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)cpu_init_early.c:
+$(obj)/cpu_init_early.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
-$(obj)fsl_law.c:
+$(obj)/fsl_law.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
-$(obj)law.c:
+$(obj)/law.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
-$(obj)fixed_ivor.S:
+$(obj)/fixed_ivor.S:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
-$(obj)start.S: $(obj)fixed_ivor.S
+$(obj)/start.S: $(obj)/fixed_ivor.S
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
-$(obj)tlb.c:
+$(obj)/tlb.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
-$(obj)tlb_table.c:
+$(obj)/tlb_table.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)nand_boot.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/mpc8569mds/Makefile b/nand_spl/board/freescale/mpc8569mds/Makefile
index 6233081..f0beaed 100644
--- a/nand_spl/board/freescale/mpc8569mds/Makefile
+++ b/nand_spl/board/freescale/mpc8569mds/Makefile
@@ -7,29 +7,27 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
PAD_TO := 0xfff01000
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o
COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -43,76 +41,55 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-ansi -D__ASSEMBLY__ -P - <$< >$@
# create symbolic links for common files
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)cpu_init_early.c:
+$(obj)/cpu_init_early.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
-$(obj)fsl_law.c:
+$(obj)/fsl_law.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
-$(obj)law.c:
+$(obj)/law.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
-$(obj)fixed_ivor.S:
+$(obj)/fixed_ivor.S:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
-$(obj)start.S: $(obj)fixed_ivor.S
+$(obj)/start.S: $(obj)/fixed_ivor.S
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
-$(obj)tlb.c:
+$(obj)/tlb.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
-$(obj)tlb_table.c:
+$(obj)/tlb_table.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)nand_boot.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/mpc8572ds/Makefile b/nand_spl/board/freescale/mpc8572ds/Makefile
index 6233081..f0beaed 100644
--- a/nand_spl/board/freescale/mpc8572ds/Makefile
+++ b/nand_spl/board/freescale/mpc8572ds/Makefile
@@ -7,29 +7,27 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
PAD_TO := 0xfff01000
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o
COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -43,76 +41,55 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-ansi -D__ASSEMBLY__ -P - <$< >$@
# create symbolic links for common files
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)cpu_init_early.c:
+$(obj)/cpu_init_early.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
-$(obj)fsl_law.c:
+$(obj)/fsl_law.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
-$(obj)law.c:
+$(obj)/law.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
-$(obj)fixed_ivor.S:
+$(obj)/fixed_ivor.S:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
-$(obj)start.S: $(obj)fixed_ivor.S
+$(obj)/start.S: $(obj)/fixed_ivor.S
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
-$(obj)tlb.c:
+$(obj)/tlb.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
-$(obj)tlb_table.c:
+$(obj)/tlb_table.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)nand_boot.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/p1023rds/Makefile b/nand_spl/board/freescale/p1023rds/Makefile
index dbdfa19..3918ac5 100644
--- a/nand_spl/board/freescale/p1023rds/Makefile
+++ b/nand_spl/board/freescale/p1023rds/Makefile
@@ -3,28 +3,27 @@
#
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
-PAD_TO := 0xfff01000
-include $(TOPDIR)/config.mk
+PAD_TO := 0xfff01000
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o
COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -38,76 +37,55 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-ansi -D__ASSEMBLY__ -P - <$< >$@
# create symbolic links for common files
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)cpu_init_early.c:
+$(obj)/cpu_init_early.c:
@rm -f $@
ln -sf $(SRCTREE)/$(CPUDIR)/cpu_init_early.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -sf $(SRCTREE)/$(CPUDIR)/spl_minimal.c $@
-$(obj)fsl_law.c:
+$(obj)/fsl_law.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
-$(obj)law.c:
+$(obj)/law.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
-$(obj)fixed_ivor.S:
+$(obj)/fixed_ivor.S:
@rm -f $@
ln -sf $(SRCTREE)/$(CPUDIR)/fixed_ivor.S $@
-$(obj)start.S: $(obj)fixed_ivor.S
+$(obj)/start.S: $(obj)/fixed_ivor.S
@rm -f $@
ln -sf $(SRCTREE)/$(CPUDIR)/start.S $@
-$(obj)tlb.c:
+$(obj)/tlb.c:
@rm -f $@
ln -sf $(SRCTREE)/$(CPUDIR)/tlb.c $@
-$(obj)tlb_table.c:
+$(obj)/tlb_table.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)nand_boot.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/freescale/p1_p2_rdb/Makefile b/nand_spl/board/freescale/p1_p2_rdb/Makefile
index 6233081..f0beaed 100644
--- a/nand_spl/board/freescale/p1_p2_rdb/Makefile
+++ b/nand_spl/board/freescale/p1_p2_rdb/Makefile
@@ -7,29 +7,27 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
CONFIG_SYS_TEXT_BASE_SPL := 0xfff00000
PAD_TO := 0xfff01000
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o resetvec.o
COBJS = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -43,76 +41,55 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
-ansi -D__ASSEMBLY__ -P - <$< >$@
# create symbolic links for common files
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)cpu_init_early.c:
+$(obj)/cpu_init_early.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/cpu_init_early.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/spl_minimal.c $@
-$(obj)fsl_law.c:
+$(obj)/fsl_law.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $@
-$(obj)law.c:
+$(obj)/law.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)resetvec.S:
+$(obj)/resetvec.S:
@rm -f $@
ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $@
-$(obj)fixed_ivor.S:
+$(obj)/fixed_ivor.S:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/fixed_ivor.S $@
-$(obj)start.S: $(obj)fixed_ivor.S
+$(obj)/start.S: $(obj)/fixed_ivor.S
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/start.S $@
-$(obj)tlb.c:
+$(obj)/tlb.c:
@rm -f $@
ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/tlb.c $@
-$(obj)tlb_table.c:
+$(obj)/tlb_table.c:
@rm -f $@
ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $@
-
-ifneq ($(OBJTREE), $(SRCTREE))
-$(obj)nand_boot.c:
- @rm -f $@
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $@
-endif
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/nand_spl/board/sheldon/simpc8313/Makefile b/nand_spl/board/sheldon/simpc8313/Makefile
index 90f132c..35b1f97 100644
--- a/nand_spl/board/sheldon/simpc8313/Makefile
+++ b/nand_spl/board/sheldon/simpc8313/Makefile
@@ -7,27 +7,24 @@
# SPDX-License-Identifier: GPL-2.0+
#
-NAND_SPL := y
-
-include $(TOPDIR)/config.mk
-
nandobj := $(OBJTREE)/nand_spl/
LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
$(LDFLAGS) $(LDFLAGS_FINAL)
-AFLAGS += -DCONFIG_NAND_SPL
-CFLAGS += -DCONFIG_NAND_SPL
+asflags-y += -DCONFIG_NAND_SPL
+ccflags-y += -DCONFIG_NAND_SPL
SOBJS = start.o ticks.o
COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
time.o cache.o
-SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
__OBJS := $(SOBJS) $(COBJS)
LNDIR := $(nandobj)board/$(BOARDDIR)
+targets += $(__OBJS)
+
all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
@@ -41,57 +38,42 @@ $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
-Map $(nandobj)u-boot-spl.map -o $@
$(nandobj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+ $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
# create symbolic links for common files
-$(obj)start.S:
+$(obj)/start.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
-$(obj)nand_boot_fsl_elbc.c:
+$(obj)/nand_boot_fsl_elbc.c:
@rm -f $@
ln -s $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
-$(obj)sdram.c:
+$(obj)/sdram.c:
@rm -f $@
ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
-$(obj)$(BOARD).c:
+$(obj)/$(BOARD).c:
@rm -f $@
ln -s $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
-$(obj)ns16550.c:
+$(obj)/ns16550.c:
@rm -f $@
ln -s $(SRCTREE)/drivers/serial/ns16550.c $@
-$(obj)spl_minimal.c:
+$(obj)/spl_minimal.c:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
-$(obj)cache.c:
+$(obj)/cache.c:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/lib/cache.c $@
-$(obj)time.c:
+$(obj)/time.c:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/lib/time.c $@
-$(obj)ticks.S:
+$(obj)/ticks.S:
@rm -f $@
ln -s $(SRCTREE)/arch/powerpc/lib/ticks.S $@
-
-#########################################################################
-
-$(obj)%.o: $(obj)%.S
- $(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o: $(obj)%.c
- $(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################