cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
$(ONENAND_IPL): $(VERSION_FILE) $(obj)include/autoconf.mk
- $(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
+ $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
- $(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
apollon_config : unconfig
@mkdir -p $(obj)include
+ @mkdir -p $(obj)onenand_ipl/board/apollon
@echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
@$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
include $(TOPDIR)/config.mk
-include $(TOPDIR)/include/config.mk
include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
CFLAGS += -DCONFIG_ONENAND_IPL
OBJCLFAGS += --gap-fill=0x00
-SOBJS = start.o low_levelinit.o
-COBJS = apollon.o onenand_read.o onenand_boot.o
+SOBJS := low_levelinit.o
+SOBJS += start.o
+COBJS := apollon.o
+COBJS += onenand_read.o
+COBJS += onenand_boot.o
SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
$(onenandobj)onenand-ipl: $(OBJS)
cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
- -Map $(onenandobj)onenand-ipl.map \
- -o $(onenandobj)onenand-ipl
+ -Map $@.map -o $@
# create symbolic links from common files
# from cpu directory
$(obj)start.S:
- rm -f $(obj)start.S
- ln -s $(SRCTREE)/cpu/$(CPU)/start.S $(obj)start.S
+ @rm -f $@
+ ln -s $(SRCTREE)/cpu/$(CPU)/start.S $@
# from onenand_ipl directory
$(obj)onenand_ipl.h:
- rm -f $(obj)onenand_ipl.h
- ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $(obj)onenand_ipl.h
+ @rm -f $@
+ ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $@
$(obj)onenand_boot.c: $(obj)onenand_ipl.h
- rm -f $(obj)onenand_boot.c
- ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $(obj)onenand_boot.c
+ @rm -f $@
+ ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $@
$(obj)onenand_read.c: $(obj)onenand_ipl.h
- rm -f $(obj)onenand_read.c
- ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $(obj)onenand_read.c
+ @rm -f $@
+ ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $@
+
+ifneq ($(OBJTREE), $(SRCTREE))
+$(obj)apollon.c:
+ @rm -f $@
+ ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/apollon.c $@
+
+$(obj)low_levelinit.S:
+ @rm -f $@
+ ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/low_levelinit.S $@
+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
+
+#########################################################################