[U-Boot-Users] [PATCH] nand_spl: clean up Makefile
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Thu Jul 31 15:15:06 CEST 2008
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
need Scott Wood patch * NAND: $(obj)-qualify ecc.h in kilauea NAND boot Makefile.
nand_spl/board/amcc/acadia/Makefile | 51 ++++++++++++++++------------
nand_spl/board/amcc/bamboo/Makefile | 39 ++++++++++++----------
nand_spl/board/amcc/canyonlands/Makefile | 34 ++++++++++----------
nand_spl/board/amcc/kilauea/Makefile | 45 ++++++++++++++-----------
nand_spl/board/amcc/sequoia/Makefile | 52 +++++++++++++++++------------
5 files changed, 123 insertions(+), 98 deletions(-)
diff --git a/nand_spl/board/amcc/acadia/Makefile b/nand_spl/board/amcc/acadia/Makefile
index 931f04b..23f76be 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -29,8 +29,15 @@ LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -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
+SOBJS := cache.o
+SOBJS += resetvec.o
+SOBJS += start.o
+COBJS := gpio.o
+COBJS += memory.o
+COBJS += nand_boot.o
+COBJS += nand_ecc.o
+COBJS += ndfc.o
+COBJS += pll.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -53,54 +60,54 @@ $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
$(nandobj)u-boot-spl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-Map $(nandobj)u-boot-spl.map \
- -o $(nandobj)u-boot-spl
+ -o $@
$(nandobj)System.map: $(nandobj)u-boot-spl
@$(NM) $< | \
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
- sort > $(nandobj)System.map
+ sort > $@
# create symbolic links for common files
# from cpu directory
$(obj)cache.S:
- @rm -f $(obj)cache.S
- ln -s $(SRCTREE)/cpu/ppc4xx/cache.S $(obj)cache.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/cache.S $@
$(obj)gpio.c:
- @rm -f $(obj)gpio.c
- ln -s $(SRCTREE)/cpu/ppc4xx/gpio.c $(obj)gpio.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/gpio.c $@
$(obj)ndfc.c:
- @rm -f $(obj)ndfc.c
- ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $(obj)ndfc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $@
$(obj)resetvec.S:
- @rm -f $(obj)resetvec.S
- ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $(obj)resetvec.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $@
$(obj)start.S:
- @rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/ppc4xx/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/start.S $@
# from board directory
$(obj)memory.c:
- @rm -f $(obj)memory.c
- ln -s $(SRCTREE)/board/amcc/acadia/memory.c $(obj)memory.c
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/memory.c $@
$(obj)pll.c:
- @rm -f $(obj)pll.c
- ln -s $(SRCTREE)/board/amcc/acadia/pll.c $(obj)pll.c
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/pll.c $@
# from nand_spl directory
$(obj)nand_boot.c:
- @rm -f $(obj)nand_boot.c
- ln -s $(SRCTREE)/nand_spl/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:
- @rm -f $(obj)nand_ecc.c
- ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
#########################################################################
diff --git a/nand_spl/board/amcc/bamboo/Makefile b/nand_spl/board/amcc/bamboo/Makefile
index e1c1467..14b55e6 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -29,8 +29,13 @@ LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL
-SOBJS = start.o init.o resetvec.o
-COBJS = nand_boot.o nand_ecc.o ndfc.o sdram.o
+SOBJS := init.o
+SOBJS += resetvec.o
+SOBJS += start.o
+COBJS := nand_boot.o
+COBJS += nand_ecc.o
+COBJS += ndfc.o
+COBJS += sdram.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -52,42 +57,42 @@ $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
$(nandobj)u-boot-spl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-Map $(nandobj)u-boot-spl.map \
- -o $(nandobj)u-boot-spl
+ -o $@
# create symbolic links for common files
# from cpu directory
$(obj)ndfc.c:
- @rm -f $(obj)ndfc.c
- ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $(obj)ndfc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $@
$(obj)resetvec.S:
- @rm -f $(obj)resetvec.S
- ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $(obj)resetvec.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $@
$(obj)start.S:
- @rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/ppc4xx/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/start.S $@
# from board directory
$(obj)init.S:
- @rm -f $(obj)init.S
- ln -s $(SRCTREE)/board/amcc/bamboo/init.S $(obj)init.S
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/init.S $@
# from nand_spl directory
$(obj)nand_boot.c:
- @rm -f $(obj)nand_boot.c
- ln -s $(SRCTREE)/nand_spl/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:
- @rm -f $(obj)nand_ecc.c
- ln -s $(SRCTREE)/drivers/mtd/nand/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 $(obj)sdram.c
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/sdram.c $(obj)sdram.c
+ @rm -f $@
+ ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/sdram.c $@
endif
#########################################################################
diff --git a/nand_spl/board/amcc/canyonlands/Makefile b/nand_spl/board/amcc/canyonlands/Makefile
index fb86752..620382b 100644
--- a/nand_spl/board/amcc/canyonlands/Makefile
+++ b/nand_spl/board/amcc/canyonlands/Makefile
@@ -29,9 +29,9 @@ LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL
-SOBJS := start.o
-SOBJS += init.o
+SOBJS := init.o
SOBJS += resetvec.o
+SOBJS += start.o
COBJS := ddr2_fixed.o
COBJS += nand_boot.o
COBJS += nand_ecc.o
@@ -57,42 +57,42 @@ $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
$(nandobj)u-boot-spl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-Map $(nandobj)u-boot-spl.map \
- -o $(nandobj)u-boot-spl
+ -o $@
# create symbolic links for common files
# from cpu directory
$(obj)ndfc.c:
- @rm -f $(obj)ndfc.c
- ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $(obj)ndfc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $@
$(obj)resetvec.S:
- @rm -f $(obj)resetvec.S
- ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $(obj)resetvec.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $@
$(obj)start.S:
- @rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/ppc4xx/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/start.S $@
# from board directory
$(obj)init.S:
- @rm -f $(obj)init.S
- ln -s $(SRCTREE)/board/amcc/canyonlands/init.S $(obj)init.S
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/init.S $@
# from nand_spl directory
$(obj)nand_boot.c:
- @rm -f $(obj)nand_boot.c
- ln -s $(SRCTREE)/nand_spl/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:
- @rm -f $(obj)nand_ecc.c
- ln -s $(SRCTREE)/drivers/mtd/nand/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 $(obj)ddr2_fixed.c
- ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/ddr2_fixed.c $(obj)ddr2_fixed.c
+ @rm -f $@
+ ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/ddr2_fixed.c $@
endif
#########################################################################
diff --git a/nand_spl/board/amcc/kilauea/Makefile b/nand_spl/board/amcc/kilauea/Makefile
index cedc8e0..778198d 100644
--- a/nand_spl/board/amcc/kilauea/Makefile
+++ b/nand_spl/board/amcc/kilauea/Makefile
@@ -29,8 +29,13 @@ LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -DCONFIG_NAND_SPL
-SOBJS = start.o resetvec.o cache.o
-COBJS = 44x_spd_ddr2.o nand_boot.o nand_ecc.o ndfc.o
+SOBJS := cache.o
+SOBJS += resetvec.o
+SOBJS += start.o
+COBJS := 44x_spd_ddr2.o
+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))
@@ -52,44 +57,44 @@ $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
$(nandobj)u-boot-spl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-Map $(nandobj)u-boot-spl.map \
- -o $(nandobj)u-boot-spl
+ -o $@
# create symbolic links for common files
# from cpu directory
$(obj)44x_spd_ddr2.c: $(obj)ecc.h
- @rm -f $(obj)44x_spd_ddr2.c
- ln -s $(SRCTREE)/cpu/ppc4xx/44x_spd_ddr2.c $(obj)44x_spd_ddr2.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/44x_spd_ddr2.c $@
$(obj)cache.S:
- @rm -f $(obj)cache.S
- ln -s $(SRCTREE)/cpu/ppc4xx/cache.S $(obj)cache.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/cache.S $@
$(obj)ecc.h:
- @rm -f $(obj)ecc.h
- ln -s $(SRCTREE)/cpu/ppc4xx/ecc.h $(obj)ecc.h
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ecc.h $@
$(obj)ndfc.c:
- @rm -f $(obj)ndfc.c
- ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $(obj)ndfc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $@
$(obj)resetvec.S:
- @rm -f $(obj)resetvec.S
- ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $(obj)resetvec.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $@
$(obj)start.S:
- @rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/ppc4xx/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/start.S $@
# from nand_spl directory
$(obj)nand_boot.c:
- @rm -f $(obj)nand_boot.c
- ln -s $(SRCTREE)/nand_spl/nand_boot.c $(obj)nand_boot.c
+ @rm -f $@
+ ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
-# from drivers/nand directory
+# from drivers/mtd/nand directory
$(obj)nand_ecc.c:
- @rm -f $(obj)nand_ecc.c
- ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
#########################################################################
diff --git a/nand_spl/board/amcc/sequoia/Makefile b/nand_spl/board/amcc/sequoia/Makefile
index fba0322..533cded 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -29,8 +29,14 @@ LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_NAND_SPL
CFLAGS += -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
+SOBJS := init.o
+SOBJS += resetvec.o
+SOBJS += start.o
+COBJS := denali_data_eye.o
+COBJS += nand_boot.o
+COBJS += nand_ecc.o
+COBJS += ndfc.o
+COBJS += sdram.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -52,47 +58,49 @@ $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
$(nandobj)u-boot-spl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-Map $(nandobj)u-boot-spl.map \
- -o $(nandobj)u-boot-spl
+ -o $@
# create symbolic links for common files
# from cpu directory
$(obj)denali_data_eye.c:
- @rm -f $(obj)denali_data_eye.c
- ln -s $(SRCTREE)/cpu/ppc4xx/denali_data_eye.c $(obj)denali_data_eye.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/denali_data_eye.c $@
$(obj)ndfc.c:
- @rm -f $(obj)ndfc.c
- ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $(obj)ndfc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/ndfc.c $@
$(obj)resetvec.S:
- @rm -f $(obj)resetvec.S
- ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $(obj)resetvec.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/resetvec.S $@
$(obj)start.S:
- @rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/ppc4xx/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/ppc4xx/start.S $@
# from board directory
$(obj)init.S:
- @rm -f $(obj)init.S
- ln -s $(SRCTREE)/board/amcc/sequoia/init.S $(obj)init.S
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/init.S $@
-$(obj)sdram.c:
- @rm -f $(obj)sdram.c
- @rm -f $(obj)sdram.h
- ln -s $(SRCTREE)/board/amcc/sequoia/sdram.c $(obj)sdram.c
- ln -s $(SRCTREE)/board/amcc/sequoia/sdram.h $(obj)sdram.h
+$(obj)sdram.h:
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/sdram.h $@
+
+$(obj)sdram.c: $(obj)sdram.h
+ @rm -f $@
+ ln -s $(SRCTREE)/board/amcc/$(BOARDDIR)/sdram.c $@
# from nand_spl directory
$(obj)nand_boot.c:
- @rm -f $(obj)nand_boot.c
- ln -s $(SRCTREE)/nand_spl/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:
- @rm -f $(obj)nand_ecc.c
- ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $(obj)nand_ecc.c
+ @rm -f $@
+ ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@
#########################################################################
--
1.5.6
More information about the U-Boot
mailing list