3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
4 # (C) Copyright 2008 Freescale Semiconductor
6 # See file CREDITS for list of people who contributed to this
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 include $(TOPDIR)/config.mk
30 nandobj := $(OBJTREE)/nand_spl/
32 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
33 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
34 $(LDFLAGS) $(LDFLAGS_FINAL)
35 AFLAGS += -DCONFIG_NAND_SPL
36 CFLAGS += -DCONFIG_NAND_SPL
38 SOBJS = start.o ticks.o
39 COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o \
42 SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
43 OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
44 __OBJS := $(SOBJS) $(COBJS)
45 LNDIR := $(nandobj)board/$(BOARDDIR)
47 ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
49 all: $(obj).depend $(ALL)
51 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
52 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
54 $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
55 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
57 $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
58 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
59 -Map $(nandobj)u-boot-spl.map \
60 -o $(nandobj)u-boot-spl
62 $(nandobj)u-boot.lds: $(LDSCRIPT)
63 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
65 # create symbolic links for common files
68 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $(obj)start.S
70 $(obj)nand_boot_fsl_elbc.c:
71 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
72 $(obj)nand_boot_fsl_elbc.c
75 ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $(obj)sdram.c
78 ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $(obj)$(BOARD).c
81 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
84 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/nand_init.c $(obj)nand_init.c
87 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $(obj)cache.c
90 ln -sf $(SRCTREE)/arch/powerpc/lib/time.c $(obj)time.c
93 ln -sf $(SRCTREE)/arch/powerpc/lib/ticks.S $(obj)ticks.S
95 #########################################################################
98 $(CC) $(AFLAGS) -c -o $@ $<
101 $(CC) $(CFLAGS) -c -o $@ $<
103 # defines $(obj).depend target
104 include $(SRCTREE)/rules.mk
106 sinclude $(obj).depend
108 #########################################################################