aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 20:52:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 20:52:31 -0400
commitb003d7706abc5d75cb58de0c9de8f1fc77e57008 (patch)
tree2cb773a113d2300a1f5a8b706ecc890ffe8a7338
parent3573d3869de475cca9f2d4998fc3c2871a4cc2db (diff)
parentb12f73740b8764952a112a677991300545e98c06 (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/Makefile25
-rw-r--r--Makefile10
-rw-r--r--scripts/Kbuild.include1
-rw-r--r--scripts/Makefile6
-rw-r--r--scripts/Makefile.lib4
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
19include $(srctree)/Documentation/DocBook/media/Makefile 19include 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.
37PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs 37PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
38 38
39targets += $(DOCBOOKS)
39BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) 40BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
40xmldocs: $(BOOKS) 41xmldocs: $(BOOKS)
41sgmldocs: xmldocs 42sgmldocs: xmldocs
@@ -58,14 +59,14 @@ mandocs: $(MAN)
58 59
59installmandocs: mandocs 60installmandocs: 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
65KERNELDOC = $(srctree)/scripts/kernel-doc 66KERNELDOC = $(srctree)/scripts/kernel-doc
66DOCPROC = $(objtree)/scripts/docproc 67DOCPROC = $(objtree)/scripts/docproc
67 68
68XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl 69XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl
69XMLTOFLAGS += --skip-validation 70XMLTOFLAGS += --skip-validation
70 71
71### 72###
@@ -87,21 +88,9 @@ define rule_docproc
87 ) > $(dir $@).$(notdir $@).cmd 88 ) > $(dir $@).$(notdir $@).cmd
88endef 89endef
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
95cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd))
96
97ifneq ($(cmd_files),)
98 include $(cmd_files)
99endif
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
106always := $(hostprogs-y) 95always := $(hostprogs-y)
107 96
@@ -139,7 +128,7 @@ quiet_cmd_db2pdf = PDF $@
139 128
140 129
141index = index.html 130index = index.html
142main_idx = Documentation/DocBook/$(index) 131main_idx = $(obj)/$(index)
143build_main_index = rm -rf $(main_idx); \ 132build_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); \
148quiet_cmd_db2html = HTML $@ 137quiet_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) || \
diff --git a/Makefile b/Makefile
index 00a933bb1f41..cf3e07516a04 100644
--- a/Makefile
+++ b/Makefile
@@ -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
122saved-output := $(KBUILD_OUTPUT) 122saved-output := $(KBUILD_OUTPUT)
123KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) 123KBUILD_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
127PHONY += $(MAKECMDGOALS) sub-make 128PHONY += $(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
5comma := , 5comma := ,
6quote := "
6squote := ' 7squote := '
7empty := 8empty :=
8space := $(empty) $(empty) 9space := $(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)
27hostprogs-y += unifdef docproc 27hostprogs-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
30PHONY += build_unifdef 30PHONY += build_unifdef build_docproc
31build_unifdef: scripts/unifdef FORCE 31build_unifdef: $(obj)/unifdef
32 @: 32 @:
33build_docproc: scripts/docproc FORCE 33build_docproc: $(obj)/docproc
34 @: 34 @:
35 35
36subdir-$(CONFIG_MODVERSIONS) += genksyms 36subdir-$(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 $@
380cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ 380cmd_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# ---------------------------------------------------------------------------
386quote:="