Skip to contentSkip to conversation

Makefile: remove generated boards.cfg within make mrproper

PATCH New Roger Meier 4 participants 14 messages Aug 7, 2014 – Aug 23, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: remove generated boards.cfg within make mrproper

CC Masahiro Yamada <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 666d291..831e091 100644
@@ -1221,7 +1221,7 @@ CLOBBER_FILES += u-boot* MLO* SPL System.map
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
 		  .tmp_objdiff
-MRPROPER_FILES += .config .config.old include/autoconf.mk* include/config.h \
+MRPROPER_FILES += .config .config.old boards.cfg include/autoconf.mk* include/config.h \
 		  ctags etags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
 
 # clean - Delete most, but leave enough to build external modules
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 Makefile: remove generated boards.cfg within make mrproper

Hi Roger,

Quoted 22 lines · On Thu, 7 Aug 2014 12:52:30 +0200 Roger Meier <[email protected]> wrote:
CC Masahiro Yamada <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 666d291..831e091 100644
@@ -1221,7 +1221,7 @@ CLOBBER_FILES += u-boot* MLO* SPL System.map
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
 		  .tmp_objdiff
-MRPROPER_FILES += .config .config.old include/autoconf.mk* include/config.h \
+MRPROPER_FILES += .config .config.old boards.cfg include/autoconf.mk* include/config.h \
 		  ctags etags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
 
 # clean - Delete most, but leave enough to build external modules
Signature · 1 line
1.7.10.4

NAK.

MAKEALL needs boards.cfg

Before building each board, MAKEALL runs "make distclean" and boards.cfg gets lost.

With your patch, MAKEALL does not work at all.

This is my log of "./MAKEALL"

Could not find boards.cfg
Generating boards.cfg ... (jobs: 8)
1177/1177 [=======================================================>]
Building cmi_mpc5xx board...
text data bss dec hex filename
106025 70616 2532 179173 2bbe5 ./u-boot
awk: fatal: cannot open file `boards.cfg' for reading (No such file or directory)
Building PATI board...
make[2]: *** [include/autoconf.mk] Error 1
make[2]: *** [include/autoconf.mk.dep] Error 1
make[1]: *** [silentoldconfig] Error 1
size: './u-boot': No such file
/bin/sh: 1: ppc_8xx-gcc: not found
/bin/sh: 1: ppc_8xx-gcc: not found
make[2]: *** [include/autoconf.mk] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [include/autoconf.mk.dep] Error 1
'make -f /home/yamada/workspace/u-boot-org/scripts/Makefile.autoconf obj=include include/autoconf.mk include/autoconf.mk.dep' Failed make[1]: *** [silentoldconfig] Error 1
make: *** No rule to make target include/config/auto.conf', needed by include/config/uboot.release'.

Best Regards
Masahiro Yamada

#2 lore raw

PATCH 1/1 Makefile: remove generated boards.cfg within make mrproper

Hi Masahiro
Quoting Masahiro Yamada <[email protected]>:

Quoted 36 lines

Hi Roger,

Quoted 21 lines · On Thu, 7 Aug 2014 12:52:30 +0200 Roger Meier <[email protected]> wrote:
CC Masahiro Yamada <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 666d291..831e091 100644
@@ -1221,7 +1221,7 @@ CLOBBER_FILES += u-boot* MLO* SPL System.map
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
 		  .tmp_objdiff
-MRPROPER_FILES += .config .config.old include/autoconf.mk*  
 include/config.h \
+MRPROPER_FILES += .config .config.old boards.cfg  
 include/autoconf.mk* include/config.h \
 		  ctags etags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
Quoted 3 lines
 # clean - Delete most, but leave enough to build external modules
--
1.7.10.4

NAK.

Quoted 4 lines

MAKEALL needs boards.cfg

Before building each board, MAKEALL runs "make distclean" and boards.cfg gets lost.

oops, did not recognize that. Thanks!

Quoted 2 lines

With your patch, MAKEALL does not work at all.

How should we ensure that boards.cfg is up-to-date? What about removing boards.cfg within "make distclean" and use "make mrproper" within MAKEALL?

best!
-roger

Quoted 34 lines

This is my log of "./MAKEALL"

Could not find boards.cfg
Generating boards.cfg ... (jobs: 8)
1177/1177 [=======================================================>] Building cmi_mpc5xx board...
text data bss dec hex filename
106025 70616 2532 179173 2bbe5 ./u-boot
awk: fatal: cannot open file `boards.cfg' for reading (No such file or directory)
Building PATI board...
make[2]: *** [include/autoconf.mk] Error 1
make[2]: *** [include/autoconf.mk.dep] Error 1
make[1]: *** [silentoldconfig] Error 1
size: './u-boot': No such file
/bin/sh: 1: ppc_8xx-gcc: not found
/bin/sh: 1: ppc_8xx-gcc: not found
make[2]: *** [include/autoconf.mk] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [include/autoconf.mk.dep] Error 1
'make -f /home/yamada/workspace/u-boot-org/scripts/Makefile.autoconf obj=include include/autoconf.mk include/autoconf.mk.dep' Failed make[1]: *** [silentoldconfig] Error 1
make: *** No rule to make target include/config/auto.conf', needed by include/config/uboot.release'.

Best Regards
Masahiro Yamada

#3 lore raw

PATCH 1/1 Makefile: remove generated boards.cfg within make mrproper

Quoted 43 lines · Roger Meier

Hi Masahiro
Quoting Masahiro Yamada <[email protected]>:

Quoted 36 lines

Hi Roger,

Quoted 21 lines · On Thu, 7 Aug 2014 12:52:30 +0200 Roger Meier <[email protected]> wrote:
CC Masahiro Yamada <[email protected]>
CC Wolfgang Denk <[email protected]>

---
Makefile | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 666d291..831e091 100644
@@ -1221,7 +1221,7 @@ CLOBBER_FILES += u-boot* MLO* SPL System.map
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
 		  .tmp_objdiff
-MRPROPER_FILES += .config .config.old include/autoconf.mk*
 include/config.h \
+MRPROPER_FILES += .config .config.old boards.cfg
 include/autoconf.mk* include/config.h \
 		  ctags etags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
Quoted 3 lines
# clean - Delete most, but leave enough to build external modules
--
1.7.10.4

NAK.

Quoted 4 lines

MAKEALL needs boards.cfg

Before building each board, MAKEALL runs "make distclean" and boards.cfg gets lost.

Quoted 7 lines

oops, did not recognize that. Thanks!

Quoted 2 lines

With your patch, MAKEALL does not work at all.

How should we ensure that boards.cfg is up-to-date? What about removing boards.cfg within "make distclean" and use "make mrproper" within MAKEALL?

Sounds good to me.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140808/6f276e3f/attachment.pgp>
#4 lore raw

PATCH v2 1/1 Makefile: remove generated boards.cfg within make distclean

CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL

---
 MAKEALL  |    2 +-
 Makefile |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
MAKEALL +1 -1
index 929fe88..392ea8d 100755
@@ -658,7 +658,7 @@ build_target() {
 		MAKE="${MAKE} O=${output_dir}"
 	fi
 
-	${MAKE} distclean >/dev/null
+	${MAKE} mrproper >/dev/null
 
 	echo "Building ${target} board..."
 	${MAKE} -s ${target}_defconfig >/dev/null
Makefile +2 -1
index 666d291..067a301 100644
@@ -1285,7 +1285,8 @@ distclean: mrproper
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '*%' -o -name 'core' \
 		-o -name '*.pyc' \) \
-		-type f -print | xargs rm -f
+		-type f -print | xargs rm -f \
+	rm -f boards.cfg
 
 backup:
 	F=`basename $(srctree)` ; cd .. ; \
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH v2 1/1 Makefile: remove generated boards.cfg within make distclean

Hi Roger,

(ccing Simon)

2014-08-10 21:37 GMT+09:00 Roger Meier <[email protected]>:

Quoted 5 lines
CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
Quoted 8 lines

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL

---
 MAKEALL  |    2 +-
 Makefile |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

I think it is OK as for MAKEALL.
But I am not sure it is safe for buildman, which also uses boards.cfg.

I just did grep under tools/buildman directory and found some lines referring 'distclean'.

./builder.py:179: distclean - can be called to
clean source
./builder.py:275: result = self.Make(commit, brd,
'distclean', work_dir,
./builder.py:276: 'distclean', *args, env=env)
./builder.py:700: stage: Stage that we are at (distclean,
config, build)

Unfortunately, I am not an expert of buildman.
I suspect this patch has an impact on it, but I am not sure. I think Simon can help you.

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw

PATCH v2 1/1 Makefile: remove generated boards.cfg within make distclean

Hi,

Quoted 37 lines · Masahiro YAMADA

Hi Roger,

(ccing Simon)

2014-08-10 21:37 GMT+09:00 Roger Meier <[email protected]>:

Quoted 5 lines
CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
Quoted 8 lines

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL

---
 MAKEALL  |    2 +-
 Makefile |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

I think it is OK as for MAKEALL.
But I am not sure it is safe for buildman, which also uses boards.cfg.

I just did grep under tools/buildman directory and found some lines referring 'distclean'.

./builder.py:179: distclean - can be called to
clean source
./builder.py:275: result = self.Make(commit, brd,
'distclean', work_dir,
./builder.py:276: 'distclean', *args, env=env)
./builder.py:700: stage: Stage that we are at (distclean,
config, build)

Quoted 4 lines

Unfortunately, I am not an expert of buildman.
I suspect this patch has an impact on it, but I am not sure. I think Simon can help you.

Yes I think buildman should be updated to change all 'disclean' to 'mrproper'.

Regards,
Simon

#7 lore raw

PATCH v2 1/1 Makefile: remove generated boards.cfg within make distclean

In reply to Roger Meier

Hi Roger,

Quoted 32 lines · On Sun, 10 Aug 2014 14:37:40 +0200 Roger Meier <[email protected]> wrote:
CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL

---
 MAKEALL  |    2 +-
 Makefile |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
MAKEALL +1 -1
index 929fe88..392ea8d 100755
@@ -658,7 +658,7 @@ build_target() {
 		MAKE="${MAKE} O=${output_dir}"
 	fi
 
-	${MAKE} distclean >/dev/null
+	${MAKE} mrproper >/dev/null
 
 	echo "Building ${target} board..."
 	${MAKE} -s ${target}_defconfig >/dev/null
Makefile +0 -0
index 666d291..067a301 100644

Makefile distclean: mrproper · line 1292

Quoted 9 lines
Makefile +2 -1
@@ -1285,7 +1285,8 @@ distclean: mrproper
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '*%' -o -name 'core' \
 		-o -name '*.pyc' \) \
-		-type f -print | xargs rm -f
+		-type f -print | xargs rm -f \
+	rm -f boards.cfg
 
 backup:
 	F=`basename $(srctree)` ; cd .. ; \

The backslash after "xargs rm -f" is unnecessary, I think.

Should be like follows?

-type f -print | xargs rm -f
@rm -f boards.cfg

Best Regards
Masahiro Yamada

#8 lore raw

PATCH v3 1/1 Makefile: remove generated boards.cfg within make distclean

In reply to Roger Meier
CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL
Changes for v3:
- use @rm instead of rm as suggested by Masahiro Yamada

---
 MAKEALL  |    2 +-
 Makefile |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
MAKEALL +1 -1
index 929fe88..392ea8d 100755
@@ -658,7 +658,7 @@ build_target() {
 		MAKE="${MAKE} O=${output_dir}"
 	fi
 
-	${MAKE} distclean >/dev/null
+	${MAKE} mrproper >/dev/null
 
 	echo "Building ${target} board..."
 	${MAKE} -s ${target}_defconfig >/dev/null
Makefile +2 -1
index 666d291..6679408 100644
@@ -1285,7 +1285,8 @@ distclean: mrproper
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '*%' -o -name 'core' \
 		-o -name '*.pyc' \) \
-		-type f -print | xargs rm -f
+		-type f -print | xargs rm -f \
+	@rm -f boards.cfg
 
 backup:
 	F=`basename $(srctree)` ; cd .. ; \
Signature · 1 line
1.7.10.4
#9 lore raw

PATCH v3 1/1 Makefile: remove generated boards.cfg within make distclean

Hi Roger,

Quoted 4 lines · On Wed, 20 Aug 2014 01:13:50 +0200 Roger Meier <[email protected]> wrote:
CC Masahiro Yamada <[email protected]>
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>

Most people use 'Cc:' instead of 'CC:'.

$ git log v2013.01..v2014.07 | grep 'Cc:' | wc
   2007    8047   87385
$ git log v2013.01..v2014.07 | grep 'CC:' | wc
    147     598    6443
Quoted 5 lines
Makefile +0 -0
index 666d291..6679408 100644

Makefile distclean: mrproper · line 1292

Quoted 9 lines
Makefile +2 -1
@@ -1285,7 +1285,8 @@ distclean: mrproper
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 		-o -name '.*.rej' -o -name '*%' -o -name 'core' \
 		-o -name '*.pyc' \) \
-		-type f -print | xargs rm -f
+		-type f -print | xargs rm -f \
+	@rm -f boards.cfg
 
 backup:
 	F=`basename $(srctree)` ; cd .. ; \

No. You missed one of my comments against v2.

Please remove the backslash after "xargs rm -f".

Here, you are doing

@find ... | xargs rm -f @rm -f boards.cfg

that is, you are trying to delete
'@rm' as well as 'boards.cfg' if they exist.

Besides, you also need to fix buildman
as Simon suggested.

Please also cc Simon when you post the next version.

Best Regards
Masahiro Yamada

#10 lore raw

PATCH v4 1/1 Makefile: remove generated boards.cfg within make distclean

In reply to Roger Meier
Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>

---
Changes for v2:
- remove boards.cfg within make distclean instead of mrproper
- use mrproper instead of distclean within MAKEALL
Changes for v3:
- use @rm instead of rm as suggested by Masahiro Yamada
Changes for v4:
- remove the backslash after "xargs rm -f"
- use mrproper instead of distclean within buildman

---
 MAKEALL                         |    2 +-
 Makefile                        |    1 +
 tools/buildman/builder.py       |    2 +-
 tools/buildman/builderthread.py |    6 +++---
 4 files changed, 6 insertions(+), 5 deletions(-)
MAKEALL +1 -1
index 929fe88..392ea8d 100755
@@ -658,7 +658,7 @@ build_target() {
 		MAKE="${MAKE} O=${output_dir}"
 	fi
 
-	${MAKE} distclean >/dev/null
+	${MAKE} mrproper >/dev/null
 
 	echo "Building ${target} board..."
 	${MAKE} -s ${target}_defconfig >/dev/null
Makefile +1 -0
index b5d5e01..c3d7afd 100644
@@ -1287,6 +1287,7 @@ distclean: mrproper
 		-o -name '.*.rej' -o -name '*%' -o -name 'core' \
 		-o -name '*.pyc' \) \
 		-type f -print | xargs rm -f
+	@rm -f boards.cfg
 
 backup:
 	F=`basename $(srctree)` ; cd .. ; \
tools/buildman/builder.py +1 -1
index d5b8454..a555bd8 100644
@@ -308,7 +308,7 @@ class Builder:
         Args:
             commit: Commit object that is being built
             brd: Board object that is being built
-            stage: Stage that we are at (distclean, config, build)
+            stage: Stage that we are at (mrproper, config, build)
             cwd: Directory where make should be run
             args: Arguments to pass to make
             kwargs: Arguments to pass to command.RunPipe()
tools/buildman/builderthread.py +3 -3
index 32297e2..8214662 100644
@@ -91,7 +91,7 @@ class BuilderThread(threading.Thread):
             commit: Commit object that is being built
             brd: Board object that is being built
             stage: Stage of the build. Valid stages are:
-                        distclean - can be called to clean source
+                        mrproper - can be called to clean source
                         config - called to configure for a board
                         build - the main make invocation - it does the build
             args: A list of arguments to pass to 'make'
@@ -200,8 +200,8 @@ class BuilderThread(threading.Thread):
 
                 # If we need to reconfigure, do that now
                 if do_config:
-                    result = self.Make(commit, brd, 'distclean', cwd,
-                            'distclean', *args, env=env)
+                    result = self.Make(commit, brd, 'mrproper', cwd,
+                            'mrproper', *args, env=env)
                     result = self.Make(commit, brd, 'config', cwd,
                             *(args + config_args), env=env)
                     config_out = result.combined
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH v4 1/1 Makefile: remove generated boards.cfg within make distclean

Quoted 6 lines · On Wed, 20 Aug 2014 22:10:29 +0200 Roger Meier <[email protected]> wrote:
Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
#12 lore raw

PATCH v4 1/1 Makefile: remove generated boards.cfg within make distclean

In reply to Roger Meier
Quoted 5 lines · Roger Meier
Cc Masahiro Yamada <[email protected]>
Cc Tom Rini <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140823/cadca205/attachment.pgp>
#13 lore raw

PATCH 1/1 Makefile: remove generated boards.cfg within make mrproper

In reply to Roger Meier

Hi Roger,

Quoted 3 lines

How should we ensure that boards.cfg is up-to-date? What about removing boards.cfg within "make distclean" and use "make mrproper" within MAKEALL?

Sounds good to me, too.
Thanks!

Best Regards
Masahiro Yamada