]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - nand_spl/board/amcc/kilauea/Makefile
Merge branch 'master' of git://git.denx.de/u-boot-spi
[karo-tx-uboot.git] / nand_spl / board / amcc / kilauea / Makefile
1 #
2 # (C) Copyright 2007
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 resetvec.o cache.o
19 COBJS   = 44x_spd_ddr2.o nand_boot.o nand_ecc.o ndfc.o
20
21 OBJS    := $(addprefix $(obj)/,$(SOBJS) $(COBJS))
22 __OBJS  := $(SOBJS) $(COBJS)
23 LNDIR   := $(nandobj)board/$(BOARDDIR)
24
25 targets += $(__OBJS)
26
27 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
28
29 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
30         $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
31
32 $(nandobj)u-boot-spl.bin:       $(nandobj)u-boot-spl
33         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
34
35 $(nandobj)u-boot-spl:   $(OBJS) $(nandobj)u-boot.lds
36         cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
37                 -Map $(nandobj)u-boot-spl.map -o $@
38
39 $(nandobj)u-boot.lds: $(LDSCRIPT)
40         $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
41
42 # create symbolic links for common files
43
44 # from cpu directory
45 $(obj)/44x_spd_ddr2.c: $(obj)/ecc.h
46         @rm -f $@
47         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c $@
48
49 $(obj)/cache.S:
50         @rm -f $@
51         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/cache.S $@
52
53 $(obj)/ecc.h:
54         @rm -f $@
55         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/ecc.h $@
56
57 $(obj)/ndfc.c:
58         @rm -f $@
59         ln -s $(SRCTREE)/drivers/mtd/nand/ndfc.c $@
60
61 $(obj)/resetvec.S:
62         @rm -f $@
63         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/resetvec.S $@
64
65 $(obj)/start.S:
66         @rm -f $@
67         ln -s $(SRCTREE)/arch/powerpc/cpu/ppc4xx/start.S $@
68
69 # from nand_spl directory
70 $(obj)/nand_boot.c:
71         @rm -f $@
72         ln -s $(SRCTREE)/nand_spl/nand_boot.c $@
73
74 # from drivers/nand directory
75 $(obj)/nand_ecc.c:
76         @rm -f $@
77         ln -s $(SRCTREE)/drivers/mtd/nand/nand_ecc.c $@