2010-10-16 19:32:11 +00:00
|
|
|
|
2010-03-07 22:35:48 +00:00
|
|
|
include $(TOPDIR)/config.mk
|
2010-10-16 19:32:11 +00:00
|
|
|
include $(TOPDIR)/board/$(BOARDDIR)/config.mk
|
2010-03-07 22:35:48 +00:00
|
|
|
|
|
|
|
LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
|
2010-10-07 19:51:12 +00:00
|
|
|
LDFLAGS = -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
|
2010-03-07 22:35:48 +00:00
|
|
|
AFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
|
|
|
|
CFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
|
|
|
|
OBJCFLAGS += --gap-fill=0x00
|
|
|
|
|
|
|
|
SOBJS += start.o
|
|
|
|
COBJS := vpac270.o
|
|
|
|
COBJS += onenand_read.o
|
|
|
|
COBJS += onenand_boot.o
|
|
|
|
|
|
|
|
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
|
|
|
|
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
|
|
|
|
__OBJS := $(SOBJS) $(COBJS)
|
|
|
|
LNDIR := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR)
|
|
|
|
|
|
|
|
onenandobj := $(OBJTREE)/onenand_ipl/
|
|
|
|
|
|
|
|
ALL = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin
|
|
|
|
|
|
|
|
all: $(obj).depend $(ALL)
|
|
|
|
|
|
|
|
$(onenandobj)onenand-ipl-2k.bin: $(onenandobj)onenand-ipl
|
2010-10-16 19:32:11 +00:00
|
|
|
$(OBJCOPY) ${OBJCFLAGS} --pad-to=0x0800 -O binary $< $@
|
2010-03-07 22:35:48 +00:00
|
|
|
|
|
|
|
$(onenandobj)onenand-ipl.bin: $(onenandobj)onenand-ipl
|
|
|
|
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
|
|
|
|
|
|
|
|
$(onenandobj)onenand-ipl: $(OBJS) $(onenandobj)u-boot.lds
|
|
|
|
cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
|
|
|
|
-Map $@.map -o $@
|
|
|
|
|
|
|
|
$(onenandobj)u-boot.lds: $(LDSCRIPT)
|
|
|
|
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
|
|
|
|
|
|
|
|
# create symbolic links from common files
|
|
|
|
|
|
|
|
# from cpu directory
|
|
|
|
$(obj)start.S:
|
|
|
|
@rm -f $@
|
|
|
|
ln -s $(SRCTREE)/$(CPUDIR)/start.S $@
|
|
|
|
|
|
|
|
# from onenand_ipl directory
|
|
|
|
$(obj)onenand_ipl.h:
|
|
|
|
@rm -f $@
|
|
|
|
ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $@
|
|
|
|
|
|
|
|
$(obj)onenand_boot.c: $(obj)onenand_ipl.h
|
|
|
|
@rm -f $@
|
|
|
|
ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $@
|
|
|
|
|
|
|
|
$(obj)onenand_read.c: $(obj)onenand_ipl.h
|
|
|
|
@rm -f $@
|
|
|
|
ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $@
|
|
|
|
|
|
|
|
ifneq ($(OBJTREE), $(SRCTREE))
|
|
|
|
$(obj)vpac270.c:
|
|
|
|
@rm -f $@
|
|
|
|
ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/vpac270.c $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
|
|
|
$(obj)%.o: $(obj)%.S
|
|
|
|
$(CC) $(AFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(obj)%.o: $(obj)$.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
# defines $(obj).depend target
|
|
|
|
include $(SRCTREE)/rules.mk
|
|
|
|
|
|
|
|
sinclude $(obj).depend
|
|
|
|
|
|
|
|
#########################################################################
|