Skip to contentSkip to conversation

docs/Makefile: Split the install target

PATCH In review Andrew Cooper 2 participants 2 messages Jan 3, 2014 – Jan 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/Makefile: Split the install target

Split the current install target into two subtargets, install-man-pages and install-html, with the main install target depending on both.

This helps packagers who want the man pages to put in appropriate rpms/debs, but don't want to build the html developer docs.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC George Dunlap <[email protected]>

---

I am slightly dubious as to the behaviour of rm-rf'ing the DOCDIR, but the behaviour is left exactly as before, for sake-of-mind when reviewing.

I would like this to be taken for 4.4, as I have fallen over it yet again when packing 4.4-rc1 for testing in XenServer. Unlike some of my other fixes to the Xen build system, this is trivial to fix correctly upstream, and will benefit everyone trying to package 4.4 for distros.

---
 docs/Makefile |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
docs/Makefile +10 -5
index 8d5d48e..e4bf28c 100644
@@ -78,16 +78,21 @@ distclean: clean
 	rm -rf $(XEN_ROOT)/config/Docs.mk config.log config.status config.cache \
 		autom4te.cache
 
-.PHONY: install
-install: all
-	rm -rf $(DESTDIR)$(DOCDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
-
+.PHONY: install-man-pages
+install-man-pages: man-pages
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
 	cp -R man1 $(DESTDIR)$(MANDIR)
 	cp -R man5 $(DESTDIR)$(MANDIR)
+
+.PHONY: install-html
+install-html: html txt figs
+	rm -rf $(DESTDIR)$(DOCDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
 	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
+.PHONY: install
+install: install-man-pages install-html
+
 html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX
 	$(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML)
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 11 lines · Andrew Cooper

Split the current install target into two subtargets, install-man-pages and install-html, with the main install target depending on both.

This helps packagers who want the man pages to put in appropriate rpms/debs, but don't want to build the html developer docs.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC George Dunlap <[email protected]>
Quoted 4 lines

---

I am slightly dubious as to the behaviour of rm-rf'ing the DOCDIR, but the behaviour is left exactly as before, for sake-of-mind when reviewing.

It is rather suspect I agree.

Quoted 4 lines

I would like this to be taken for 4.4, as I have fallen over it yet again when packing 4.4-rc1 for testing in XenServer. Unlike some of my other fixes to the Xen build system, this is trivial to fix correctly upstream, and will benefit everyone trying to package 4.4 for distros.

I presume the majority of people packaging Xen for distros either already have the appropriate patch or actually do want the docs. In fact I think your requirement to strip them out is likely to be a very minority one, most distros package the docs for the software they are shipping (maybe in a separate package).

Why don't you make the XenServer build system build a xen-docs(-html) package and then not install it anywhere, or delete it, or put it in your SDK or something?

In any case if there is a need for this level of control over which types of docs get built and installed it should probably be done at the configure level rather than the install target level.

Ian.

Quoted 35 lines
---
 docs/Makefile |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
docs/Makefile +10 -5
index 8d5d48e..e4bf28c 100644
@@ -78,16 +78,21 @@ distclean: clean
 	rm -rf $(XEN_ROOT)/config/Docs.mk config.log config.status config.cache \
 		autom4te.cache
 
-.PHONY: install
-install: all
-	rm -rf $(DESTDIR)$(DOCDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
-
+.PHONY: install-man-pages
+install-man-pages: man-pages
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
 	cp -R man1 $(DESTDIR)$(MANDIR)
 	cp -R man5 $(DESTDIR)$(MANDIR)
+
+.PHONY: install-html
+install-html: html txt figs
+	rm -rf $(DESTDIR)$(DOCDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
 	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
+.PHONY: install
+install: install-man-pages install-html
+
 html/index.html: $(DOC_HTML) $(CURDIR)/gen-html-index INDEX
 	$(PERL) -w -- $(CURDIR)/gen-html-index -i INDEX html $(DOC_HTML)