summaryrefslogtreecommitdiff
path: root/nand_spl
diff options
context:
space:
mode:
Diffstat (limited to 'nand_spl')
-rw-r--r--nand_spl/board/amcc/acadia/Makefile49
-rw-r--r--nand_spl/board/amcc/bamboo/Makefile49
-rw-r--r--nand_spl/board/amcc/canyonlands/Makefile49
-rw-r--r--nand_spl/board/amcc/kilauea/Makefile47
-rw-r--r--nand_spl/board/amcc/sequoia/Makefile51
-rw-r--r--nand_spl/board/freescale/mpc8315erdb/Makefile51
-rw-r--r--nand_spl/board/freescale/mpc8536ds/Makefile63
-rw-r--r--nand_spl/board/freescale/mpc8569mds/Makefile63
-rw-r--r--nand_spl/board/freescale/mpc8572ds/Makefile63
-rw-r--r--nand_spl/board/freescale/p1023rds/Makefile64
-rw-r--r--nand_spl/board/freescale/p1_p2_rdb/Makefile63
-rw-r--r--nand_spl/board/sheldon/simpc8313/Makefile52
12 files changed, 214 insertions, 450 deletions
diff --git a/nand_spl/board/amcc/acadia/Makefile b/nand_spl/board/amcc/acadia/Makefile
index 022a205..4d084b3 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,25 +12,26 @@ 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
$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
@@ -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..f975b72 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,79 +12,59 @@ 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..250f083 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,73 +23,53 @@ 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..a8d4689 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,80 +12,66 @@ 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..b0385ae 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,83 +12,69 @@ 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..f41a13a 100644
--- a/nand_spl/board/freescale/mpc8315erdb/Makefile
+++ b/nand_spl/board/freescale/mpc8315erdb/Makefile
@@ -6,83 +6,66 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..f571862 100644
--- a/nand_spl/board/freescale/mpc8536ds/Makefile
+++ b/nand_spl/board/freescale/mpc8536ds/Makefile
@@ -7,112 +7,89 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..f571862 100644
--- a/nand_spl/board/freescale/mpc8569mds/Makefile
+++ b/nand_spl/board/freescale/mpc8569mds/Makefile
@@ -7,112 +7,89 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..f571862 100644
--- a/nand_spl/board/freescale/mpc8572ds/Makefile
+++ b/nand_spl/board/freescale/mpc8572ds/Makefile
@@ -7,112 +7,89 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..b7eedcd8 100644
--- a/nand_spl/board/freescale/p1023rds/Makefile
+++ b/nand_spl/board/freescale/p1023rds/Makefile
@@ -3,111 +3,89 @@
#
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..f571862 100644
--- a/nand_spl/board/freescale/p1_p2_rdb/Makefile
+++ b/nand_spl/board/freescale/p1_p2_rdb/Makefile
@@ -7,112 +7,89 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot-nand_spl.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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..32afc27 100644
--- a/nand_spl/board/sheldon/simpc8313/Makefile
+++ b/nand_spl/board/sheldon/simpc8313/Makefile
@@ -7,91 +7,73 @@
# 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
- $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(PAD_TO) -O binary $< $@
$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
- $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $< $@
$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
-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
-
-#########################################################################