mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] scripts: mkmakefile: apply changes from Linux kernel
@ 2017-03-26 10:40 Dennis Menschel
  2017-04-10  9:37 ` Dennis Menschel
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Menschel @ 2017-03-26 10:40 UTC (permalink / raw)
  To: barebox; +Cc: Dennis Menschel

The version of mkmakefile which has been used in barebox until now dates
back to commit fd5f0cd6b0cef59ba18e5ac13be5b2775fa6ec28 from the Linux
kernel git history (Tue May 2 12:33:20 2006 +0200).
This patch effectively includes all changes from the aforementioned
commit to the latest stable version of the Linux kernel:

git log --pretty=oneline --abbrev-commit fd5f0cd..v4.10 scripts/mkmakefile
06ed5c2 kbuild: Make scripts executable
9319f45 kbuild: support simultaneous "make %config" and "make all"
0ff3577 kbuild: silence generated makefile message
3c955b4 fixes for using make 3.82
d230124 kbuild: teach mkmakfile to be silent
1d3b3bf kbuild: scripts/mkmakefile: dynamic determination of output directory
971edcf kbuild: re-enable Makefile generation in a new O=... directory
18c32da kbuild: fix building with O=.. options
0b35786 kbuild: call make once for all targets when O=.. is used

In particular, the list of changes includes a fix for the following
Make warning:

  Makefile:18: *** mixed implicit and normal rules: deprecated syntax

GNU Make 3.82 raises an error instead of a warning and aborts the
make process. GNU Make 3.82 is still used today by distributions
like Red Hat Enterprise Linux 7.3.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
---
 scripts/mkmakefile | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)
 mode change 100644 => 100755 scripts/mkmakefile

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
old mode 100644
new mode 100755
index 7f9d544..84af27b
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -11,7 +11,15 @@
 
 
 test ! -r $2/Makefile -o -O $2/Makefile || exit 0
-echo "  GEN     $2/Makefile"
+# Only overwrite automatically generated Makefiles
+# (so we do not overwrite kernel Makefile)
+if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
+then
+	exit 0
+fi
+if [ "${quiet}" != "silent_" ]; then
+	echo "  GEN     $2/Makefile"
+fi
 
 cat << EOF > $2/Makefile
 # Automatically generated by $0: don't edit
@@ -19,18 +27,26 @@ cat << EOF > $2/Makefile
 VERSION = $3
 PATCHLEVEL = $4
 
-KERNELSRC    := $1
-KERNELOUTPUT := $2
+lastword = \$(word \$(words \$(1)),\$(1))
+makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
 
-MAKEFLAGS += --no-print-directory
+ifeq ("\$(origin V)", "command line")
+VERBOSE := \$(V)
+endif
+ifneq (\$(VERBOSE),1)
+Q := @
+endif
+
+MAKEARGS := -C $1
+MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
 
-.PHONY: all \$(MAKECMDGOALS)
+MAKEFLAGS += --no-print-directory
 
-all:
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
+.PHONY: __sub-make \$(MAKECMDGOALS)
 
-Makefile:;
+__sub-make:
+	\$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
 
-\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
+\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
+	@:
 EOF
-- 
2.7.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts: mkmakefile: apply changes from Linux kernel
  2017-03-26 10:40 [PATCH] scripts: mkmakefile: apply changes from Linux kernel Dennis Menschel
@ 2017-04-10  9:37 ` Dennis Menschel
  2017-04-11  6:23   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Menschel @ 2017-04-10  9:37 UTC (permalink / raw)
  To: barebox; +Cc: Dennis Menschel

Hello everyone,

Am 26.03.2017 um 12:40 schrieb Dennis Menschel:
> The version of mkmakefile which has been used in barebox until now dates
> back to commit fd5f0cd6b0cef59ba18e5ac13be5b2775fa6ec28 from the Linux
> kernel git history (Tue May 2 12:33:20 2006 +0200).
> This patch effectively includes all changes from the aforementioned
> commit to the latest stable version of the Linux kernel:
>
> [...]

about 2 weeks have passed since I submitted the aforementioned patch. As
a haven't received any comments or feedback until now, I wanted to ask
whether the patch has simply been overseen or maybe contains obvious
errors of which I am not aware.

Best regards,
Dennis Menschel

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts: mkmakefile: apply changes from Linux kernel
  2017-04-10  9:37 ` Dennis Menschel
@ 2017-04-11  6:23   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2017-04-11  6:23 UTC (permalink / raw)
  To: Dennis Menschel; +Cc: barebox

Hi Dennis,

On Mon, Apr 10, 2017 at 11:37:01AM +0200, Dennis Menschel wrote:
> Hello everyone,
> 
> Am 26.03.2017 um 12:40 schrieb Dennis Menschel:
> > The version of mkmakefile which has been used in barebox until now dates
> > back to commit fd5f0cd6b0cef59ba18e5ac13be5b2775fa6ec28 from the Linux
> > kernel git history (Tue May 2 12:33:20 2006 +0200).
> > This patch effectively includes all changes from the aforementioned
> > commit to the latest stable version of the Linux kernel:
> >
> > [...]
> 
> about 2 weeks have passed since I submitted the aforementioned patch. As
> a haven't received any comments or feedback until now, I wanted to ask
> whether the patch has simply been overseen or maybe contains obvious
> errors of which I am not aware.

Sorry, I have really overseen this patch. If this patch was not ok, I
would at least have provided feedback what's wrong with it. Anyway, the
patch looks good, applied now.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-11  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26 10:40 [PATCH] scripts: mkmakefile: apply changes from Linux kernel Dennis Menschel
2017-04-10  9:37 ` Dennis Menschel
2017-04-11  6:23   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox