]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - nand_spl/board/freescale/p1023rds/Makefile
Merge 'u-boot-atmel/master' into 'u-boot-arm/master'
[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 LSTSCRIPT= $(nandobj)/board/$(BOARDDIR)/u-boot.lst
31 LDFLAGS := -T $(nandobj)u-boot-nand_spl.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
32                 $(LDFLAGS) $(LDFLAGS_FINAL)
33 AFLAGS  += -DCONFIG_NAND_SPL
34 CFLAGS  += -DCONFIG_NAND_SPL
35
36 SOBJS   = start.o resetvec.o
37 COBJS   = cache.o cpu_init_early.o spl_minimal.o fsl_law.o law.o \
38           nand_boot.o nand_boot_fsl_elbc.o ns16550.o tlb.o tlb_table.o
39
40 SRCS    := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
41 OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS))
42 __OBJS  := $(SOBJS) $(COBJS)
43 LNDIR   := $(nandobj)board/$(BOARDDIR)
44
45 ALL     = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
46
47 all:    $(obj).depend $(ALL)
48
49 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
50         $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
51
52 $(nandobj)u-boot-spl.bin:       $(nandobj)u-boot-spl
53         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
54
55 $(nandobj)u-boot-spl:   $(OBJS) $(nandobj)u-boot-nand_spl.lds
56         cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
57                 -Map $(nandobj)u-boot-spl.map \
58                 -o $(nandobj)u-boot-spl
59
60 # The following line expands into whole rule which generates $(LSTSCRIPT),
61 # the file containing u-boots LG-array linker section. This is included into
62 # $(LDSCRIPT). The function make_u_boot_list is defined in helper.mk file.
63 $(eval $(call make_u_boot_list, $(LSTSCRIPT), $(OBJS)))
64 $(nandobj)u-boot-nand_spl.lds: $(LDSCRIPT) $(LSTSCRIPT)
65         $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(nandobj)/board/$(BOARDDIR) \
66                 -ansi -D__ASSEMBLY__ -P - <$< >$@
67
68 # create symbolic links for common files
69
70 $(obj)cache.c:
71         @rm -f $(obj)cache.c
72         ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c
73
74 $(obj)cpu_init_early.c:
75         @rm -f $(obj)cpu_init_early.c
76         ln -sf $(SRCTREE)/$(CPUDIR)/cpu_init_early.c $(obj)cpu_init_early.c
77
78 $(obj)spl_minimal.c:
79         @rm -f $(obj)spl_minimal.c
80         ln -sf $(SRCTREE)/$(CPUDIR)/spl_minimal.c $(obj)spl_minimal.c
81
82 $(obj)fsl_law.c:
83         @rm -f $(obj)fsl_law.c
84         ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc8xxx/law.c $(obj)fsl_law.c
85
86 $(obj)law.c:
87         @rm -f $(obj)law.c
88         ln -sf $(SRCTREE)/board/$(BOARDDIR)/law.c $(obj)law.c
89
90 $(obj)nand_boot_fsl_elbc.c:
91         @rm -f $(obj)nand_boot_fsl_elbc.c
92         ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
93                $(obj)nand_boot_fsl_elbc.c
94
95 $(obj)ns16550.c:
96         @rm -f $(obj)ns16550.c
97         ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
98
99 $(obj)resetvec.S:
100         @rm -f $(obj)resetvec.S
101         ln -s $(SRCTREE)/$(CPUDIR)/resetvec.S $(obj)resetvec.S
102
103 $(obj)fixed_ivor.S:
104         @rm -f $(obj)fixed_ivor.S
105         ln -sf $(SRCTREE)/$(CPUDIR)/fixed_ivor.S $(obj)fixed_ivor.S
106
107 $(obj)start.S: $(obj)fixed_ivor.S
108         @rm -f $(obj)start.S
109         ln -sf $(SRCTREE)/$(CPUDIR)/start.S $(obj)start.S
110
111 $(obj)tlb.c:
112         @rm -f $(obj)tlb.c
113         ln -sf $(SRCTREE)/$(CPUDIR)/tlb.c $(obj)tlb.c
114
115 $(obj)tlb_table.c:
116         @rm -f $(obj)tlb_table.c
117         ln -sf $(SRCTREE)/board/$(BOARDDIR)/tlb.c $(obj)tlb_table.c
118
119 ifneq ($(OBJTREE), $(SRCTREE))
120 $(obj)nand_boot.c:
121         @rm -f $(obj)nand_boot.c
122         ln -s $(SRCTREE)/nand_spl/board/$(BOARDDIR)/nand_boot.c $(obj)nand_boot.c
123 endif
124
125 #########################################################################
126
127 $(obj)%.o:      $(obj)%.S
128         $(CC) $(AFLAGS) -c -o $@ $<
129
130 $(obj)%.o:      $(obj)%.c
131         $(CC) $(CFLAGS) -c -o $@ $<
132
133 # defines $(obj).depend target
134 include $(SRCTREE)/rules.mk
135
136 sinclude $(obj).depend
137
138 #########################################################################