| 1 |
# Makefile for the mpost subdirectory |
| 2 |
# To test a new file, copy it into test.m4 and type "make tst" or "make tst1" |
| 3 |
|
| 4 |
M4 = m4 mpost.m4 |
| 5 |
# If the M4PATH environment variable has not been set to include the |
| 6 |
# installation directory then change $$HOME/lib to point to the directory, |
| 7 |
# and uncomment the following: |
| 8 |
|
| 9 |
# M4 = m4 -I $$HOME/lib mpost.m4 |
| 10 |
|
| 11 |
#--------------------------------------------- |
| 12 |
|
| 13 |
MKDIM=pwd | sed -e 's%^%=boxdimfile{%' -e 's%/cygdrive/\(.\)/%\1:/%' \ |
| 14 |
-e 's%$$%/$(DIMFILE)}%' |
| 15 |
|
| 16 |
# Comment out the following line to produce absolute addresses for .dim files. |
| 17 |
MKDIM=printf '=boxdimfile{$(DIMFILE)}\n' |
| 18 |
|
| 19 |
#--------------------------------------------- |
| 20 |
|
| 21 |
DOC = examplesmpost |
| 22 |
|
| 23 |
FIGS = \ |
| 24 |
ABlogix.1 Adder.1 Alogix.1 AmpTable.1 Antennas.1 Arresters.1 \ |
| 25 |
Audio.1 Bip.1 Btree.1 Buttons.1 Byte.1 \ |
| 26 |
Capacitors.1 CanLogic.1 Chips.1 Conn.1 Boards.1 \ |
| 27 |
Contacts.1 Contact.1 control.1 Crow.1 \ |
| 28 |
csc.1 Csource.1 Decoder.1 \ |
| 29 |
Demultiplexer.1 diamond.1 Dini.1 Diodes.1 Drive.1 \ |
| 30 |
Emarrows.1 Escher.1 \ |
| 31 |
ex00.1 ex01.1 ex02.1 ex03.1 ex04.1 ex05.1 ex06.1 ex08.1 \ |
| 32 |
ex09.1 ex10.1 ex11.1 ex12.1 ex15.1 ex16.1 ex17.1 ex18.1 \ |
| 33 |
ex21.1 exp.1 fet.1 Flow.1 Fuses.1 \ |
| 34 |
Geometry.1 GrayCode.1 graysurf.1 Grounds.1 \ |
| 35 |
Headers.1 Heathkit.1 \ |
| 36 |
I2L.1 Inclpdf.1 Inductors.1 Jack.1 \ |
| 37 |
lcct.1 Logic.1 Loglog.1 MC.1 Mixer.1 MoreTable.1 \ |
| 38 |
MotorControl.1 Multiplexer.1 \ |
| 39 |
NLG.1 NPDT.1 Nport.1 Opamp.1 Optoiso.1 \ |
| 40 |
Pconn.1 Plate.1 PushPull.1 pwrsupply.1 \ |
| 41 |
Quantum.1 quick.1 \ |
| 42 |
random.1 Rectifiers.1 recycle.1 relaycoil.1 Relay.1 \ |
| 43 |
Resistors.1 Rotbox.1 \ |
| 44 |
Schottky.1 sfg.1 shapes.1 ShiftR.1 Sierpinski.1 Sixpole.1 \ |
| 45 |
Smithchart.1 Sources.1 SQUID.1 Switches.1 \ |
| 46 |
Tgate.1 Three.1 thyristor.1 TTLnand.1 Tubediags.1 \ |
| 47 |
UNO.1 ujt.1 Variable.1 Windings.1 worm.1 Xform.1 XOR.1 |
| 48 |
|
| 49 |
REMOVED = \ |
| 50 |
EEP.1 EVplugs.1 |
| 51 |
|
| 52 |
BOXDIMS = ex09 Crow Inclpdf Loglog Opamp Btree Windings |
| 53 |
|
| 54 |
# It is advisable to do `make clean' between test examples. |
| 55 |
#--------------------------------------------- |
| 56 |
|
| 57 |
DPIC = dpic |
| 58 |
# DPIC = $$HOME/dpic/test/dpic |
| 59 |
|
| 60 |
MPOST = mpost --tex=latex |
| 61 |
|
| 62 |
TR = | tr '=' '\134' |
| 63 |
|
| 64 |
LATEX = latex --quiet |
| 65 |
DVIPS = dvips |
| 66 |
|
| 67 |
DIMFILE = tmp.dim |
| 68 |
|
| 69 |
.SUFFIXES: .mp .dvi .ps .m4 .1 |
| 70 |
.dvi.ps: |
| 71 |
$(DVIPS) $* -o |
| 72 |
.tex.dvi: |
| 73 |
$(LATEX) $* |
| 74 |
.m4.mp: |
| 75 |
$(M4) $*.m4 | $(DPIC) -s > $*.mp |
| 76 |
# $(M4) $*.m4 $*.pic |
| 77 |
# $(DPIC) -s $*.pic > $*.mp |
| 78 |
.m4.1: |
| 79 |
@touch $(DIMFILE) $(DOC).dim |
| 80 |
$(M4) $(DIMFILE) $(DOC).dim $*.m4 > $(DOC).pic |
| 81 |
@(printf 'verbatimtex\n' ;\ |
| 82 |
printf '=documentclass[11pt]{article}\n' ;\ |
| 83 |
printf '=usepackage{times,boxdims,graphicx}\n' ;\ |
| 84 |
printf '=usepackage{siunitx}\n' ;\ |
| 85 |
$(MKDIM) ;\ |
| 86 |
printf '=begin{document} etex\n' ) $(TR) > $*.mp |
| 87 |
# $(M4) $(DIMFILE) $(DOC).dim $*.m4 | $(DPIC) -s >> $*.mp |
| 88 |
dpic -s $(DOC).pic >> $*.mp |
| 89 |
@printf 'end\n' >> $*.mp |
| 90 |
$(MPOST) $*.mp |
| 91 |
chmod 644 $*.* |
| 92 |
|
| 93 |
$(DOC).ps: $(DOC).dvi |
| 94 |
$(DVIPS) $(DOC) -o |
| 95 |
|
| 96 |
EXL = exlinks |
| 97 |
$(DOC).dvi: $(DOC).tex |
| 98 |
-if test "$(DOC)" = "examplesmpost" ; then \ |
| 99 |
make exlinks dims; rose.pdf; fi |
| 100 |
make $(FIGS) |
| 101 |
$(LATEX) $(DOC) |
| 102 |
-if test -n "$(BOXDIMS)" ; then rm -f dims; \ |
| 103 |
for box in $(BOXDIMS) ; do rm -f $$box.1; done; \ |
| 104 |
make BOXDIMS="$(BOXDIMS)" dims; $(LATEX) $(DOC); fi |
| 105 |
|
| 106 |
dims: |
| 107 |
-if test -n "$(BOXDIMS)" ; then for box in $(BOXDIMS) ; do \ |
| 108 |
make $$box.1; rm -f $$box.1; make $$box.1; done; fi |
| 109 |
touch dims |
| 110 |
|
| 111 |
figs: $(EXL) $(FIGS) |
| 112 |
|
| 113 |
rose.pdf: ../rose.m4 |
| 114 |
m4 pdf.m4 ../rose.m4 | dpic -d > rose.pdf |
| 115 |
|
| 116 |
ignore: |
| 117 |
@echo "" |
| 118 |
@echo "" |
| 119 |
@echo 'Ignore "cannot create ... exists and file.1 not found" warnings.' |
| 120 |
@echo "" |
| 121 |
@echo "" |
| 122 |
|
| 123 |
exlinks: ignore |
| 124 |
-@if test ! -f ex11.m4 ; then \ |
| 125 |
ls ../*.m4 | sed -e 's/^/ln -s /' -e '/test.m4/d' | sh;\ |
| 126 |
fi |
| 127 |
-@if test ! -f AmpTable.m4 ; then \ |
| 128 |
ls ../../doc/*.m4 ../*.bb ../*.gz | sed -e 's/^/ln -s /' | sh;\ |
| 129 |
fi |
| 130 |
-if test -n "$(EXL)" ; then touch $(EXL) ; fi |
| 131 |
|
| 132 |
clobber: clean |
| 133 |
|
| 134 |
tst: ignore |
| 135 |
rm -f tst.ps tst.dvi test.1 test.mp |
| 136 |
make EXL="" DPIC="$(DPIC)" DOC=tstmpost FIGS=test.1 BOXDIMS=test |
| 137 |
rm -f *.frs |
| 138 |
|
| 139 |
tst1: test.1 tstmpost.tex |
| 140 |
latex tstmpost |
| 141 |
dvips tstmpost |
| 142 |
|
| 143 |
clean: |
| 144 |
rm -f stamp-* $(FIGS) *.pic mp*.tex rose.pdf |
| 145 |
-if /usr/bin/test -f exlinks ; then \ |
| 146 |
ls -l *.m4 *.bb *.gz | grep '\->' | \ |
| 147 |
sed -e 's/^.* \([^ ][^ ]*\) ->.*$$/rm -f \1/' | sh; fi |
| 148 |
rm -f Incl.eps.bb Incl.eps.gz |
| 149 |
rm -f *.log *.dvi *.ps test.pdf *.aux *.mp *.[0-9] *.[0-9][0-9] *.mpx *.dim |
| 150 |
rm -f core log mpxerr* *links figs.* *.dim dims F_test.* |
| 151 |
rm -f man[0-9]*.pic man[0-9]*.m4 figs.m4 test.1 test.mp test.pic test.tex |
| 152 |
-if test -n "$(BOXDIMS)" ; then for box in $(BOXDIMS) ; do \ |
| 153 |
rm -f F_$$box.tex $$box.tex ; done; fi |