diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 20:52:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 20:52:31 -0400 |
| commit | b003d7706abc5d75cb58de0c9de8f1fc77e57008 (patch) | |
| tree | 2cb773a113d2300a1f5a8b706ecc890ffe8a7338 | |
| parent | 3573d3869de475cca9f2d4998fc3c2871a4cc2db (diff) | |
| parent | b12f73740b8764952a112a677991300545e98c06 (diff) | |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild changes from Michal Marek:
- cleanups in the main Makefiles and Documentation/DocBook/Makefile
- make O=... directory is automatically created if needed
- mrproper/distclean removes the old include/linux/version.h to make
life easier when bisecting across the commit that moved the version.h
file
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kbuild: docbook: fix the include error when executing "make help"
kbuild: create a build directory automatically for out-of-tree build
kbuild: remove redundant '.*.cmd' pattern from make distclean
kbuild: move "quote" to Kbuild.include to be consistent
kbuild: docbook: use $(obj) and $(src) rather than specific path
kbuild: unconditionally clobber include/linux/version.h on distclean
kbuild: docbook: specify KERNELDOC dependency correctly
kbuild: docbook: include cmd files more simply
kbuild: specify build_docproc as a phony target
| -rw-r--r-- | Documentation/DocBook/Makefile | 25 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | scripts/Kbuild.include | 1 | ||||
| -rw-r--r-- | scripts/Makefile | 6 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 4 |
5 files changed, 16 insertions, 30 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 8d96ebf524e9..b444f2e8fe32 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
| @@ -16,7 +16,7 @@ DOCBOOKS := z8530book.xml device-drivers.xml \ | |||
| 16 | alsa-driver-api.xml writing-an-alsa-driver.xml \ | 16 | alsa-driver-api.xml writing-an-alsa-driver.xml \ |
| 17 | tracepoint.xml drm.xml media_api.xml w1.xml | 17 | tracepoint.xml drm.xml media_api.xml w1.xml |
| 18 | 18 | ||
| 19 | include $(srctree)/Documentation/DocBook/media/Makefile | 19 | include Documentation/DocBook/media/Makefile |
| 20 | 20 | ||
| 21 | ### | 21 | ### |
| 22 | # The build process is as follows (targets): | 22 | # The build process is as follows (targets): |
| @@ -36,6 +36,7 @@ PS_METHOD = $(prefer-db2x) | |||
| 36 | # The targets that may be used. | 36 | # The targets that may be used. |
| 37 | PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs | 37 | PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs |
| 38 | 38 | ||
| 39 | targets += $(DOCBOOKS) | ||
| 39 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) | 40 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) |
| 40 | xmldocs: $(BOOKS) | 41 | xmldocs: $(BOOKS) |
| 41 | sgmldocs: xmldocs | 42 | sgmldocs: xmldocs |
| @@ -58,14 +59,14 @@ mandocs: $(MAN) | |||
| 58 | 59 | ||
| 59 | installmandocs: mandocs | 60 | installmandocs: mandocs |
| 60 | mkdir -p /usr/local/man/man9/ | 61 | mkdir -p /usr/local/man/man9/ |
| 61 | install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/ | 62 | install $(obj)/man/*.9.gz /usr/local/man/man9/ |
| 62 | 63 | ||
| 63 | ### | 64 | ### |
| 64 | #External programs used | 65 | #External programs used |
| 65 | KERNELDOC = $(srctree)/scripts/kernel-doc | 66 | KERNELDOC = $(srctree)/scripts/kernel-doc |
| 66 | DOCPROC = $(objtree)/scripts/docproc | 67 | DOCPROC = $(objtree)/scripts/docproc |
| 67 | 68 | ||
| 68 | XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl | 69 | XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl |
| 69 | XMLTOFLAGS += --skip-validation | 70 | XMLTOFLAGS += --skip-validation |
| 70 | 71 | ||
| 71 | ### | 72 | ### |
| @@ -87,21 +88,9 @@ define rule_docproc | |||
| 87 | ) > $(dir $@).$(notdir $@).cmd | 88 | ) > $(dir $@).$(notdir $@).cmd |
| 88 | endef | 89 | endef |
| 89 | 90 | ||
| 90 | %.xml: %.tmpl FORCE | 91 | %.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE |
| 91 | $(call if_changed_rule,docproc) | 92 | $(call if_changed_rule,docproc) |
| 92 | 93 | ||
| 93 | ### | ||
| 94 | #Read in all saved dependency files | ||
| 95 | cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd)) | ||
| 96 | |||
| 97 | ifneq ($(cmd_files),) | ||
| 98 | include $(cmd_files) | ||
| 99 | endif | ||
| 100 | |||
| 101 | ### | ||
| 102 | # Changes in kernel-doc force a rebuild of all documentation | ||
| 103 | $(BOOKS): $(KERNELDOC) | ||
| 104 | |||
| 105 | # Tell kbuild to always build the programs | 94 | # Tell kbuild to always build the programs |
| 106 | always := $(hostprogs-y) | 95 | always := $(hostprogs-y) |
| 107 | 96 | ||
| @@ -139,7 +128,7 @@ quiet_cmd_db2pdf = PDF $@ | |||
| 139 | 128 | ||
| 140 | 129 | ||
| 141 | index = index.html | 130 | index = index.html |
| 142 | main_idx = Documentation/DocBook/$(index) | 131 | main_idx = $(obj)/$(index) |
| 143 | build_main_index = rm -rf $(main_idx); \ | 132 | build_main_index = rm -rf $(main_idx); \ |
| 144 | echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ | 133 | echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ |
| 145 | echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ | 134 | echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ |
| @@ -148,7 +137,7 @@ build_main_index = rm -rf $(main_idx); \ | |||
| 148 | quiet_cmd_db2html = HTML $@ | 137 | quiet_cmd_db2html = HTML $@ |
| 149 | cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ | 138 | cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ |
| 150 | echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ | 139 | echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ |
| 151 | $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ | 140 | $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ |
| 152 | 141 | ||
| 153 | %.html: %.xml | 142 | %.html: %.xml |
| 154 | @(which xmlto > /dev/null 2>&1) || \ | 143 | @(which xmlto > /dev/null 2>&1) || \ |
| @@ -120,9 +120,10 @@ ifneq ($(KBUILD_OUTPUT),) | |||
| 120 | # Invoke a second make in the output directory, passing relevant variables | 120 | # Invoke a second make in the output directory, passing relevant variables |
| 121 | # check that the output directory actually exists | 121 | # check that the output directory actually exists |
| 122 | saved-output := $(KBUILD_OUTPUT) | 122 | saved-output := $(KBUILD_OUTPUT) |
| 123 | KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | 123 | KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ |
| 124 | && /bin/pwd) | ||
| 124 | $(if $(KBUILD_OUTPUT),, \ | 125 | $(if $(KBUILD_OUTPUT),, \ |
| 125 | $(error output directory "$(saved-output)" does not exist)) | 126 | $(error failed to create output directory "$(saved-output)")) |
| 126 | 127 | ||
| 127 | PHONY += $(MAKECMDGOALS) sub-make | 128 | PHONY += $(MAKECMDGOALS) sub-make |
| 128 | 129 | ||
| @@ -1079,7 +1080,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ | |||
| 1079 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ | 1080 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ |
| 1080 | signing_key.priv signing_key.x509 x509.genkey \ | 1081 | signing_key.priv signing_key.x509 x509.genkey \ |
| 1081 | extra_certificates signing_key.x509.keyid \ | 1082 | extra_certificates signing_key.x509.keyid \ |
| 1082 | signing_key.x509.signer | 1083 | signing_key.x509.signer include/linux/version.h |
| 1083 | 1084 | ||
| 1084 | # clean - Delete most, but leave enough to build external modules | 1085 | # clean - Delete most, but leave enough to build external modules |
| 1085 | # | 1086 | # |
| @@ -1118,8 +1119,7 @@ distclean: mrproper | |||
| 1118 | @find $(srctree) $(RCS_FIND_IGNORE) \ | 1119 | @find $(srctree) $(RCS_FIND_IGNORE) \ |
| 1119 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | 1120 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
| 1120 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ | 1121 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ |
| 1121 | -o -name '.*.rej' \ | 1122 | -o -name '.*.rej' -o -name '*%' -o -name 'core' \) \ |
| 1122 | -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ | ||
| 1123 | -type f -print | xargs rm -f | 1123 | -type f -print | xargs rm -f |
| 1124 | 1124 | ||
| 1125 | 1125 | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 93a0da26582b..122f95c95869 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | # Convenient variables | 4 | # Convenient variables |
| 5 | comma := , | 5 | comma := , |
| 6 | quote := " | ||
| 6 | squote := ' | 7 | squote := ' |
| 7 | empty := | 8 | empty := |
| 8 | space := $(empty) $(empty) | 9 | space := $(empty) $(empty) |
diff --git a/scripts/Makefile b/scripts/Makefile index 01e7adb838d9..1d07860f6c42 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
| @@ -27,10 +27,10 @@ always := $(hostprogs-y) $(hostprogs-m) | |||
| 27 | hostprogs-y += unifdef docproc | 27 | hostprogs-y += unifdef docproc |
| 28 | 28 | ||
| 29 | # These targets are used internally to avoid "is up to date" messages | 29 | # These targets are used internally to avoid "is up to date" messages |
| 30 | PHONY += build_unifdef | 30 | PHONY += build_unifdef build_docproc |
| 31 | build_unifdef: scripts/unifdef FORCE | 31 | build_unifdef: $(obj)/unifdef |
| 32 | @: | 32 | @: |
| 33 | build_docproc: scripts/docproc FORCE | 33 | build_docproc: $(obj)/docproc |
| 34 | @: | 34 | @: |
| 35 | 35 | ||
| 36 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 36 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 72105d104357..6a5b0decb797 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -380,7 +380,3 @@ quiet_cmd_xzmisc = XZMISC $@ | |||
| 380 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ | 380 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ |
| 381 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ | 381 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ |
| 382 | (rm -f $@ ; false) | 382 | (rm -f $@ ; false) |
| 383 | |||
| 384 | # misc stuff | ||
| 385 | # --------------------------------------------------------------------------- | ||
| 386 | quote:=" | ||
