Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+16 -30
+7 -18
Documentation/DocBook/Makefile
··· 16 16 alsa-driver-api.xml writing-an-alsa-driver.xml \ 17 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 22 # The build process is as follows (targets): ··· 36 36 # The targets that may be used. 37 37 PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs 38 38 39 + targets += $(DOCBOOKS) 39 40 BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) 40 41 xmldocs: $(BOOKS) 41 42 sgmldocs: xmldocs ··· 59 58 60 59 installmandocs: mandocs 61 60 mkdir -p /usr/local/man/man9/ 62 - install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/ 61 + install $(obj)/man/*.9.gz /usr/local/man/man9/ 63 62 64 63 ### 65 64 #External programs used 66 65 KERNELDOC = $(srctree)/scripts/kernel-doc 67 66 DOCPROC = $(objtree)/scripts/docproc 68 67 69 - XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl 68 + XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl 70 69 XMLTOFLAGS += --skip-validation 71 70 72 71 ### ··· 88 87 ) > $(dir $@).$(notdir $@).cmd 89 88 endef 90 89 91 - %.xml: %.tmpl FORCE 90 + %.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE 92 91 $(call if_changed_rule,docproc) 93 - 94 - ### 95 - #Read in all saved dependency files 96 - cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd)) 97 - 98 - ifneq ($(cmd_files),) 99 - include $(cmd_files) 100 - endif 101 - 102 - ### 103 - # Changes in kernel-doc force a rebuild of all documentation 104 - $(BOOKS): $(KERNELDOC) 105 92 106 93 # Tell kbuild to always build the programs 107 94 always := $(hostprogs-y) ··· 128 139 129 140 130 141 index = index.html 131 - main_idx = Documentation/DocBook/$(index) 142 + main_idx = $(obj)/$(index) 132 143 build_main_index = rm -rf $(main_idx); \ 133 144 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ 134 145 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ ··· 137 148 quiet_cmd_db2html = HTML $@ 138 149 cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ 139 150 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ 140 - $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ 151 + $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ 141 152 142 153 %.html: %.xml 143 154 @(which xmlto > /dev/null 2>&1) || \
+5 -5
Makefile
··· 120 120 # Invoke a second make in the output directory, passing relevant variables 121 121 # check that the output directory actually exists 122 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 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 128 PHONY += $(MAKECMDGOALS) sub-make 128 129 ··· 1080 1079 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ 1081 1080 signing_key.priv signing_key.x509 x509.genkey \ 1082 1081 extra_certificates signing_key.x509.keyid \ 1083 - signing_key.x509.signer 1082 + signing_key.x509.signer include/linux/version.h 1084 1083 1085 1084 # clean - Delete most, but leave enough to build external modules 1086 1085 # ··· 1119 1118 @find $(srctree) $(RCS_FIND_IGNORE) \ 1120 1119 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 1121 1120 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ 1122 - -o -name '.*.rej' \ 1123 - -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ 1121 + -o -name '.*.rej' -o -name '*%' -o -name 'core' \) \ 1124 1122 -type f -print | xargs rm -f 1125 1123 1126 1124
+1
scripts/Kbuild.include
··· 3 3 4 4 # Convenient variables 5 5 comma := , 6 + quote := " 6 7 squote := ' 7 8 empty := 8 9 space := $(empty) $(empty)
+3 -3
scripts/Makefile
··· 27 27 hostprogs-y += unifdef docproc 28 28 29 29 # These targets are used internally to avoid "is up to date" messages 30 - PHONY += build_unifdef 31 - build_unifdef: scripts/unifdef FORCE 30 + PHONY += build_unifdef build_docproc 31 + build_unifdef: $(obj)/unifdef 32 32 @: 33 - build_docproc: scripts/docproc FORCE 33 + build_docproc: $(obj)/docproc 34 34 @: 35 35 36 36 subdir-$(CONFIG_MODVERSIONS) += genksyms
-4
scripts/Makefile.lib
··· 380 380 cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ 381 381 xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ 382 382 (rm -f $@ ; false) 383 - 384 - # misc stuff 385 - # --------------------------------------------------------------------------- 386 - quote:="