From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Thu, 11 Oct 2012 13:33:41 -0700 Subject: [U-Boot] [PATCH V3 17/32] imximage.cfg: run files through C preprocessor In-Reply-To: <5076A94D.9060207@denx.de> References: <1348281558-19520-1-git-send-email-troy.kisky@boundarydevices.com> <1349315254-21151-1-git-send-email-troy.kisky@boundarydevices.com> <1349315254-21151-18-git-send-email-troy.kisky@boundarydevices.com> <5072D772.5000309@denx.de> <5074D75D.8050200@boundarydevices.com> <5076A94D.9060207@denx.de> Message-ID: <50772D25.3090208@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/11/2012 4:11 AM, Stefano Babic wrote: > Does it work something more direct (I have not tested, really...) ? > > In board Makefile, for example board/freescale/mx6qsabrelite, a rule for > the imximage file: > > $(CONFIG_IMX_CONFIG): > $(CC) -E -x c $< -I./include -o $@ > > And let unchanged in the main Makefile. So CONFIG_IMX_CONFIG is produced > and you do not need to change logic in the main Makefile. > > Regards, > Stefano > The advantages I see of changing the main Makefile are 1. Easy for other boards to use the preprocessor. You merely need to change the file extension to pcfg. 2. Easy to clean the temporary generated file. The main Makefile deletes files with .pcfgtmp extension. 3. The file referred to by boards.cfg actually exists before the build starts. 4. The temporary file can be placed in an out-of-tree directory for make -O builds Using the file extension to determine whether to use the preprocessor is also what gcc uses to preprocess ".S" files while skipping this for ".s" files. I believe that at least other mx6 boards will quickly change to using the preprocessor as well to add support for solo/duallite, so total line count should eventually be less with changes to the main makefile. Having said that, I really have no problem going your route, I just don't prefer it. Let me know. Thanks Troy