blob: 0e13d5de2607552b45d074386e30948adca826fb [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
Wolfgang Denk18d46c02009-08-17 14:00:53 +02007LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
Magnus Lilja24f8b412009-07-04 10:31:24 +02008AFLAGS += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
9CFLAGS += -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
10
11SOBJS = start.o lowlevel_init.o
12COBJS = nand_boot_fsl_nfc.o
13
14SRCS := $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
15SRCS += $(SRCTREE)/cpu/arm1136/start.S
16SRCS += $(SRCTREE)/board/freescale/mx31pdk/lowlevel_init.S
17OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
18__OBJS := $(SOBJS) $(COBJS)
19LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
20
21nandobj := $(OBJTREE)/nand_spl/
22
23ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
24
25all: $(obj).depend $(ALL)
26
27$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
28 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
29
30$(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
31 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
32
Wolfgang Denk18d46c02009-08-17 14:00:53 +020033$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds
Magnus Lilja24f8b412009-07-04 10:31:24 +020034 cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
35 -Map $(nandobj)u-boot-spl.map \
36 -o $@
37
Wolfgang Denk18d46c02009-08-17 14:00:53 +020038$(nandobj)u-boot.lds: $(LDSCRIPT)
39 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
40
Magnus Lilja24f8b412009-07-04 10:31:24 +020041#########################################################################
42
43$(obj)%.o: $(SRCTREE)/cpu/arm1136/%.S
44 $(CC) $(AFLAGS) -c -o $@ $<
45
46$(obj)%.o: $(SRCTREE)/board/freescale/mx31pdk/%.S
47 $(CC) $(AFLAGS) -c -o $@ $<
48
49$(obj)%.o: $(SRCTREE)/nand_spl/%.c
50 $(CC) $(CFLAGS) -c -o $@ $<
51
52# defines $(obj).depend target
53include $(SRCTREE)/rules.mk
54
55sinclude $(obj).depend
56
57#########################################################################