[U-Boot] [PATCH V3 17/32] imximage.cfg: run files through C preprocessor

Troy Kisky troy.kisky at boundarydevices.com
Thu Oct 11 22:33:41 CEST 2012


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): <your base file, mx6q_4x_mt41j128.cfg maybe>
> 	$(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



More information about the U-Boot mailing list