Commit 96678281bfaa5f04752a98f9b93454041169fd3b

Authored by Jan Beulich
Committed by Sam Ravnborg
1 parent 6176aa9ae4

kbuild: fix mkmakefile

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.

Signed-Off-By: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff

... ... @@ -21,11 +21,14 @@
21 21  
22 22 MAKEFLAGS += --no-print-directory
23 23  
  24 +.PHONY: all \$(MAKECMDGOALS)
  25 +
24 26 all:
25 27 \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
26 28  
27   -%::
28   - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
  29 +Makefile:;
29 30  
  31 +\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
  32 + \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
30 33 EOF