blob: ba31b3612313071fb6ea13dff52898a3f0660cdc [file] [log] [blame]
Magnus Lilja24f8b412009-07-04 10:31:24 +02001CONFIG_NAND_SPL = y
2
3include $(TOPDIR)/config.mk
4include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
5
6LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
Haiying Wang39358732011-02-22 16:38:05 -05007LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
8 $(LDFLAGS_FINAL)
Magnus Lilja24f8b412009-07-04 10:31:24 +02009AFLAGS += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
10CFLAGS += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
11
12SOBJS = start.o lowlevel_init.o
13COBJS = nand_boot_fsl_nfc.o
14
15SRCS := $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
Peter Tyserf7c67372010-04-12 22:28:11 -050016SRCS += $(SRCTREE)/arch/arm/cpu/arm1136/start.S
Magnus Lilja24f8b412009-07-04 10:31:24 +020017SRCS += $(SRCTREE)/board/freescale/mx31pdk/lowlevel_init.S
18OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
19__OBJS := $(SOBJS) $(COBJS)
20LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
21
22nandobj := $(OBJTREE)/nand_spl/
23
24ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
25
26all: $(obj).depend $(ALL)
27
28$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
29 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
30
31$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
32 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
33
Wolfgang Denk18d46c02009-08-17 14:00:53 +020034$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
Magnus Lilja24f8b412009-07-04 10:31:24 +020035 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
36 -Map $(nandobj)u-boot-spl.map \
37 -o $@
38
Wolfgang Denk18d46c02009-08-17 14:00:53 +020039$(nandobj)u-boot.lds: $(LDSCRIPT)
40 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
41
Magnus Lilja24f8b412009-07-04 10:31:24 +020042#########################################################################
43
Peter Tyserf7c67372010-04-12 22:28:11 -050044$(obj)%.o: $(SRCTREE)/arch/arm/cpu/arm1136/%.S
Magnus Lilja24f8b412009-07-04 10:31:24 +020045 $(CC) $(AFLAGS) -c -o $@ $<
46
47$(obj)%.o: $(SRCTREE)/board/freescale/mx31pdk/%.S
48 $(CC) $(AFLAGS) -c -o $@ $<
49
50$(obj)%.o: $(SRCTREE)/nand_spl/%.c
51 $(CC) $(CFLAGS) -c -o $@ $<
52
53# defines $(obj).depend target
54include $(SRCTREE)/rules.mk
55
56sinclude $(obj).depend
57
58#########################################################################