summaryrefslogtreecommitdiffstats
path: root/doc/userguide/Makefile.am
blob: bd157920cfac7ff30e0c599cbd5dba75c5d8f63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
EXTRA_DIST = \
	_static \
	3rd-party-integration \
	acknowledgements.rst \
	capture-hardware \
	command-line-options.rst \
	conf.py \
	configuration \
	devguide \
	file-extraction \
	index.rst \
	upgrade \
	upgrade.rst \
	initscripts.rst \
	install.rst \
	licenses \
	lua \
	make-sense-alerts.rst \
	manpages \
	output \
	partials \
	performance \
	public-data-sets.rst \
	quickstart.rst \
	reputation \
	rule-management \
	rules \
	security.rst \
	setting-up-ipsinline-for-linux \
	setting-up-ipsinline-for-linux.rst \
	setting-up-ipsinline-for-windows.rst \
	support-status.rst \
	unix-socket.rst \
	what-is-suricata.rst

if HAVE_SURICATA_MAN
dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1
endif

if SPHINX_BUILD
dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1

if HAVE_PDFLATEX
EXTRA_DIST += userguide.pdf
endif

SPHINX_BUILD = sphinx-build -q

html:
	sysconfdir=$(sysconfdir) \
	localstatedir=$(localstatedir) \
	version=$(PACKAGE_VERSION) \
		$(SPHINX_BUILD) -W -b html -d _build/doctrees \
		$(top_srcdir)/doc/userguide _build/html

_build/latex/Suricata.pdf:
	sysconfdir=$(sysconfdir) \
	localstatedir=$(localstatedir) \
	version=$(PACKAGE_VERSION) \
		$(SPHINX_BUILD) -W -b latex -d _build/doctrees \
		$(top_srcdir)/doc/userguide _build/latex
# The Sphinx generated Makefile is GNU Make specific, so just do what
# it does here - yes, multiple passes of pdflatex is required.
	cd _build/latex && pdflatex Suricata.tex
	cd _build/latex && pdflatex Suricata.tex
	cd _build/latex && pdflatex Suricata.tex
	cd _build/latex && makeindex -s python.ist Suricata.idx
	cd _build/latex && pdflatex Suricata.tex
	cd _build/latex && pdflatex Suricata.tex

userguide.pdf: _build/latex/Suricata.pdf
	cp _build/latex/Suricata.pdf userguide.pdf

pdf: userguide.pdf

_build/man: manpages/suricata.rst manpages/suricatasc.rst manpages/suricatactl.rst manpages/suricatactl-filestore.rst
	sysconfdir=$(sysconfdir) \
	localstatedir=$(localstatedir) \
	version=$(PACKAGE_VERSION) \
		$(SPHINX_BUILD) -W -b man -d _build/doctrees \
		$(top_srcdir)/doc/userguide _build/man
	touch _build/man

$(dist_man1_MANS): _build/man
	cp _build/man/$@ .

man: $(dist_man1_MANS)

# Remove build artifacts that aren't tracked by autotools.
clean-local:
	rm -rf $(top_builddir)/doc/userguide/_build
	rm -f $(top_builddir)/doc/userguide/suricata*.1
	rm -f $(top_builddir)/doc/userguide/userguide.pdf

endif # SPHINX_BUILD