diff mbox series

[1/1] Makefile: add build-sandbox*/ to mrproper target

Message ID 20240517151534.65242-1-heinrich.schuchardt@canonical.com
State Rejected
Delegated to: Tom Rini
Headers show
Series [1/1] Makefile: add build-sandbox*/ to mrproper target | expand

Commit Message

Heinrich Schuchardt May 17, 2024, 3:15 p.m. UTC
make mrproper should remove all build artefacts.

Running make tests without deleting build-sandbox led to an error

    *** No rule to make target '../include/common.h',
    needed by 'include/config/auto.conf'.

on my machine.

Let's add the build-sandbox*/ directories to the mrproper target.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini May 17, 2024, 3:18 p.m. UTC | #1
On Fri, May 17, 2024 at 05:15:34PM +0200, Heinrich Schuchardt wrote:

> make mrproper should remove all build artefacts.
> 
> Running make tests without deleting build-sandbox led to an error
> 
>     *** No rule to make target '../include/common.h',
>     needed by 'include/config/auto.conf'.
> 
> on my machine.
> 
> Let's add the build-sandbox*/ directories to the mrproper target.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I don't believe it's the right place to remove build directories. This
is also incomplete as it wouldn't clean up other platforms that can be
built, and of course it cannot handle out of tree build directories. All
build directories regardless of where they are need to be removed as
that particular change breaks re-using build directories before/after
it.
Heinrich Schuchardt May 17, 2024, 3:51 p.m. UTC | #2
On 5/17/24 17:18, Tom Rini wrote:
> On Fri, May 17, 2024 at 05:15:34PM +0200, Heinrich Schuchardt wrote:
> 
>> make mrproper should remove all build artefacts.
>>
>> Running make tests without deleting build-sandbox led to an error
>>
>>      *** No rule to make target '../include/common.h',
>>      needed by 'include/config/auto.conf'.
>>
>> on my machine.
>>
>> Let's add the build-sandbox*/ directories to the mrproper target.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>>   Makefile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I don't believe it's the right place to remove build directories. This
> is also incomplete as it wouldn't clean up other platforms that can be
> built, and of course it cannot handle out of tree build directories. All
> build directories regardless of where they are need to be removed as
> that particular change breaks re-using build directories before/after
> it.
> 

My expectation is that after 'make mrproper; git clean -df' I have no 
build artifacts left over.

In .gitignore I find '/build*'. This results in 'git clean -df' not 
removing the the build directories either.

Tom, what is your suggestion?

Best regards

Heinrich
Tom Rini May 17, 2024, 3:52 p.m. UTC | #3
On Fri, May 17, 2024 at 05:51:29PM +0200, Heinrich Schuchardt wrote:
> On 5/17/24 17:18, Tom Rini wrote:
> > On Fri, May 17, 2024 at 05:15:34PM +0200, Heinrich Schuchardt wrote:
> > 
> > > make mrproper should remove all build artefacts.
> > > 
> > > Running make tests without deleting build-sandbox led to an error
> > > 
> > >      *** No rule to make target '../include/common.h',
> > >      needed by 'include/config/auto.conf'.
> > > 
> > > on my machine.
> > > 
> > > Let's add the build-sandbox*/ directories to the mrproper target.
> > > 
> > > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > > ---
> > >   Makefile | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > I don't believe it's the right place to remove build directories. This
> > is also incomplete as it wouldn't clean up other platforms that can be
> > built, and of course it cannot handle out of tree build directories. All
> > build directories regardless of where they are need to be removed as
> > that particular change breaks re-using build directories before/after
> > it.
> > 
> 
> My expectation is that after 'make mrproper; git clean -df' I have no build
> artifacts left over.
> 
> In .gitignore I find '/build*'. This results in 'git clean -df' not removing
> the the build directories either.
> 
> Tom, what is your suggestion?

git clean -dfx ? Per the help:
       -x
           Don’t use the standard ignore rules (see gitignore(5)), but still use the ignore
           rules given with -e options from the command line. This allows removing all
           untracked files, including build products. This can be used (possibly in
           conjunction with git restore or git reset) to create a pristine working directory
           to test a clean build.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 44deb339af1..179cce9c0a1 100644
--- a/Makefile
+++ b/Makefile
@@ -2204,7 +2204,7 @@  CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \
 	       Test* capsule.*.efi-capsule capsule*.map
 
 # Directories & files removed with 'make mrproper'
-MRPROPER_DIRS  += include/config include/generated spl tpl vpl \
+MRPROPER_DIRS  += build-sandbox* include/config include/generated spl tpl vpl \
 		  .tmp_objdiff doc/output include/asm
 
 # Remove include/asm symlink created by U-Boot before v2014.01