summaryrefslogtreecommitdiff
path: root/hardcopies.make
blob: 0f84b946a241d4a40c5311035511daf4e1c0b858 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

##
## hardcopies.make
##
## HTML, PDF and Postcript documentation generation
## DO NOT MODIFY THIS FILE 
##
## COPY doc/en/Makefile.am in your doc/[language] directory,
## then edit variables as needed
##
##

sysdoc = $(datadir)/doc/$(docname)/$(lang)

if WITH_HTMLDOC
htmldoc = $(progname)_html
html_install = install-html
html_uninstall = uninstall-html
html_clean = clean-html
endif

if WITH_JW
pdfdoc = $(progname).pdf
pdf_install = install-pdf
psdoc = $(progname).ps
ps_install = install-ps
endif

if WITH_PDFDOC
pdfdoc = $(progname).pdf
pdf_install = install-pdf
endif

if WITH_PSDOC
psdoc = $(progname).ps
ps_install = install-ps
endif

all: omf $(htmldoc) $(pdfdoc) $(psdoc)

install-data-local: install-data-xml \
	$(html_install) $(pdf_install) $(ps_install) 

## install-examples

uninstall-local: uninstall-local-xml  \
	uninstall-html uninstall-pdf uninstall-ps \
	uninstall-ps uninstall-pdf

## uninstall-examples

clean-local: clean-local-xml \
	clean-html clean-ps clean-pdf

$(progname)_html: $(progname)-cmdline.xml $(pngfigures) \
	$(xmlsources) $(htmlstyle)
	$(mkinstalldirs) $(srcdir)/$(progname)_html
	$(mkinstalldirs) $(srcdir)/$(progname)_html/$(figdir)
	$(mkinstalldirs) $(srcdir)/$(progname)_html/images
	$(mkinstalldirs) $(srcdir)/$(progname)_html/images/callouts
	$(mkinstalldirs) $(srcdir)/$(progname)_html/css
	-cp ../html/images/*.png $(srcdir)/$(progname)_html/images
	-cp ../html/images/callouts/*.png \
	  $(srcdir)/$(progname)_html/images/callouts
	-cp ../html/css/*.css $(srcdir)/$(progname)_html/css
	-cp $(srcdir)/$(figdir)/*.png $(srcdir)/$(progname)_html/$(figdir)
	cd $(srcdir)/$(progname)_html \
	  && xsltproc --stringparam graphic.default.extension png \
	    ../$(htmlstyle) ../$(progname).xml
	touch $(progname)_html

if WITH_PDFDOC
$(progname).pdf: $(srcdir)/$(progname).xml $(progname)-cmdline.xml \
	$(pngfigures) $(xmlsources)
	-$(DBLATEX) -t pdf -T  native \
		-P 'latex.unicode.use=$(UNICODE)' \
		-P latex.encoding='$(ENCODING)' \
		$(LATEX_CLASS_OPTIONS) \
		$<
endif

.epsfigures: $(epsfigures) $(pngfigures)
	-if test -d "$(srcdir)/$(figdir)"; then \
	  for file in $(pngfigures) ; do \
	    destfile=$(srcdir)/$(figdir)/`basename $$file .png`.eps ; \
	    convert $$file $$destfile; \
	  done ; \
	fi
	-if test -d "$(srcdir)/ps/$(figdir)"; then \
	  for file in $(epsfigures) ; do \
	    cp  $$file $(srcdir)/$(figdir)/ ; \
	  done ; \
	fi
	touch .epsfigures

if WITH_PSDOC
$(progname).ps: $(srcdir)/$(progname).xml \
	$(progname)-cmdline.xml .epsfigures $(xmlsources)
	-$(DBLATEX) -t ps -T native \
	        $(stylesheet) \
		-P 'latex.unicode.use=$(UNICODE)' \
		-P 'latex.encoding=$(ENCODING)' \
		$(LATEX_CLASS_OPTIONS) \
		$(srcdir)/$<
endif

if WITH_JW
.jw: $(srcdir)/$(progname).xml \
	$(progname)-cmdline.xml .epsfigures $(xmlsources)
	rm -rf jw
	mkdir -p jw
	cp -r graphics jw
	cp *.xml jw
	flip -b -u *.xml
	cd jw && recode -d '$(DOCUMENT_ENCODING)..XML-standalone' *.xml
	touch .jw

$(progname).ps: jw
	cd jw && $(JW) -b ps -V paper-type=$(PAPERSIZE) $(progname).xml
	cp jw/$(progname).ps .

$(progname).pdf: jw
	cd jw && $(JW) -b pdf -V paper-type=$(PAPERSIZE) $(progname).xml
	cp jw/$(progname).pdf .
endif

install-html: $(progname)_html
	$(mkinstalldirs) $(sysdoc)/html
	cp -r $(srcdir)/$(progname)_html/* $(sysdoc)/html

uninstall-html:
	-rm -f $(sysdoc)/html/*.html
	-rm -f $(sysdoc)/html/$(figdir)/*
	-rm -f $(sysdoc)/html/images/callouts/*
	-rm -f $(sysdoc)/html/images/*
	-rm -f $(sysdoc)/html/css/*

clean-html:
	-rm -rf $(srcdir)/$(progname)_html


install-pdf: $(progname).pdf
	$(mkinstalldirs) $(sysdoc)
	-$(INSTALL_DATA) $< $(sysdoc)/$<

uninstall-pdf:
	-rm -f $(sysdoc)/$(progname).pdf

clean-pdf:
	rm -f $(progname).pdf
	-rm -rf $(srcdir)/jw
	rm -f .jw

install-ps: $(progname).ps
	$(mkinstalldirs) $(sysdoc)
	-$(INSTALL_DATA) $< $(sysdoc)/$<

uninstall-ps:
	-rm -f $(sysdoc)/$(progname).ps

clean-ps:
	-rm -rf $(srcdir)/tex
	-rm -f $(progname).ps
	-rm -f .epsfigures
	-rm -f $(srcdir)/graphics/*.eps
	-rm -rf $(srcdir)/jw
	rm -f .jw

install-examples: $(examples)
	$(mkinstalldirs) $(sysdoc)/examples
	for i in $^; do \
	  if test -f "$$i"; then  \
	    echo "installing $$i" ;\
	    $(INSTALL_DATA) $$i $(sysdoc)/examples/$$(basename $$i) ; \
	  fi ; \
	done

uninstall-examples: $(examples)
	for i in $^; do \
	  rm -f $(sysdoc)/examples/$$(basename $$i) ;\
	done