diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-02-22 02:40:08 -0500 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-02-27 07:43:31 -0500 |
| commit | b999923c29d69d795229e5bf1b49e1266491ff35 (patch) | |
| tree | 64232cc5d117a97eb29e0519e64a11e70fc4a25b /Makefile | |
| parent | 3812b8c5c5d527239ac015f1f2c7654da7fcfbba (diff) | |
kbuild: remove empty rules for makefiles
The previous commit made 'MAKEFLAGS += -rR' effective in the top
Makefile regardless of O= option, GNU Make versions.
The top Makefile does not need to cancel implicit rules for makefiles.
There is still one place where an empty rule is useful. Since -rR is
effective only after sub-make, GNU Make would try implicit rules to
update the top Makefile. Although it is not a big overhead, cancel it
just in case.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 13 |
1 files changed, 5 insertions, 8 deletions
| @@ -37,6 +37,10 @@ ifneq ($(sub-make-done),1) | |||
| 37 | # (this increases performance and avoids hard-to-debug behaviour) | 37 | # (this increases performance and avoids hard-to-debug behaviour) |
| 38 | MAKEFLAGS += -rR | 38 | MAKEFLAGS += -rR |
| 39 | 39 | ||
| 40 | # 'MAKEFLAGS += -rR' does not become immediately effective for old | ||
| 41 | # GNU Make versions. Cancel implicit rules for this Makefile. | ||
| 42 | $(lastword $(MAKEFILE_LIST)): ; | ||
| 43 | |||
| 40 | # Avoid funny character set dependencies | 44 | # Avoid funny character set dependencies |
| 41 | unexport LC_ALL | 45 | unexport LC_ALL |
| 42 | LC_COLLATE=C | 46 | LC_COLLATE=C |
| @@ -120,9 +124,6 @@ ifeq ("$(origin O)", "command line") | |||
| 120 | KBUILD_OUTPUT := $(O) | 124 | KBUILD_OUTPUT := $(O) |
| 121 | endif | 125 | endif |
| 122 | 126 | ||
| 123 | # Cancel implicit rules on top Makefile | ||
| 124 | $(CURDIR)/Makefile Makefile: ; | ||
| 125 | |||
| 126 | ifneq ($(words $(subst :, ,$(CURDIR))), 1) | 127 | ifneq ($(words $(subst :, ,$(CURDIR))), 1) |
| 127 | $(error main directory cannot contain spaces nor colons) | 128 | $(error main directory cannot contain spaces nor colons) |
| 128 | endif | 129 | endif |
| @@ -303,8 +304,6 @@ __build_one_by_one: | |||
| 303 | 304 | ||
| 304 | else | 305 | else |
| 305 | 306 | ||
| 306 | # We need some generic definitions (do not try to remake the file). | ||
| 307 | scripts/Kbuild.include: ; | ||
| 308 | include scripts/Kbuild.include | 307 | include scripts/Kbuild.include |
| 309 | 308 | ||
| 310 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 309 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
| @@ -1760,9 +1759,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | |||
| 1760 | # read saved command lines for existing targets | 1759 | # read saved command lines for existing targets |
| 1761 | existing-targets := $(wildcard $(sort $(targets))) | 1760 | existing-targets := $(wildcard $(sort $(targets))) |
| 1762 | 1761 | ||
| 1763 | cmd_files := $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) | 1762 | -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) |
| 1764 | $(cmd_files): ; # Do not try to update included dependency files | ||
| 1765 | -include $(cmd_files) | ||
| 1766 | 1763 | ||
| 1767 | endif # ifeq ($(config-targets),1) | 1764 | endif # ifeq ($(config-targets),1) |
| 1768 | endif # ifeq ($(mixed-targets),1) | 1765 | endif # ifeq ($(mixed-targets),1) |
