Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: /
Date: Mon, 10 Feb 2020 17:31:53
Message-Id: 1581098395.c90f1ae71883907bf2c94949a6e69e066888985b.ulm@gentoo
1 commit: c90f1ae71883907bf2c94949a6e69e066888985b
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 7 13:39:20 2020 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 7 17:59:55 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=c90f1ae7
7
8 Makefile: Add install target.
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 Makefile | 21 ++++++++++++++++++++-
13 1 file changed, 20 insertions(+), 1 deletion(-)
14
15 diff --git a/Makefile b/Makefile
16 index 7b5569f..d8e3547 100644
17 --- a/Makefile
18 +++ b/Makefile
19 @@ -7,6 +7,14 @@ HTMLS := $(subst text.xml,index.html,$(XMLS))
20 ECLASS_HTMLS := $(filter ./eclass-reference/%/index.html,$(ALL_FILES))
21 IMAGES := $(patsubst %.svg,%.png,$(SVGS))
22
23 +CSS_FILES = devmanual.css offline.css
24 +JS_FILES = search.js documents.js
25 +
26 +prefix = /usr/local/share
27 +docdir = $(prefix)/doc/devmanual
28 +htmldir = $(docdir)
29 +DESTDIR =
30 +
31 # Nonzero value disables external assets for offline browsing.
32 OFFLINE = 0
33
34 @@ -54,6 +62,17 @@ documents.js: bin/build_search_documents.py $(XMLS)
35 %.html: $$(dir $$@)text.xml devbook.xsl xsl/*.xsl $$(subst text.xml,index.html,$$(wildcard $$(dir $$@)*/text.xml))
36 xsltproc --param offline "$(OFFLINE)" devbook.xsl $< > $@
37
38 +install: all
39 + set -e; \
40 + for file in $(HTMLS) $(ECLASS_HTMLS) $(IMAGES); do \
41 + install -d "$(DESTDIR)$(htmldir)"/$${file%/*}; \
42 + install -m 644 $${file} "$(DESTDIR)$(htmldir)"/$${file}; \
43 + done
44 + install -m 644 $(CSS_FILES) "$(DESTDIR)$(htmldir)"/
45 + if test $(OFFLINE) -eq 0; then \
46 + install -m 644 $(JS_FILES) "$(DESTDIR)$(htmldir)"/; \
47 + fi
48 +
49 validate:
50 @xmllint --noout --dtdvalid devbook.dtd $(XMLS) \
51 && echo "xmllint validation successful"
52 @@ -80,4 +99,4 @@ delete-old:
53 clean:
54 @rm -f $(HTMLS) $(IMAGES) _documents.js documents.js
55
56 -.PHONY: all prereq validate build tidy delete-old clean
57 +.PHONY: all prereq build install validate tidy delete-old clean