From patchwork Wed Oct 10 02:03:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 190533 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 345D42C0089 for ; Wed, 10 Oct 2012 13:05:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E3C0280C1; Wed, 10 Oct 2012 04:04:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FATv+vzv8-2S; Wed, 10 Oct 2012 04:04:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0715E28083; Wed, 10 Oct 2012 04:04:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E8AF28083 for ; Wed, 10 Oct 2012 04:04:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5X7Uw8t0iMjy for ; Wed, 10 Oct 2012 04:03:28 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 6B5852807F for ; Wed, 10 Oct 2012 04:03:16 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id ro8so138529pbb.3 for ; Tue, 09 Oct 2012 19:03:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=qhvLXNT5dj+cAXCqHA4Y25/eDIGqNmOJENyof1JRprE=; b=piWdJJ1DbJ6KOCjgZoGe5LlDfJ1UAbOwQ/4/P3WSdxBiEKgv+v+fU02ll6B2H3EZRU EHY7LiEXCXbbPsT4LhraoBogzai0lGrGJBtpQcJQJ5wMXurJU2u1v9+UiNtLT6Ng+LY+ gncd8Zmn2SLQn/pjCbefhCSVaBe7b2JMB8A2HQrwwFBKlBt71CWmGO1hI4iU5ff6ia9Z n3Ja4c6L0wdKASlloCR9J0F0JO1g1+WqLxvDmym36fhnbsXsZjEeIypI8cL3gc3ZCcNg TFrAme/HvyphmFxVVTKQ287UgfTt7WV6oG6yNrYkmLHaxNYPzOl2br5pGF9R7fEAufPf lpvA== Received: by 10.68.190.233 with SMTP id gt9mr68561045pbc.137.1349834593323; Tue, 09 Oct 2012 19:03:13 -0700 (PDT) Received: from [29.6.1.4] ([70.96.116.236]) by mx.google.com with ESMTPS id bn1sm12858pab.8.2012.10.09.19.03.11 (version=SSLv3 cipher=OTHER); Tue, 09 Oct 2012 19:03:12 -0700 (PDT) Message-ID: <5074D75D.8050200@boundarydevices.com> Date: Tue, 09 Oct 2012 19:03:09 -0700 From: Troy Kisky User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Stefano Babic 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> In-Reply-To: <5072D772.5000309@denx.de> X-Gm-Message-State: ALoCoQmF1GKWV9FmyXqYfOuYuYZt1nrYjfheZoS/EfqT+0c+xySazZN/HiP5FbQB6lAzRIVe26cl Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH V3 17/32] imximage.cfg: run files through C preprocessor X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On 10/8/2012 6:38 AM, Stefano Babic wrote: > On 04/10/2012 03:47, Troy Kisky wrote: >> The '#' used as comments in the files cause the preprocessor >> trouble, so change to /* */. >> >> Signed-off-by: Troy Kisky >> --- > Hi Troy, > >> Makefile | 3 +- >> board/esg/ima3-mx53/imximage.cfg | 120 ++++++----- >> board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg | 90 ++++---- >> board/freescale/mx25pdk/imximage.cfg | 77 +++---- >> board/freescale/mx51evk/imximage.cfg | 114 +++++----- >> board/freescale/mx53ard/imximage_dd3.cfg | 83 ++++---- >> board/freescale/mx53evk/imximage.cfg | 86 ++++---- >> board/freescale/mx53loco/imximage.cfg | 83 ++++---- >> board/freescale/mx53smd/imximage.cfg | 83 ++++---- >> board/freescale/mx6qarm2/imximage.cfg | 88 ++++---- >> board/genesi/mx51_efikamx/imximage_mx.cfg | 132 ++++++------ >> board/genesi/mx51_efikamx/imximage_sb.cfg | 126 +++++------ >> board/ttcontrol/vision2/imximage_hynix.cfg | 295 ++++++++++++++------------ >> 13 files changed, 727 insertions(+), 653 deletions(-) >> > I see the C preprocessor as an optional feature, instead of a rule > everybody must follow. > >> diff --git a/Makefile b/Makefile >> index a40d4cc..64ff1b8 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -431,7 +431,8 @@ $(obj)u-boot.img: $(obj)u-boot.bin >> -d $< $@ >> >> $(obj)u-boot.imx: $(obj)u-boot.bin >> - $(obj)tools/mkimage -n $(CONFIG_IMX_CONFIG) -T imximage \ >> + $(CC) -E -x c $(CONFIG_IMX_CONFIG) -I./include -o $(obj)imxcfg.imx >> + $(obj)tools/mkimage -n $(obj)imxcfg.imx -T imximage \ >> -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > In fact, adding this rule here requires that each board configuration > must be changed. And for all of them, running the preprocessor is > unnnecessary. > > What about to add this rule only to the Makefile of the boards that > require preprocessing ? > > Best regards, > Stefano Babic > How about this to do the job.... Subject: [PATCH 17/32] boards.cfg: run mx6q_4x_mt41j128.pcfg through C preprocessor The '#' used as comments in the cfg file cause the preprocessor trouble, so change to /* */. Also, rename mx6q_4x_mt41j128.cfg to mx6q_4x_mt41j128.pcfg. Files with extension of .pcfg are run through the preprocessor before being given to mkimage. Signed-off-by: Troy Kisky --- v4: Don't run every file through preprocessor, only .pcfg files --- .gitignore | 1 + Makefile | 16 +++- ...{mx6q_4x_mt41j128.cfg => mx6q_4x_mt41j128.pcfg} | 90 ++++++++++---------- boards.cfg | 4 +- 4 files changed, 63 insertions(+), 48 deletions(-) rename board/freescale/imx/ddr/{mx6q_4x_mt41j128.cfg => mx6q_4x_mt41j128.pcfg} (65%) freescale mx6 mx6qsabreauto:IMX_CONFIG=board/freescale/mx6qs abreauto/imximage.cfg -mx6qsabrelite arm armv7 mx6qsabrelite freescale mx6 mx6qsabrelite:IMX_CONFIG=board/freescale/imx/d dr/mx6q_4x_mt41j128.cfg -mx6qsabresd arm armv7 mx6qsabresd freescale mx6 mx6qsabresd:IMX_CONFIG=board/freescale/imx/ddr /mx6q_4x_mt41j128.cfg +mx6qsabrelite arm armv7 mx6qsabrelite freescale mx6 mx6qsabrelite:IMX_CONFIG=board/freescale/imx/d dr/mx6q_4x_mt41j128.pcfg +mx6qsabresd arm armv7 mx6qsabresd freescale mx6 mx6qsabresd:IMX_CONFIG=board/freescale/imx/ddr /mx6q_4x_mt41j128.pcfg cm_t35 arm armv7 cm_t35 - omap3 omap3_overo arm armv7 overo - omap3 omap3_pandora arm armv7 pandora - omap3 -- 1.7.9.5 diff --git a/.gitignore b/.gitignore index d91e91b..e5273bd 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ *.swp *.patch *.bin +*.pcfgtmp # Build tree /build-* diff --git a/Makefile b/Makefile index a40d4cc..99666b9 100644 --- a/Makefile +++ b/Makefile @@ -430,8 +430,17 @@ $(obj)u-boot.img: $(obj)u-boot.bin sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ -d $< $@ -$(obj)u-boot.imx: $(obj)u-boot.bin - $(obj)tools/mkimage -n $(CONFIG_IMX_CONFIG) -T imximage \ +ifeq ($(suffix $(patsubst "%",%,$(CONFIG_IMX_CONFIG))),.pcfg) +$(obj)$(patsubst "%",%,$(CONFIG_IMX_CONFIG))tmp: %.pcfgtmp : %.pcfg + $(CC) -E -x c $< -I./include -o $@ + +$(obj)u-boot.imx: %.imx : %.bin $(obj)$(patsubst "%",%,$(CONFIG_IMX_CONFIG))tmp +else +$(obj)u-boot.imx: %.imx : %.bin $(patsubst "%",%,$(CONFIG_IMX_CONFIG)) +endif + +$(obj)u-boot.imx: + $(obj)tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ $(obj)u-boot.kwb: $(obj)u-boot.bin @@ -794,7 +803,8 @@ clean: @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) @find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ - -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \ + -o -name '*.o' -o -name '*.a' -o -name '*.exe' \ + -o -name '*.pcfgtmp' \) -print \ | xargs rm -f # Removes everything not needed for testing u-boot diff --git a/board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg b/board/freescale/imx/ddr/mx6q_4x_mt41j128.pcfg similarity index 65% rename from board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg rename to board/freescale/imx/ddr/mx6q_4x_mt41j128.pcfg diff --git a/boards.cfg b/boards.cfg index e9e073e..677beac 100644 --- a/boards.cfg +++ b/boards.cfg @@ -232,8 +232,8 @@ ima3-mx53 arm armv7 ima3-mx53 esg vision2 arm armv7 vision2 ttcontrol mx5 vision2:IMX_CONFIG=board/ttcontrol/vision2/imx image_hynix.cfg mx6qarm2 arm armv7 mx6qarm2 freescale mx6 mx6qarm2:IMX_CONFIG=board/freescale/mx6qarm2/i mximage.cfg mx6qsabreauto arm armv7 mx6qsabreauto