3 # Stefan Roese, DENX Software Engineering, sr@denx.de.
4 # (C) Copyright 2008 Freescale Semiconductor
6 # SPDX-License-Identifier: GPL-2.0+
12 include $(TOPDIR)/config.mk
14 nandobj := $(OBJTREE)/nand_spl/
16 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
17 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \
18 $(LDFLAGS) $(LDFLAGS_FINAL)
19 AFLAGS += -DCONFIG_NAND_SPL
20 CFLAGS += -DCONFIG_NAND_SPL
22 SOBJS = start.o ticks.o
23 COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \
26 SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
27 OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
28 __OBJS := $(SOBJS) $(COBJS)
29 LNDIR := $(nandobj)board/$(BOARDDIR)
31 all: $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
33 $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
34 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
36 $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
37 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
39 $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
40 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \
41 -Map $(nandobj)u-boot-spl.map -o $@
43 $(nandobj)u-boot.lds: $(LDSCRIPT)
44 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
46 # create symbolic links for common files
49 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@
51 $(obj)nand_boot_fsl_elbc.c:
52 ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@
55 ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@
58 ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@
61 ln -sf $(SRCTREE)/drivers/serial/ns16550.c $@
64 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@
67 ln -sf $(SRCTREE)/arch/powerpc/lib/cache.c $@
70 ln -sf $(SRCTREE)/arch/powerpc/lib/time.c $@
73 ln -sf $(SRCTREE)/arch/powerpc/lib/ticks.S $@
75 #########################################################################
78 $(CC) $(AFLAGS) -c -o $@ $<
81 $(CC) $(CFLAGS) -c -o $@ $<
83 # defines $(obj).depend target
84 include $(SRCTREE)/rules.mk
86 sinclude $(obj).depend
88 #########################################################################