summaryrefslogtreecommitdiff
path: root/doc/Makefile.am
blob: 053a18934eeb23ea5fca544b44493af17999b66c (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
182
183
184
185
186
187
188
189
190
191
192
193
## $Id: Makefile.am,v 1.27.2.3 2002/05/11 23:07:16 rleigh Exp $
## Copyright (C) 2000 Roger Leigh
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

## Process this file with automake to produce Makefile.in.

AUTOMAKE_OPTIONS = 1.4 gnu

@SET_MAKE@

MAINT_CHARSET = latin1

SUBDIRS = users_guide


## Variables

MANUAL = gimpprint
HTMLDIR = manual-html
DOCS = $(MANUAL).dvi $(MANUAL).ps html-stamp

IMAGES = \
 print-color.png \
 print-main.png \
 print-setup.png

EPS_IMAGES = $(addsuffix .eps,$(basename $(IMAGES)))

TEXT_IMAGES = $(addsuffix .txt,$(basename $(IMAGES)))

if MAINTAINER_MODE
MAINT_MODE = true
else
MAINT_MODE = false
endif

USER_GUIDE = $(MANUAL).ps html

STANDARD_TARGETS=@USER_GUIDE@


if MAINTAINER_MODE
ALL_LOCAL_TARGETS = docs
else
ALL_LOCAL_TARGETS = $(STANDARD_TARGETS)
endif


## Data

info_TEXINFOS = gimpprint.texi

gimpprint_TEXINFOS = overview.texi copying.texi gpl.texi introduction.texi using.texi functions.texi programs.texi problems.texi appendices.texi dither.texi weave.texi escp2.texi new-printer.texi indices.texi integrating.texi version.texi


## Rules

all-local: $(DOCS)

docs: $(DOCS)
	cd users_guide; $(MAKE) docs

ps: $(MANUAL).ps
	cd users_guide; $(MAKE) ps

pdf: $(MANUAL).pdf
	cd users_guide; $(MAKE) pdf


TEXI2DVIFLAGS = -I $(srcdir)
gimpprint.dvi: $(EPS_IMAGES) $(addprefix $(srcdir)/,$(gimpprint_TEXINFOS) $(info_TEXINFOS))
	$(TEXI2DVI) $(TEXI2DVIFLAGS) $(srcdir)/gimpprint.texi

%.eps: %.png
	  $(CONVERT) $< EPS2:$@

html: html-stamp
	cd users_guide; $(MAKE) html

## Note the rather weird way of setting the exit status; this is because
## texi2html doesn't set the exit status.
html-stamp: $(addprefix $(srcdir)/,$(gimpprint_TEXINFOS) $(info_TEXINFOS))
	$(RM) -rf $(HTMLDIR)-tmp
	mkdir $(HTMLDIR)-tmp
	images="$(addprefix $(srcdir)/, $(IMAGES))"; \
	for image in $$images ; do \
	  cp -p $$image $(HTMLDIR)-tmp ; \
	done
	cd $(HTMLDIR)-tmp ; \
	$(TEXI2HTML) -menu -split_node -number -expandinfo \
	      -I ../$(srcdir) ../$(srcdir)/$(MANUAL).texi 2>&1
	$(RM) -rf $(HTMLDIR)
	mv $(HTMLDIR)-tmp $(HTMLDIR)
	touch html-stamp

$(MANUAL).ps: $(MANUAL).dvi
	TEXPICTS=$(srcdir):. $(DVIPS) $< -o $@

$(MANUAL).pdf: $(MANUAL).dvi
	TEXPICTS=$(srcdir):. $(DVIPDF) $< $@

install-data-local: $(STANDARD_TARGETS)
	if test -n '$(STANDARD_TARGETS)' ; then \
	  $(mkinstalldirs) $(DESTDIR)$(datadir)/$(PACKAGE)/doc ; \
	  $(mkinstalldirs) $(DESTDIR)$(datadir)/$(PACKAGE)/doc/$(HTMLDIR) ; \
	  if test -f $(MANUAL).ps ; then \
	    $(INSTALL_DATA) $(MANUAL).ps $(DESTDIR)$(datadir)/$(PACKAGE)/doc ; \
	  elif test -f $(srcdir)/$(MANUAL).ps ; then \
	    $(INSTALL_DATA) $(srcdir)/$(MANUAL).ps $(DESTDIR)$(datadir)/$(PACKAGE)/doc ; \
	  fi ; \
	  if test -d $(HTMLDIR) ; then \
	    HTMLSRCDIR="$(HTMLDIR)" ; \
	  elif test -d $(srcdir)/$(HTMLDIR) ; then \
	    HTMLSRCDIR="$(srcdir)/$(HTMLDIR)" ; \
	  fi ; \
	  for file in $$HTMLSRCDIR/* ; do \
	    if test -f $$file ; then \
	      $(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/$(PACKAGE)/doc/$(HTMLDIR) ; \
	    fi ; \
	  done ; \
	fi

dist-hook: html
	for dir in $(HTMLDIR) ; do \
	  if test -d $(srcdir)/$$dir ; then \
	    mkdir $(distdir)/$$dir; \
	    for dirfile in $(srcdir)/$$dir/*; do \
	      if test -f $$dirfile ; then \
	        cp -p $$dirfile $(distdir)/$$dir; \
	      fi \
	    done \
	  fi \
	done

CLEAN_MANUALS = \
	$(RM) -rf html-stamp $(HTMLDIR) ; \
	$(RM) -f $(MANUAL).pdf $(MANUAL).ps $(MANUAL).dvi ; \
	$(RM) -f $(EPS_IMAGES)

clean-local:
	if test $(srcdir) = '.' -a $(MAINT_MODE) = false ; then \
	  echo 'clean-local: Not removing $(HTMLDIR)' ; \
	  echo 'clean-local: Not removing $(MANUAL).pdf' ; \
	  echo 'clean-local: Not removing $(MANUAL).ps' ; \
	  echo 'clean-local: Not removing $(MANUAL).dvi' ; \
	  echo 'clean-local: Not removing EPS figures' ; \
	else \
	  $(CLEAN_MANUALS) ; \
	fi
	-$(RM) -rf *.tex *.log *.aux *.gz *.out *.junk *.fot
	-$(RM) -rf *.ky *.pg *.toc *.tp *.vr *.vrs
	-$(RM) -rf $(HTMLDIR)-tmp

veryclean:
	$(MAKE) MAINT_MODE=true clean

maintainer-clean-local:
	$(CLEAN_MANUALS)

# We duplicate mostlyclean-aminfo here because we do not want to remove
# the .dvi and .ps files that mostlyclean-aminfo wants to remove.  The
# reason why is that we do not want make clean to force a rebuild of the
# doc, since users may not have the texinfo tools required to do so.
# Unfortunately, this generates a warning about overriding commands for
# mostlyclean-aminfo.
mostlyclean-aminfo:
	-$(RM) -f gimpprint.aux gimpprint.cp gimpprint.cps \
	  gimpprint.fn gimpprint.fns gimpprint.ky gimpprint.kys \
	  gimpprint.log gimpprint.pg gimpprint.toc \
	  gimpprint.tp gimpprint.tps gimpprint.vr gimpprint.vrs \
	  gimpprint.op gimpprint.tr gimpprint.cv gimpprint.cn


## Clean

MAINTAINERCLEANFILES = Makefile.in html-stamp

EXTRA_DIST = $(DOCS) $(IMAGES) $(EPS_IMAGES) $(TEXT_IMAGES) FAQ.html README.maintaining

.PHONY: html ps pdf docs clean-manuals