Marek Vasut | 1e84758 | 2010-03-07 23:35:48 +0100 | [diff] [blame] | 1 | IPL =onenand_ipl |
| 2 | include $(TOPDIR)/config.mk |
| 3 | |
| 4 | LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds |
Wolfgang Denk | 0708bc6 | 2010-10-07 21:51:12 +0200 | [diff] [blame^] | 5 | LDFLAGS = -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS) |
Marek Vasut | 1e84758 | 2010-03-07 23:35:48 +0100 | [diff] [blame] | 6 | AFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL |
| 7 | CFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL |
| 8 | OBJCFLAGS += --gap-fill=0x00 |
| 9 | |
| 10 | SOBJS := lowlevel_init.o |
| 11 | SOBJS += start.o |
| 12 | COBJS := vpac270.o |
| 13 | COBJS += onenand_read.o |
| 14 | COBJS += onenand_boot.o |
| 15 | |
| 16 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 17 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 18 | __OBJS := $(SOBJS) $(COBJS) |
| 19 | LNDIR := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR) |
| 20 | |
| 21 | onenandobj := $(OBJTREE)/onenand_ipl/ |
| 22 | |
| 23 | ALL = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin |
| 24 | |
| 25 | all: $(obj).depend $(ALL) |
| 26 | |
| 27 | $(onenandobj)onenand-ipl-2k.bin: $(onenandobj)onenand-ipl |
| 28 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x5c040400 -O binary $< $@ |
| 29 | |
| 30 | $(onenandobj)onenand-ipl.bin: $(onenandobj)onenand-ipl |
| 31 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 32 | |
| 33 | $(onenandobj)onenand-ipl: $(OBJS) $(onenandobj)u-boot.lds |
| 34 | cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ |
| 35 | -Map $@.map -o $@ |
| 36 | |
| 37 | $(onenandobj)u-boot.lds: $(LDSCRIPT) |
| 38 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 39 | |
| 40 | # create symbolic links from common files |
| 41 | |
| 42 | # from cpu directory |
| 43 | $(obj)start.S: |
| 44 | @rm -f $@ |
| 45 | ln -s $(SRCTREE)/$(CPUDIR)/start.S $@ |
| 46 | |
| 47 | # from onenand_ipl directory |
| 48 | $(obj)onenand_ipl.h: |
| 49 | @rm -f $@ |
| 50 | ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $@ |
| 51 | |
| 52 | $(obj)onenand_boot.c: $(obj)onenand_ipl.h |
| 53 | @rm -f $@ |
| 54 | ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $@ |
| 55 | |
| 56 | $(obj)onenand_read.c: $(obj)onenand_ipl.h |
| 57 | @rm -f $@ |
| 58 | ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $@ |
| 59 | |
| 60 | ifneq ($(OBJTREE), $(SRCTREE)) |
| 61 | $(obj)vpac270.c: |
| 62 | @rm -f $@ |
| 63 | ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/vpac270.c $@ |
| 64 | |
| 65 | $(obj)lowlevel_init.S: |
| 66 | @rm -f $@ |
| 67 | ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/lowlevel_init.S $@ |
| 68 | endif |
| 69 | |
| 70 | ######################################################################### |
| 71 | |
| 72 | $(obj)%.o: $(obj)%.S |
| 73 | $(CC) $(AFLAGS) -c -o $@ $< |
| 74 | |
| 75 | $(obj)%.o: $(obj)$.c |
| 76 | $(CC) $(CFLAGS) -c -o $@ $< |
| 77 | |
| 78 | # defines $(obj).depend target |
| 79 | include $(SRCTREE)/rules.mk |
| 80 | |
| 81 | sinclude $(obj).depend |
| 82 | |
| 83 | ######################################################################### |