Makefile: Ship nitsi.in in tarball
[nitsi.git] / Makefile.am
CommitLineData
2fa4467d
JS
1ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2AM_MAKEFLAGS = --no-print-directory
3AUTOMAKE_OPTIONS = color-tests
4
5# remove target it the command fails
6.DELETE_ON_ERROR:
7
8# keep itermediate files
9.SECONDARY:
10
11pythondir = $(pyexecdir)
12
13CLEANFILES =
14DISTCLEANFILES =
15EXTRA_DIST =
16INSTALL_DIRS =
17noinst_DATA =
18
2fa4467d
JS
19AM_V_XSLT = $(AM_V_XSLT_$(V))
20AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
21AM_V_XSLT_0 = @echo " XSLT " $@;
22
23bin_SCRIPTS = \
24 nitsi
25
26CLEANFILES += \
27 nitsi
28
dcf87b0a
MT
29EXTRA_DIST += \
30 nitsi.in
31
2fa4467d
JS
32nitsi_PYTHON = \
33 src/nitsi/__init__.py \
34 src/nitsi/disk.py \
23bfbec7 35 src/nitsi/logger.py \
2fa4467d
JS
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
2fa4467d
JS
43nitsidir = $(pythondir)/nitsi
44
45# ------------------------------------------------------------------------------
46
47.PHONY: man
48man: $(MANPAGES) $(MANPAGES_HTML)
49
50if ENABLE_MANPAGES
51MANPAGES = \
20b41754
JS
52 man/nitsi.1 \
53 man/nitsi.settings.1 \
54 man/nitsi.recipe.1
2fa4467d
JS
55
56MANPAGES_XML = $(patsubst %.1,%.xml,$(patsubst %.5,%.xml,$(MANPAGES)))
57MANPAGES_HTML = $(patsubst %.xml,%.html,$(MANPAGES_XML))
58
59man_MANS = \
60 $(MANPAGES)
61
62noinst_DATA += \
63 $(MANPAGES_HTML)
64
65CLEANFILES += \
66 $(man_MANS) \
67 $(MANPAGES_HTML)
68
69EXTRA_DIST += \
70 $(MANPAGES_XML) \
71 man/custom-html.xsl
72
73XSLTPROC_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
81XSLTPROC_COMMAND_MAN = \
82 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) \
83 http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
84
85XSLTPROC_COMMAND_HTML = \
86 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
87
88man/%.1: man/%.xml
89 $(XSLTPROC_COMMAND_MAN)
90
91man/%.5: man/%.xml
92 $(XSLTPROC_COMMAND_MAN)
93
94man/%.html: man/%.xml man/custom-html.xsl
95 $(XSLTPROC_COMMAND_HTML)
2fa4467d
JS
96endif
97
98# ------------------------------------------------------------------------------
99
100substitutions = \
101 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
102 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|'
103
104SED_PROCESS = \
105 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
106 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
107 < $< > $@
108
109nitsi: nitsi.in Makefile
110 $(SED_PROCESS)