diff options
author | Ola Jeppsson <ola.jeppsson@gmail.com> | 2019-10-08 16:07:55 -0400 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-10-22 15:49:19 -0700 |
commit | 9154a02f89d7df387b40f02f1b9fbdc5607633d7 (patch) | |
tree | 9f2a3aef02b2bc53eb65bb2b3fad84591fc1de6b /doc | |
parent | 397464beddcd6004f868cc69214dfde15b19be8d (diff) | |
download | memcached-9154a02f89d7df387b40f02f1b9fbdc5607633d7.tar.gz |
doc: Fix out-of-tree build
Out-of-tree build didn't work for doc/ since $(srcdir) was not prepended
to the source files.
This solution uses pattern substitutions and make automatic variables.
Here 'make' will use VPATH (set by Automake) so $(srcdir) isn't needed.
Remove use of wildcards, Automake does not support them.
https://www.gnu.org/software/automake/manual/html_node/Wildcards.html
Always include built specifications when make dist.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Makefile.am | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 484bf9a..daee615 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,23 +1,36 @@ man_MANS = memcached.1 -EXTRA_DIST = *.txt - -BUILT_SOURCES= - +SPECIFICATIONS = protocol-binary.txt protocol-binary-range.txt + +EXTRA_DIST = new_lru.txt \ + protocol.txt \ + readme.txt \ + storage.txt \ + threads.txt \ + tls.txt +# When we make dist always include the generated specifications so people don't +# have to have xml2rfc and xsltproc installed +EXTRA_DIST += $(SPECIFICATIONS) + +BUILT_SOURCES = +MOSTLYCLEANFILES = if BUILD_SPECIFICATIONS -BUILT_SOURCES += protocol-binary.txt protocol-binary-range.txt -MOSTLYCLEANFILES = protocol-binary.txt protocol-binary-range.txt +BUILT_SOURCES += $(SPECIFICATIONS) +MOSTLYCLEANFILES += $(SPECIFICATIONS) endif -protocol-binary.txt: protocol-binary.full - @XML2RFC@ -c @abs_builddir@ protocol-binary.full $@ +RFC2629_XSL = $(srcdir)/xml2rfc/rfc2629-noinc.xsl + +%.txt: %.full + @XML2RFC@ -c $(builddir) $< $@ -protocol-binary-range.txt: protocol-binary-range.full - @XML2RFC@ -c @abs_builddir@ protocol-binary-range.full $@ +%.full: %.xml $(RFC2629_XSL) + @XSLTPROC@ --nonet $(RFC2629_XSL) $< > $@ -protocol-binary.full: protocol-binary.xml xml2rfc/rfc2629-noinc.xsl - @XSLTPROC@ --nonet xml2rfc/rfc2629-noinc.xsl protocol-binary.xml > $@ +# Prevent make from deleting intermediate files +all-full: $(SPECIFICATIONS:.txt=.full) -protocol-binary-range.full: protocol-binary-range.xml xml2rfc/rfc2629-noinc.xsl - @XSLTPROC@ --nonet xml2rfc/rfc2629-noinc.xsl protocol-binary-range.xml > $@ +clean-local: + rm -f $(SPECIFICATIONS:.txt=.full) +.PHONY: all-full |