diff mbox series

[7/9] makefile: Update clean rule to remove files generated by binman

Message ID 20210505141557.23901-8-bmeng.cn@gmail.com
State Superseded
Delegated to: Andes
Headers show
Series riscv: Partially move to binman to generate u-boot.itb | expand

Commit Message

Bin Meng May 5, 2021, 2:15 p.m. UTC
When using binman to generate an FIT image, these intermediate files
"*.fit.fit" and "*.fit.itb" are generated from mkimage, which should
be cleaned, and git ignored.

While we are here, clean the map file generated by "binman -m" as well.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 .gitignore | 4 +++-
 Makefile   | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Simon Glass May 5, 2021, 11:37 p.m. UTC | #1
Hi Bin,

On Wed, 5 May 2021 at 07:16, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> When using binman to generate an FIT image, these intermediate files
> "*.fit.fit" and "*.fit.itb" are generated from mkimage, which should
> be cleaned, and git ignored.
>
> While we are here, clean the map file generated by "binman -m" as well.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  .gitignore | 4 +++-
>  Makefile   | 5 +++--
>  2 files changed, 6 insertions(+), 3 deletions(-)

The thing is, binman can emit a lot of files and this is just some of
them. We need a way to handle this in general.

Options I can think of:

- put intermedia files in a subdir
- have a way to ask binman to list the files it would have generated
for any particular board, and 'rm' them in the Makefile
- have binman write out a list of generated files into something like
binman.lst and remove those files

Regards,
Simon
Bin Meng May 7, 2021, 2:49 p.m. UTC | #2
Hi Simon,

On Thu, May 6, 2021 at 7:38 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Bin,
>
> On Wed, 5 May 2021 at 07:16, Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > When using binman to generate an FIT image, these intermediate files
> > "*.fit.fit" and "*.fit.itb" are generated from mkimage, which should
> > be cleaned, and git ignored.
> >
> > While we are here, clean the map file generated by "binman -m" as well.
> >
> > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >
> >  .gitignore | 4 +++-
> >  Makefile   | 5 +++--
> >  2 files changed, 6 insertions(+), 3 deletions(-)
>
> The thing is, binman can emit a lot of files and this is just some of
> them. We need a way to handle this in general.
>
> Options I can think of:
>
> - put intermedia files in a subdir
> - have a way to ask binman to list the files it would have generated
> for any particular board, and 'rm' them in the Makefile
> - have binman write out a list of generated files into something like
> binman.lst and remove those files

For binman generated files, these are options we can look at. But I am
not sure if the same applies to mkimage generated ones? Is it worth
changing in this series?

Regards,
Bin
Simon Glass May 7, 2021, 4:34 p.m. UTC | #3
Hi Bin,

On Fri, 7 May 2021 at 08:50, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Simon,
>
> On Thu, May 6, 2021 at 7:38 AM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Bin,
> >
> > On Wed, 5 May 2021 at 07:16, Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > When using binman to generate an FIT image, these intermediate files
> > > "*.fit.fit" and "*.fit.itb" are generated from mkimage, which should
> > > be cleaned, and git ignored.
> > >
> > > While we are here, clean the map file generated by "binman -m" as well.
> > >
> > > Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> > > ---
> > >
> > >  .gitignore | 4 +++-
> > >  Makefile   | 5 +++--
> > >  2 files changed, 6 insertions(+), 3 deletions(-)
> >
> > The thing is, binman can emit a lot of files and this is just some of
> > them. We need a way to handle this in general.
> >
> > Options I can think of:
> >
> > - put intermedia files in a subdir
> > - have a way to ask binman to list the files it would have generated
> > for any particular board, and 'rm' them in the Makefile
> > - have binman write out a list of generated files into something like
> > binman.lst and remove those files
>
> For binman generated files, these are options we can look at. But I am
> not sure if the same applies to mkimage generated ones? Is it worth
> changing in this series?

But isn't mkimage invoked by binman?

I think this patch is best skipped if we cannot solve the problem
fully. We can return to it another time perhaps.

Regards,
Simon
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index e66aa864da..b9ebe0dfd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,10 +40,12 @@ 
 fit-dtb.blob*
 /MLO*
 /SPL*
-/System.map
 /u-boot*
 /boards.cfg
+/*.fit.fit
+/*.fit.itb
 /*.log
+/*.map
 
 #
 # git files that we don't want to ignore even it they are dot-files
diff --git a/Makefile b/Makefile
index 404977efa5..a5701f6f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -1998,9 +1998,10 @@  CLEAN_DIRS  += $(MODVERDIR) \
 			$(filter-out include, $(shell ls -1 $d 2>/dev/null))))
 
 CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
-	       boot* u-boot* MLO* SPL System.map fit-dtb.blob* \
+	       boot* u-boot* MLO* SPL *.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
-	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
+	       lpc32xx-* bl31.c bl31.elf bl31_*.bin tispl.bin* \
+	       *.fit.fit *.fit.itb \
 	       idbloader.img flash.bin flash.log defconfig
 
 # Directories & files removed with 'make mrproper'