]> git.ipfire.org Git - nitsi.git/blob - Makefile.am
man: the nitsi.settings and nitsi.recipe pages should be category 5
[nitsi.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2 AM_MAKEFLAGS = --no-print-directory
3 AUTOMAKE_OPTIONS = color-tests
4
5 # remove target it the command fails
6 .DELETE_ON_ERROR:
7
8 # keep itermediate files
9 .SECONDARY:
10
11 pythondir = $(pyexecdir)
12
13 CLEANFILES =
14 DISTCLEANFILES =
15 EXTRA_DIST =
16 INSTALL_DIRS =
17 noinst_DATA =
18
19 AM_V_XSLT = $(AM_V_XSLT_$(V))
20 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
21 AM_V_XSLT_0 = @echo " XSLT " $@;
22
23 bin_SCRIPTS = \
24 nitsi
25
26 CLEANFILES += \
27 nitsi
28
29 EXTRA_DIST += \
30 nitsi.in
31
32 nitsi_PYTHON = \
33 src/nitsi/__init__.py \
34 src/nitsi/disk.py \
35 src/nitsi/logger.py \
36 src/nitsi/machine.py \
37 src/nitsi/network.py \
38 src/nitsi/recipe.py \
39 src/nitsi/serial_connection.py \
40 src/nitsi/test.py \
41 src/nitsi/virtual_environ.py
42
43 nitsidir = $(pythondir)/nitsi
44
45 # ------------------------------------------------------------------------------
46
47 .PHONY: man
48 man: $(MANPAGES) $(MANPAGES_HTML)
49
50 if ENABLE_MANPAGES
51 MANPAGES = \
52 man/nitsi.1 \
53 man/nitsi.settings.5 \
54 man/nitsi.recipe.5
55
56 MANPAGES_XML = $(patsubst %.1,%.xml,$(patsubst %.5,%.xml,$(MANPAGES)))
57 MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
58
59 man_MANS = \
60 $(MANPAGES)
61
62 noinst_DATA += \
63 $(MANPAGES_HTML)
64
65 CLEANFILES += \
66 $(man_MANS) \
67 $(MANPAGES_HTML)
68
69 EXTRA_DIST += \
70 $(MANPAGES_XML) \
71 man/custom-html.xsl
72
73 XSLTPROC_FLAGS = \
74 --nonet \
75 --stringparam man.output.quietly 1 \
76 --stringparam funcsynopsis.style ansi \
77 --stringparam man.th.extra1.suppress 1 \
78 --stringparam man.authors.section.enabled 1 \
79 --stringparam man.copyright.section.enabled 1
80
81 XSLTPROC_COMMAND_MAN = \
82 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
83 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
84
85 XSLTPROC_COMMAND_HTML = \
86 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
87
88 man/%.1: man/%.xml
89 $(XSLTPROC_COMMAND_MAN)
90
91 man/%.5: man/%.xml
92 $(XSLTPROC_COMMAND_MAN)
93
94 man/%.html: man/%.xml man/custom-html.xsl
95 $(XSLTPROC_COMMAND_HTML)
96 endif
97
98 # ------------------------------------------------------------------------------
99
100 substitutions = \
101 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
102 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|'
103
104 SED_PROCESS = \
105 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
106 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
107 < $< > $@
108
109 nitsi: nitsi.in Makefile
110 $(SED_PROCESS)