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} ${pdf_docs} ${pcb_output}
43 html_docs= ${info_TEXINFOS:.texi=.html}
44 pdf_docs= ${info_TEXINFOS:.texi=.pdf}
45 dvi_docs= ${info_TEXINFOS:.texi=.dvi}
47 pcb_files = $(wildcard *.pcb)
48 fp_files = $(wildcard *.fp)
49 sch_files = $(wildcard *.sch)
50 sym_files = $(wildcard *.sym)
52 gen_base = ${basename ${pcb_files} ${fp_files} ${sch_files} ${sym_files}}
54 png_files = ${addsuffix .png,${gen_base}}
55 png_found = $(filter-out ${png_files},$(wildcard *.png))
57 gen_base2 = ${gen_base} ${basename ${png_found}}
58 eps_files = ${addsuffix .eps,${gen_base2}}
59 pdf_files = ${addsuffix .pdf,${gen_base2}}
61 tab_files = $(wildcard *.tab)
62 tab_texi = ${tab_files:.tab=.texi}
64 all_texi = $(wildcard *.texi)
65 inc_texi = $(filter-out ${BASE}.texi,$(all_texi))
67 ${BASE}.html : ${png_files}
68 ${BASE}.dvi : ${eps_files} ${pdf_files}
69 ${BASE}.pdf : ${pdf_files}
71 # put the html manual into 1 file instead of multiple files?
72 AM_MAKEINFOHTMLFLAGS= --css-include=$(srcdir)/${BASE}.css --no-split
74 # use this to avoid having the clean target delete pcb.{dvi,html,pdf,ps}
75 # which unfortunately deletes files which are part of the distfile
77 -rm -rf ${BASE}.aux ${BASE}.cp ${BASE}.cps ${BASE}.fn \
78 ${BASE}.fns ${BASE}.ky ${BASE}.kys ${BASE}.log ${BASE}.pg \
79 ${BASE}.pgs ${BASE}.tmp ${BASE}.toc ${BASE}.tp ${BASE}.tps \
80 ${BASE}.vr ${BASE}.vrs
102 BUILT_SOURCES= ${tab_texi} ${pcb_output} ${inline_texi}
104 refcard.aux refcard.dvi refcard.log refcard.pdf \
105 ${pcb_output} ${tab_texi} ${inline_texi} pcb.dvi pcb.html pcb.pdf
111 ASCII2TEXI= ${AWK} -f $(srcdir)/../ascii2texi.awk ncol=3
114 ${pcb_files:.pcb=.eps} \
115 ${pcb_files:.pcb=.pdf} \
116 ${pcb_files:.pcb=.png}
118 SUFFIXES = .dvi .eps .pcb .pdf .png .tab .tex
121 $(PCB) -x eps --font-path $(top_srcdir)/src --eps-file $*.eps $<
122 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
125 $(PCB) -x eps --font-path $(top_srcdir)/src --eps-file $*.eps $<
126 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
130 @echo "****************************************************"
131 @echo "WARNING: gschem is missing on your system but"
132 @echo "$@ is out of date and needs to rebuilt."
133 @echo "Changes to $< will be ignored"
135 $(GSCHEM) -p -o $*.eps -s ./print-eps.scm $<
136 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
141 @echo "****************************************************"
142 @echo "WARNING: gschem is missing on your system but"
143 @echo "$@ is out of date and needs to rebuilt."
144 @echo "Changes to $< will be ignored"
146 $(GSCHEM) -p -o $*.eps -s $(srcdir)/print-eps.scm $<
147 $(PERL) $(srcdir)/../eps2png -resolution 100 -output $*.png $*.eps
152 @echo "****************************************************"
153 @echo "WARNING: ps2pdf is missing on your system but"
154 @echo "$@ is out of date and needs to rebuilt."
155 @echo "Changes to $< will be ignored"
157 ${PS2PDF} `${AWK} 'BEGIN{s=8}; /BoundingBox/ {printf("-r%d -g%dx%d", s*72, s*$$4, s*$$5);}' $<` $< $@
161 ${ASCII2TEXI} $< > $@
165 @echo "****************************************************"
166 @echo "WARNING: pdflatex is missing on your system but"
167 @echo "$@ is out of date and needs to rebuilt."
168 @echo "Changes to $< will be ignored"
176 pngtopnm $< | pnmtops -nocenter -equalpixels -noturn -dpi 200 > $@
179 @echo gen_base = ${gen_base}
181 @echo png_files = ${png_files}
183 @echo png_found = ${png_found}