Skip to content

Commit b003d77

Browse files
committed
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
2 parents 3573d38 + b12f737 commit b003d77

5 files changed

Lines changed: 16 additions & 30 deletions

File tree

‎Documentation/DocBook/Makefile‎

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DOCBOOKS := z8530book.xml device-drivers.xml \
1616
alsa-driver-api.xml writing-an-alsa-driver.xml \
1717
tracepoint.xml drm.xml media_api.xml w1.xml
1818

19-
include $(srctree)/Documentation/DocBook/media/Makefile
19+
include Documentation/DocBook/media/Makefile
2020

2121
###
2222
# The build process is as follows (targets):
@@ -36,6 +36,7 @@ PS_METHOD = $(prefer-db2x)
3636
# The targets that may be used.
3737
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
3838

39+
targets += $(DOCBOOKS)
3940
BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
4041
xmldocs: $(BOOKS)
4142
sgmldocs: xmldocs
@@ -58,14 +59,14 @@ mandocs: $(MAN)
5859

5960
installmandocs: mandocs
6061
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/
6263

6364
###
6465
#External programs used
6566
KERNELDOC = $(srctree)/scripts/kernel-doc
6667
DOCPROC = $(objtree)/scripts/docproc
6768

68-
XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
69+
XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl
6970
XMLTOFLAGS += --skip-validation
7071

7172
###
@@ -87,21 +88,9 @@ define rule_docproc
8788
) > $(dir $@).$(notdir $@).cmd
8889
endef
8990

90-
%.xml: %.tmpl FORCE
91+
%.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE
9192
$(call if_changed_rule,docproc)
9293

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-
10594
# Tell kbuild to always build the programs
10695
always := $(hostprogs-y)
10796

@@ -139,7 +128,7 @@ quiet_cmd_db2pdf = PDF $@
139128

140129

141130
index = index.html
142-
main_idx = Documentation/DocBook/$(index)
131+
main_idx = $(obj)/$(index)
143132
build_main_index = rm -rf $(main_idx); \
144133
echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
145134
echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
@@ -148,7 +137,7 @@ build_main_index = rm -rf $(main_idx); \
148137
quiet_cmd_db2html = HTML $@
149138
cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
150139
echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
151-
$(patsubst %.html,%,$(notdir $@))</a><p>' > $@
140+
$(patsubst %.html,%,$(notdir $@))</a><p>' > $@
152141

153142
%.html: %.xml
154143
@(which xmlto > /dev/null 2>&1) || \

‎Makefile‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ ifneq ($(KBUILD_OUTPUT),)
120120
# Invoke a second make in the output directory, passing relevant variables
121121
# check that the output directory actually exists
122122
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)
124125
$(if $(KBUILD_OUTPUT),, \
125-
$(error output directory "$(saved-output)" does not exist))
126+
$(error failed to create output directory "$(saved-output)"))
126127

127128
PHONY += $(MAKECMDGOALS) sub-make
128129

@@ -1079,7 +1080,7 @@ MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
10791080
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
10801081
signing_key.priv signing_key.x509 x509.genkey \
10811082
extra_certificates signing_key.x509.keyid \
1082-
signing_key.x509.signer
1083+
signing_key.x509.signer include/linux/version.h
10831084

10841085
# clean - Delete most, but leave enough to build external modules
10851086
#
@@ -1118,8 +1119,7 @@ distclean: mrproper
11181119
@find $(srctree) $(RCS_FIND_IGNORE) \
11191120
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
11201121
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
1121-
-o -name '.*.rej' \
1122-
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
1122+
-o -name '.*.rej' -o -name '*%' -o -name 'core' \) \
11231123
-type f -print | xargs rm -f
11241124

11251125

‎scripts/Kbuild.include‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Convenient variables
55
comma := ,
6+
quote := "
67
squote := '
78
empty :=
89
space := $(empty) $(empty)

‎scripts/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ always := $(hostprogs-y) $(hostprogs-m)
2727
hostprogs-y += unifdef docproc
2828

2929
# 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
3232
@:
33-
build_docproc: scripts/docproc FORCE
33+
build_docproc: $(obj)/docproc
3434
@:
3535

3636
subdir-$(CONFIG_MODVERSIONS) += genksyms

‎scripts/Makefile.lib‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,3 @@ quiet_cmd_xzmisc = XZMISC $@
380380
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
381381
xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
382382
(rm -f $@ ; false)
383-
384-
# misc stuff
385-
# ---------------------------------------------------------------------------
386-
quote:="

0 commit comments

Comments
 (0)