1.SILENT:
2
3MAKEINFO	= $(shell which makeinfo 2> /dev/null)
4DVIPS		= $(shell which dvips 2> /dev/null)
5TEXI2DVI	= $(shell which texi2dvi 2> /dev/null)
6PDFTEX		= $(shell which pdftex 2> /dev/null)
7
8aunit_docs: version aunit.pdf aunit.html aunit.txt aunit.info
9	echo ""
10	echo Documentation built with success.
11
12version:
13	sed 's/^/@set /g;s/=/ /g' ../version_information  > version.texi
14
15%.dvi: %.texi
16ifneq (${TEXI2DVI},)
17	echo Building $@
18	${TEXI2DVI} --expand --clean --quiet $<
19else
20	@echo "--------------------------------------------------------"
21	@echo "texi2dvi not found, cannot build DVI or PS documentation"
22	@echo "--------------------------------------------------------"
23endif
24
25%.ps: %.dvi
26ifneq (${DVIPS},)
27	echo Building $@
28	${DVIPS} -q $< -o $@
29else
30	@echo "------------------------------------------------------"
31	@echo "dvips not found, cannot build POSTSCRIPT documentation"
32	@echo "------------------------------------------------------"
33endif
34
35%.pdf: %.texi
36ifneq (${TEXI2DVI},)
37ifneq (${PDFTEX},)
38	echo Building $@
39	${TEXI2DVI} -p --expand --clean --quiet $<
40else
41	@echo "-----------------------------------------------"
42	@echo "pdftex not found, cannot build PDF documentation"
43	@echo "-----------------------------------------------"
44endif
45else
46	@echo "--------------------------------------------------"
47	@echo "texi2dvi not found, cannot build PDF documentation"
48	@echo "--------------------------------------------------"
49endif
50
51%.info: %.texi
52ifneq (${MAKEINFO},)
53	echo Building $@
54	${MAKEINFO} $<
55else
56	@echo "---------------------------------------------------"
57	@echo "makeinfo not found, cannot build INFO documentation"
58	@echo "---------------------------------------------------"
59endif
60
61%.html: %.texi
62ifneq (${MAKEINFO},)
63	echo Building $@
64	${MAKEINFO} --html --no-split --css-include=aunit.css --ifinfo $<
65else
66	@echo "---------------------------------------------------"
67	@echo "makeinfo not found, cannot build HTML documentation"
68	@echo "---------------------------------------------------"
69endif
70
71%.txt: %.texi
72ifneq (${MAKEINFO},)
73	echo Building $@
74	${MAKEINFO} --plaintext --no-headers $< --output $@
75else
76	@echo "---------------------------------------------------"
77	@echo "makeinfo not found, cannot build TEXT documentation"
78	@echo "---------------------------------------------------"
79endif
80
81clean:
82	-$(RM) -f aunit.dvi aunit.html aunit.info* aunit.log
83	-$(RM) -f aunit.ps aunit.pdf aunit.txt *~ version.texi
84