]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - nand_spl/board/amcc/canyonlands/Makefile
Merge branch 'master' of git://git.denx.de/u-boot-spi
[karo-tx-uboot.git] / nand_spl / board / amcc / canyonlands / Makefile
1 #
2 # (C) Copyright 2008
3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
9
10 nandobj := $(OBJTREE)/nand_spl/
11
12 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
13 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
14            $(LDFLAGS_FINAL)
15 asflags-y += -DCONFIG_NAND_SPL
16 ccflags-y += -DCONFIG_NAND_SPL
17
18 SOBJS   := start.o
19 SOBJS   += init.o
20 SOBJS   += resetvec.o
21 COBJS   := ddr2_fixed.o
22 COBJS   += nand_boot.o
23 COBJS   += nand_ecc.o
24 COBJS   += ndfc.o
25
26 OBJS    := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
27 __OBJS  := $(SOBJS) $(COBJS)
28 LNDIR   := $(nandobj)board/$(BOARDDIR)
29
30 targets += $(__OBJS)
31
32 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
33
34 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
35         $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
36
37 $(nandobj)u-boot-spl.bin:       $(nandobj)u-boot-spl
38         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
39
40 $(nandobj)u-boot-spl:   $(OBJS) $(nandobj)u-boot.lds
41         cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
42                 -Map $(nandobj)u-boot-spl.map -o $@
43
44 $(nandobj)u-boot.lds: $(LDSCRIPT)
45         $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
46
47 # create symbolic links for common files
48
49 # from cpu directory
50 $(obj)/ndfc.c:
51         @rm -f $@
52         ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
53
54 $(obj)/resetvec.S:
55         @rm -f $@
56         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
57
58 $(obj)/start.S:
59         @rm -f $@
60         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
61
62 # from board directory
63 $(obj)/init.S:
64         @rm -f $@
65         ln -s $(SRCTREE)/board/amcc/canyonlands/init.S $@
66
67 # from nand_spl directory
68 $(obj)/nand_boot.c:
69         @rm -f $@
70         ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
71
72 # from drivers/mtd/nand directory
73 $(obj)/nand_ecc.c:
74         @rm -f $@
75         ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@