diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 24 | 3 | SUBLEVEL = 24 |
4 | EXTRAVERSION = -rc3 | 4 | EXTRAVERSION = |
5 | NAME = Arr Matey! A Hairy Bilge Rat! | 5 | NAME = Arr Matey! A Hairy Bilge Rat! |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
@@ -12,7 +12,7 @@ NAME = Arr Matey! A Hairy Bilge Rat! | |||
12 | 12 | ||
13 | # Do not: | 13 | # Do not: |
14 | # o use make's built-in rules and variables | 14 | # o use make's built-in rules and variables |
15 | # (this increases performance and avoid hard-to-debug behavour); | 15 | # (this increases performance and avoids hard-to-debug behaviour); |
16 | # o print "Entering directory ..."; | 16 | # o print "Entering directory ..."; |
17 | MAKEFLAGS += -rR --no-print-directory | 17 | MAKEFLAGS += -rR --no-print-directory |
18 | 18 | ||
@@ -108,6 +108,9 @@ endif | |||
108 | PHONY := _all | 108 | PHONY := _all |
109 | _all: | 109 | _all: |
110 | 110 | ||
111 | # Cancel implicit rules on top Makefile | ||
112 | $(CURDIR)/Makefile Makefile: ; | ||
113 | |||
111 | ifneq ($(KBUILD_OUTPUT),) | 114 | ifneq ($(KBUILD_OUTPUT),) |
112 | # Invoke a second make in the output directory, passing relevant variables | 115 | # Invoke a second make in the output directory, passing relevant variables |
113 | # check that the output directory actually exists | 116 | # check that the output directory actually exists |
@@ -115,13 +118,10 @@ saved-output := $(KBUILD_OUTPUT) | |||
115 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | 118 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
116 | $(if $(KBUILD_OUTPUT),, \ | 119 | $(if $(KBUILD_OUTPUT),, \ |
117 | $(error output directory "$(saved-output)" does not exist)) | 120 | $(error output directory "$(saved-output)" does not exist)) |
118 | # Check that OUTPUT directory is not the same as where we have kernel src | ||
119 | $(if $(filter-out $(KBUILD_OUTPUT),$(shell /bin/pwd)),, \ | ||
120 | $(error Output directory (O=...) specifies kernel src dir)) | ||
121 | 121 | ||
122 | PHONY += $(MAKECMDGOALS) sub-make | 122 | PHONY += $(MAKECMDGOALS) sub-make |
123 | 123 | ||
124 | $(filter-out _all sub-make,$(MAKECMDGOALS)) _all: sub-make | 124 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
125 | $(Q)@: | 125 | $(Q)@: |
126 | 126 | ||
127 | sub-make: FORCE | 127 | sub-make: FORCE |
@@ -291,7 +291,8 @@ export quiet Q KBUILD_VERBOSE | |||
291 | # Look for make include files relative to root of kernel src | 291 | # Look for make include files relative to root of kernel src |
292 | MAKEFLAGS += --include-dir=$(srctree) | 292 | MAKEFLAGS += --include-dir=$(srctree) |
293 | 293 | ||
294 | # We need some generic definitions. | 294 | # We need some generic definitions (do not try to remake the file). |
295 | $(srctree)/scripts/Kbuild.include: ; | ||
295 | include $(srctree)/scripts/Kbuild.include | 296 | include $(srctree)/scripts/Kbuild.include |
296 | 297 | ||
297 | # Make variables (CC, etc...) | 298 | # Make variables (CC, etc...) |
@@ -1328,7 +1329,7 @@ else | |||
1328 | ALLINCLUDE_ARCHS := $(SRCARCH) | 1329 | ALLINCLUDE_ARCHS := $(SRCARCH) |
1329 | endif | 1330 | endif |
1330 | else | 1331 | else |
1331 | #Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour. | 1332 | #Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour. |
1332 | ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) | 1333 | ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) |
1333 | endif | 1334 | endif |
1334 | 1335 | ||
@@ -1560,9 +1561,6 @@ endif # skip-makefile | |||
1560 | PHONY += FORCE | 1561 | PHONY += FORCE |
1561 | FORCE: | 1562 | FORCE: |
1562 | 1563 | ||
1563 | # Cancel implicit rules on top Makefile, `-rR' will apply to sub-makes. | ||
1564 | Makefile: ; | ||
1565 | |||
1566 | # Declare the contents of the .PHONY variable as phony. We keep that | 1564 | # Declare the contents of the .PHONY variable as phony. We keep that |
1567 | # information in a variable se we can use it in if_changed and friends. | 1565 | # information in a variable se we can use it in if_changed and friends. |
1568 | .PHONY: $(PHONY) | 1566 | .PHONY: $(PHONY) |