[U-Boot] [RFC 3/5] Add NAND SPL entries to gitignore.

Magnus Lilja lilja.magnus at gmail.com
Mon Apr 6 20:52:28 CEST 2009


Hi

>>> +++ b/nand_spl/.gitignore
>>> @@ -0,0 +1,7 @@
>>> +# NAND-SPL files
>>> +/u-boot-spl
>>> +/u-boot-spl-aligned.bin
>>> +/u-boot-spl.bin
>>> +/u-boot-spl.map
>>> +/board/imx31_phycore/nand_boot_mx31.c
>>> +/board/imx31_phycore/*.S
>>
>> Hmm, can we create a directory for board-specific temporary files to go, so
>> we don't need board-specific stuff in .gitignore?
>>
>> Or better, add some makefile rules so we can produce nand_spl versions of .o
>> files without having to symlink the source anywhere.
>
> Sounds like a good idea. I have one solution for this now, I'll see if
> there's a better one before posting a suggestion tomorrow evening.

Ok, I have an updated nand_spl/board/freescale/mx31pdk/Makefile below.
It works for both in-tree and out of tree builds. I'm not particularly
happy with the "$(obj)%.o: $(SRCTREE)..." lines but I couldn't make it
work otherwise. Perhaps someone has a better solution.

I know gmail will mangle at least one long line, but I'll update my
patch series later as well.

Thanks, Magnus

--- /dev/null	2009-04-06 20:44:51.328125000 +0200
+++ Makefile	2009-04-06 20:43:55.687500000 +0200
@@ -0,0 +1,54 @@
+CONFIG_NAND_SPL	= y
+
+include $(TOPDIR)/config.mk
+include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
+
+LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDFLAGS	= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
+AFLAGS	+= -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_NAND_SPL
+
+SOBJS	= start.o lowlevel_init.o
+COBJS	= nand_boot_mx31.o
+
+SRCS	:= $(SRCTREE)/nand_spl/nand_boot_mx31.c
+SRCS	+= $(SRCTREE)/cpu/arm1136/start.S
+SRCS	+= $(SRCTREE)/board/freescale/mx31pdk/lowlevel_init.S
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS	:= $(SOBJS) $(COBJS)
+LNDIR	:= $(OBJTREE)/nand_spl/board/$(BOARDDIR)
+
+nandobj	:= $(OBJTREE)/nand_spl/
+
+ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin
$(nandobj)u-boot-spl-aligned.bin
+
+all:	$(obj).depend $(ALL)
+
+$(nandobj)u-boot-spl-aligned.bin: $(nandobj)u-boot-spl
+	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+
+$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
+	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(nandobj)u-boot-spl:	$(OBJS)
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
+		-Map $(nandobj)u-boot-spl.map \
+		-o $(nandobj)u-boot-spl
+
+#########################################################################
+
+$(obj)%.o:	$(SRCTREE)/cpu/arm1136/%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(SRCTREE)/board/freescale/mx31pdk/%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(SRCTREE)/nand_spl/%.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################


More information about the U-Boot mailing list