]>
Commit | Line | Data |
---|---|---|
5bb907a4 RM |
1 | # |
2 | # (C) Copyright 2007 | |
3 | # Stefan Roese, DENX Software Engineering, [email protected]. | |
4 | # (C) Copyright 2008 Freescale Semiconductor | |
5 | # (C) Copyright Sheldon Instruments, Inc. 2008 | |
6 | # | |
1a459660 | 7 | # SPDX-License-Identifier: GPL-2.0+ |
5bb907a4 RM |
8 | # |
9 | ||
10 | NAND_SPL := y | |
5bb907a4 RM |
11 | |
12 | include $(TOPDIR)/config.mk | |
13 | ||
3b258e2e WD |
14 | nandobj := $(OBJTREE)/nand_spl/ |
15 | ||
5bb907a4 | 16 | LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds |
6dc1eceb HW |
17 | LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \ |
18 | $(LDFLAGS) $(LDFLAGS_FINAL) | |
5bb907a4 RM |
19 | AFLAGS += -DCONFIG_NAND_SPL |
20 | CFLAGS += -DCONFIG_NAND_SPL | |
21 | ||
22 | SOBJS = start.o ticks.o | |
06f60ae3 | 23 | COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o spl_minimal.o \ |
2b6fd5c7 | 24 | time.o cache.o |
5bb907a4 RM |
25 | |
26 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) | |
27 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) | |
28 | __OBJS := $(SOBJS) $(COBJS) | |
3b258e2e | 29 | LNDIR := $(nandobj)board/$(BOARDDIR) |
5bb907a4 RM |
30 | |
31 | ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin | |
32 | ||
33 | all: $(obj).depend $(ALL) | |
34 | ||
35 | $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl | |
36 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@ | |
37 | ||
38 | $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl | |
39 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ | |
40 | ||
1aada9cd | 41 | $(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds |
767589a7 | 42 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) $(PLATFORM_LIBS) \ |
5bb907a4 RM |
43 | -Map $(nandobj)u-boot-spl.map \ |
44 | -o $(nandobj)u-boot-spl | |
45 | ||
1aada9cd WD |
46 | $(nandobj)u-boot.lds: $(LDSCRIPT) |
47 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ | |
48 | ||
5bb907a4 RM |
49 | # create symbolic links for common files |
50 | ||
51 | $(obj)start.S: | |
4b00d1aa | 52 | @rm -f $@ |
a47a12be | 53 | ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/start.S $@ |
5bb907a4 RM |
54 | |
55 | $(obj)nand_boot_fsl_elbc.c: | |
4b00d1aa WD |
56 | @rm -f $@ |
57 | ln -s $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c $@ | |
5bb907a4 RM |
58 | |
59 | $(obj)sdram.c: | |
4b00d1aa WD |
60 | @rm -f $@ |
61 | ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c $@ | |
5bb907a4 RM |
62 | |
63 | $(obj)$(BOARD).c: | |
4b00d1aa WD |
64 | @rm -f $@ |
65 | ln -s $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $@ | |
5bb907a4 RM |
66 | |
67 | $(obj)ns16550.c: | |
4b00d1aa WD |
68 | @rm -f $@ |
69 | ln -s $(SRCTREE)/drivers/serial/ns16550.c $@ | |
5bb907a4 | 70 | |
06f60ae3 | 71 | $(obj)spl_minimal.c: |
4b00d1aa | 72 | @rm -f $@ |
06f60ae3 | 73 | ln -s $(SRCTREE)/arch/powerpc/cpu/mpc83xx/spl_minimal.c $@ |
5bb907a4 | 74 | |
2b6fd5c7 | 75 | $(obj)cache.c: |
4b00d1aa | 76 | @rm -f $@ |
a47a12be | 77 | ln -s $(SRCTREE)/arch/powerpc/lib/cache.c $@ |
2b6fd5c7 | 78 | |
5bb907a4 | 79 | $(obj)time.c: |
4b00d1aa | 80 | @rm -f $@ |
a47a12be | 81 | ln -s $(SRCTREE)/arch/powerpc/lib/time.c $@ |
5bb907a4 RM |
82 | |
83 | $(obj)ticks.S: | |
4b00d1aa | 84 | @rm -f $@ |
a47a12be | 85 | ln -s $(SRCTREE)/arch/powerpc/lib/ticks.S $@ |
5bb907a4 RM |
86 | |
87 | ######################################################################### | |
88 | ||
89 | $(obj)%.o: $(obj)%.S | |
90 | $(CC) $(AFLAGS) -c -o $@ $< | |
91 | ||
92 | $(obj)%.o: $(obj)%.c | |
93 | $(CC) $(CFLAGS) -c -o $@ $< | |
94 | ||
95 | # defines $(obj).depend target | |
96 | include $(SRCTREE)/rules.mk | |
97 | ||
98 | sinclude $(obj).depend | |
99 | ||
100 | ######################################################################### |