5 ## PCB, interactive printed circuit board design
6 ## Copyright (C) 2007 DJ Delorie
8 ## This program is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
13 ## This program is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; if not, write to the Free Software
20 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 # The makefile including this must set BASE to the base name of the
24 # primary texinfo file.
26 info_TEXINFOS= ${BASE}.texi
28 # We avoid adding all the dependencies except in maintainer mode. This is
29 # because the automake team feels that you should not require the user
30 # to have makeinfo and friends installed just to build the package.
31 # This seems reasonable. Because of that, the documentation must be
32 # built in the source directory so it can be found when creating a distfile
33 # and this means you can't build outside the source tree with a read-only
34 # source. So, ignore the dependencies unless we're in maintainer mode
35 # but be sure and put the generated files in the distfile via EXTRA_DIST
36 # and dist_pkgdata_DATA. Also this helps us avoid problem with users
37 # having various out of date versions of the texinfo package installed
38 # which can have all sorts of issues.
41 dist_pkgdata_DATA= ${html_docs} ${ps_docs} ${pdf_docs} ${pcb_output}
43 html_docs= ${info_TEXINFOS:.texi=.html}
44 ps_docs= ${info_TEXINFOS:.texi=.ps}
45 pdf_docs= ${info_TEXINFOS:.texi=.pdf}
46 dvi_docs= ${info_TEXINFOS:.texi=.dvi}
48 pcb_files = $(wildcard *.pcb)
49 fp_files = $(wildcard *.fp)
50 sch_files = $(wildcard *.sch)
51 sym_files = $(wildcard *.sym)
53 gen_base = ${basename ${pcb_files} ${fp_files} ${sch_files} ${sym_files}}
55 png_files = ${addsuffix .png,${gen_base}}
56 png_found = $(filter-out ${png_files},$(wildcard *.png))
58 gen_base2 = ${gen_base} ${basename ${png_found}}
59 eps_files = ${addsuffix .eps,${gen_base2}}
60 pdf_files = ${addsuffix .pdf,${gen_base2}}
62 tab_files = $(wildcard *.tab)
63 tab_texi = ${tab_files:.tab=.texi}
65 all_texi = $(wildcard *.texi)
66 inc_texi = $(filter-out ${BASE}.texi,$(all_texi))
68 ${BASE}.html : ${png_files}
69 ${BASE}.dvi : ${eps_files} ${pdf_files}
70 ${BASE}.pdf : ${pdf_files}
72 # put the html manual into 1 file instead of multiple files?
73 AM_MAKEINFOHTMLFLAGS= --css-include=$(srcdir)/${BASE}.css --no-split
75 # use this to avoid having the clean target delete pcb.{dvi,html,pdf,ps}
76 # which unfortunately deletes files which are part of the distfile
78 -rm -rf ${BASE}.aux ${BASE}.cp ${BASE}.cps ${BASE}.fn \
79 ${BASE}.fns ${BASE}.ky ${BASE}.kys ${BASE}.log ${BASE}.pg \
80 ${BASE}.pgs ${BASE}.tmp ${BASE}.toc ${BASE}.tp ${BASE}.tps \
81 ${BASE}.vr ${BASE}.vrs
104 BUILT_SOURCES= ${tab_texi} ${pcb_output} ${inline_texi}
106 refcard.aux refcard.dvi refcard.log refcard.pdf refcard.ps \
107 ${pcb_output} ${tab_texi} ${inline_texi} pcb.dvi pcb.html pcb.pdf pcb.ps
113 ASCII2TEXI= ${AWK} -f $(srcdir)/../ascii2texi.awk ncol=3
116 ${pcb_files:.pcb=.eps} \
117 ${pcb_files:.pcb=.pdf} \
118 ${pcb_files:.pcb=.png}
120 SUFFIXES = .dvi .eps .gif .pcb .pdf .png .ps .tab .tex
123 $(PCB) -x eps --font-path $(top_srcdir)/src --eps-file $*.eps $<
124 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
127 $(PCB) -x eps --font-path $(top_srcdir)/src --eps-file $*.eps $<
128 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
132 @echo "****************************************************"
133 @echo "WARNING: gschem is missing on your system but"
134 @echo "$@ is out of date and needs to rebuilt."
135 @echo "Changes to $< will be ignored"
137 $(GSCHEM) -p -o $*.eps -s ./print-eps.scm $<
138 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
143 @echo "****************************************************"
144 @echo "WARNING: gschem is missing on your system but"
145 @echo "$@ is out of date and needs to rebuilt."
146 @echo "Changes to $< will be ignored"
148 $(GSCHEM) -p -o $*.eps -s $(srcdir)/print-eps.scm $<
149 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
154 @echo "****************************************************"
155 @echo "WARNING: ps2pdf is missing on your system but"
156 @echo "$@ is out of date and needs to rebuilt."
157 @echo "Changes to $< will be ignored"
159 ${PS2PDF} `${AWK} 'BEGIN{s=8}; /BoundingBox/ {printf("-r%d -g%dx%d", s*72, s*$$4, s*$$5);}' $<` $< $@
163 ${ASCII2TEXI} $< > $@
167 @echo "****************************************************"
168 @echo "WARNING: LaTeX is missing on your system but"
169 @echo "$@ is out of date and needs to rebuilt."
170 @echo "Changes to $< will be ignored"
179 @echo "****************************************************"
180 @echo "WARNING: dvips is missing on your system but"
181 @echo "$@ is out of date and needs to rebuilt."
182 @echo "Changes to $< will be ignored"
184 ${DVIPS} -Ppdf -j0 -D 300 -o $@ $<
189 @echo "****************************************************"
190 @echo "WARNING: pdflatex is missing on your system but"
191 @echo "$@ is out of date and needs to rebuilt."
192 @echo "Changes to $< will be ignored"
200 pngtopnm $< | pnmtops -nocenter -equalpixels -noturn -dpi 200 > $@
203 @echo gen_base = ${gen_base}
205 @echo png_files = ${png_files}
207 @echo png_found = ${png_found}