blob: c1dcf05f3b6519edf868de9a10b875ae9c4727ea [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
Peter Tyserf7c67372010-04-12 22:28:11 -050015SRCS += $(SRCTREE)/arch/arm/cpu/arm1136/start.S
Magnus Lilja24f8b412009-07-04 10:31:24 +020016SRCS += $(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
Peter Tyserf7c67372010-04-12 22:28:11 -050043$(obj)%.o: $(SRCTREE)/arch/arm/cpu/arm1136/%.S
Magnus Lilja24f8b412009-07-04 10:31:24 +020044 $(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#########################################################################