summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/mf/Makefile
blob: 1386a927d626ecc35dc0195df2f27ab94e41bdf6 (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
# Type "make" or "make testfont.ps"
# To test an individual diagram, type "make DOC=file clean file.ps"

LIBDIR = $$HOME/lib
M4MACROS = mfpic.m4

M4 = m4 -I $(LIBDIR)
M4 = m4

# Use ljfive (which is 600dpi) because 1200dpi produces mf errors on some figs
MODE = ljfive
MF = MFINPUTS=.: mf "\mode:=$(MODE); scrollmode;"
DOC = test
LATEX = TEXFORMATS=.: TEXFONTS=.: latex
TR = tr '\075' '\134'

PIC=dpic
#PIC=/cygdrive/d/Dwight/dpic/build/p2c/ftp/dpic
#PIC=/cygdrive/d/Dwight/dpic/bison/dpic

testfont.ps:

font.dvi: font.m4
	$(M4) $(M4MACROS) font.m4 > font.pic
	$(PIC) -m font.pic > font.tex
	-$(LATEX) font
	cat cct.mf | tr -d '\015' > xxx; mv xxx cct.mf
	-$(MF) "input cct" < /dev/null
	gftopk cct.*gf `ls cct.*gf | sed 's/gf$$/pk/'`
	cp -p cct.*pk cct.pk

testfont.ps: font.dvi
	(echo 'cct'; echo '=table'; echo '=end') | $(TR) | \
      (TEXFORMATS=.: TEXFONTS=.: tex testfont)
	dvips -D600 testfont -o

# For testing individual diagrams:
$(DOC).ps: $(DOC).pk
	$(LATEX) $(DOC)
	TEXPKS=.: dvips -Z -P$(MODE) $(DOC)

$(DOC).pk: $(DOC).tex
	-$(LATEX) $(DOC)
	-$(MF) "input $(DOC)-mfpic" < /dev/null
	gftopk $(DOC)-mfpic.*gf `ls $(DOC)-mfpic.*gf | sed 's/gf$$/pk/'`

$(DOC).tex: $(DOC).m4
	sed -n -e "s/cct/$(DOC)-mfpic/" -e '1,/opengraphs/p' font.m4 > $(DOC).tex
	$(M4) $(M4MACROS) $(DOC).m4 | $(PIC) -m >> $(DOC).tex
	echo '=closegraphsfile=end{document}' | $(TR)  >> $(DOC).tex

clobber: clean
	rm -f *.tfm cct.mf

clean:
	rm -f *.tex *pk *mfpic*
	rm -f *.log *.dvi *.ps *.aux *gf
	rm -f core log xxx *.pic font.tex testfont*