From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Fri, 08 Jul 2011 17:02:57 +0530 Subject: [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL In-Reply-To: <20110708091721.79CCB126F38F@gemini.denx.de> References: <1309352967-5719-1-git-send-email-aneesh@ti.com> <1309883182-12854-1-git-send-email-daniel.schwierzeck@googlemail.com> <1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> <20110708091721.79CCB126F38F@gemini.denx.de> Message-ID: <4E16EAE9.5070505@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang, On Friday 08 July 2011 02:47 PM, Wolfgang Denk wrote: > Dear Daniel Schwierzeck, > > In message<1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote: > ... Let's consider an out-of-tree build. Then, $(OBJTREE) is BUILD_DIR here. >> +# create 'spl/obj' within OBJTREE for spl >> +OBJTREE := $(OBJTREE)/spl/obj >> +LNDIR := $(OBJTREE) >> + >> +include $(TOPDIR)/config.mk Here: $(OBJTREE) => BUILD_DIR/spl/obj $(obj) => BUILD_DIR/spl/obj/spl >> +# We want the final binaries in this directory >> +obj := $(obj)../ First of all, this was really intended to be: +obj := $(obj)../../ (The original implementation was a mistake!) So, here: $(obj) => BUILD_DIR/spl/ I was trying to make an exception for the the spl directory, so that the final images are in BUILD_DIR/spl/ >> +START = $(OBJTREE)/$(CPUDIR)/start.o > > I don't really like these "../" parts. Can we please try to omit > these? We can use $(TOPDIR) and/or $(OBJTREE) instead to express the > path names, can't we? Please note that even if we use $(OBJTREE), to achieve the above, we will need: +obj := $(OBJTREE)/../ Please note that $(OBJTREE) needs to be updated before including config.mk while $(obj) needs to be updated after it. The solution I see to this problem is to have BUILD_DIR/spl/ as the OBJTREE instead of BUILD_DIR/spl/obj. But this will create problems for in-tree builds if TOPDIR/spl also had folders for source files like nand, one-nand etc. In that case you will have something like this: spl/ nand/ - source files spl/nand/ - object files for the above directory one-nand/ - source files spl/one-nand/ - object files for the above directory arch/... - object files u-boot-spl - final elf target u-boot-spl.bin - final binary image I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem. If we could keep nand-boot.c etc in the regular source tree we can have something like this: spl/ arch/... - object files drivers/... - object files u-boot-spl - final elf target u-boot-spl.bin - final binary image Indeed this seems to be more logical for me. All source files for SPL remain in the regular source tree and just use BUILD_DIR/spl as a remote build directory. best regards, Aneesh