]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - nand_spl/board/freescale/p1023rds/Makefile
Merge commit '7b2fac7654f7420c2787f74ec3b1540fa3b343e9'
[karo-tx-uboot.git] / nand_spl / board / freescale / p1023rds / Makefile
1 #
2 # Copyright 2010-2011 Freescale Semiconductor, Inc.
3 #
4 # See file CREDITS for list of people who contributed to this
5 # project.
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 # MA 02111-1307 USA
21 #
22 NAND_SPL := y
23 PAD_TO := 0xfff01000
24
25 include $(TOPDIR)/config.mk
26
27 nandobj := $(OBJTREE)/nand_spl/
28
29 LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds
30 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
31                 $(LDFLAGS) $(LDFLAGS_FINAL)
32 AFLAGS  += -DCONFIG_NAND_SPL
33 CFLAGS  += -DCONFIG_NAND_SPL
34
35 SOBJS   = start.o resetvec.o
36 COBJS   = cache.o cpu_init_early.o cpu_init_nand.o fsl_law.o law.o \
37           nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
38
39 SRCS    := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
40 OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS))
41 __OBJS  := $(SOBJS) $(COBJS)
42 LNDIR   := $(nandobj)board/$(BOARDDIR)
43
44 ALL     = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
45
46 all:    $(obj).depend $(ALL)
47
48 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
49         $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
50
51 $(nandobj)u-boot-spl.bin:       $(nandobj)u-boot-spl
52         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
53
54 $(nandobj)u-boot-spl:   $(OBJS) $(nandobj)u-boot-nand_spl.lds
55         cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
56                 -Map $(nandobj)u-boot-spl.map \
57                 -o $(nandobj)u-boot-spl
58
59 $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT)
60         $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
61
62 # create symbolic links for common files
63
64 $(obj)cache.c:
65         @rm -f $(obj)cache.c
66         ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c
67
68 $(obj)cpu_init_early.c:
69         @rm -f $(obj)cpu_init_early.c
70         ln -sf $(SRCTREE)/$(CPUDIR)/cpu_init_early.c $(obj)cpu_init_early.c
71
72 $(obj)cpu_init_nand.c:
73         @rm -f $(obj)cpu_init_nand.c
74         ln -sf $(SRCTREE)/$(CPUDIR)/cpu_init_nand.c $(obj)cpu_init_nand.c
75
76 $(obj)fsl_law.c:
77         @rm -f $(obj)fsl_law.c
78         ln -sf $(SRCTREE)/drivers/misc/fsl_law.c $(obj)fsl_law.c
79
80 $(obj)law.c:
81         @rm -f $(obj)law.c
82         ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $(obj)law.c
83
84 $(obj)nand_boot_fsl_elbc.c:
85         @rm -f $(obj)nand_boot_fsl_elbc.c
86         ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
87                $(obj)nand_boot_fsl_elbc.c
88
89 $(obj)ns16550.c:
90         @rm -f $(obj)ns16550.c
91         ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
92
93 $(obj)resetvec.S:
94         @rm -f $(obj)resetvec.S
95         ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
96
97 $(obj)fixed_ivor.S:
98         @rm -f $(obj)fixed_ivor.S
99         ln -sf $(SRCTREE)/$(CPUDIR)/fixed_ivor.S $(obj)fixed_ivor.S
100
101 $(obj)start.S: $(obj)fixed_ivor.S
102         @rm -f $(obj)start.S
103         ln -sf $(SRCTREE)/$(CPUDIR)/start.S $(obj)start.S
104
105 $(obj)tlb.c:
106         @rm -f $(obj)tlb.c
107         ln -sf $(SRCTREE)/$(CPUDIR)/tlb.c $(obj)tlb.c
108
109 $(obj)tlb_table.c:
110         @rm -f $(obj)tlb_table.c
111         ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $(obj)tlb_table.c
112
113 ifneq ($(OBJTREE), $(SRCTREE))
114 $(obj)nand_boot.c:
115         @rm -f $(obj)nand_boot.c
116         ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $(obj)nand_boot.c
117 endif
118
119 #########################################################################
120
121 $(obj)%.o:      $(obj)%.S
122         $(CC) $(AFLAGS) -c -o $@ $<
123
124 $(obj)%.o:      $(obj)%.c
125         $(CC) $(CFLAGS) -c -o $@ $<
126
127 # defines $(obj).depend target
128 include $(SRCTREE)/rules.mk
129
130 sinclude $(obj).depend
131
132 #########################################################################