Skip to contentSkip to conversation

fix mkmakefile

PATCH New Jan Beulich 1 participant 1 message Jan 30, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix mkmakefile

From: Jan Beulich <[email protected]>

With the current way of generating the Makefile in the output directory for builds outside of the source tree, specifying real targets (rather than phony ones) doesn't work in an already (partially) built tree, as the stub Makefile doesn't have any dependency information available. Thus, all targets where files may actually exist must be listed explicitly and, due to what I'd call a make misbehavior, directory targets must then also be special cased.

From: Jan Beulich <[email protected]>

With the current way of generating the Makefile in the output directory for builds outside of the source tree, specifying real targets (rather than phony ones) doesn't work in an already (partially) built tree, as the stub Makefile doesn't have any dependency information available. Thus, all targets where files may actually exist must be listed explicitly and, due to what I'd call a make misbehavior, directory targets must then also be special cased.

scripts/mkmakefile renamed from home/jbeulich/tmp/linux-2.6.16-rc1/scripts/mkmakefile +7 -4
diff -Npru /home/jbeulich/tmp/linux-2.6.16-rc1/scripts/mkmakefile 2.6.16-rc1-mkmakefile/scripts/mkmakefile
@@ -20,12 +20,15 @@ KERNELSRC    := $1
 KERNELOUTPUT := $2
 
 MAKEFLAGS += --no-print-directory
+MAKEARGS  := -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
+
+.PHONY: all \$(MAKECMDGOALS)
 
 all:
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
+	\$(MAKE) \$(MAKEARGS)
 
-%::
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
+Makefile:;
 
+\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
+	\$(MAKE) \$(MAKEARGS) \$@
 EOF
-