summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/psfrag/Makefile
blob: e79d5bee4d1d1fce29ae15ff5ea13b0f6c725b3b (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
# Makefile for the psfrag subdirectory

# Where the .m4 libraries are installed.  Change if necessary:
LIBDIR = $$HOME/lib

#---------------------------------------------

MKDIM=pwd | sed -e 's%^%=boxdimfile{%' -e 's%/cygdrive/\(.\)/%\1:/%' \
       -e 's%$$%/$(DIMFILE)}%'

# Comment out the following line to produce absolute addresses for .dim files.
MKDIM=printf '=boxdimfile{$(DIMFILE)}\n'

#---------------------------------------------

# The .m4 circuit_macro libraries used for the examples:
M4MACROS = psfrag.m4
M4 = m4 

#---------------------------------------------
DOC = examplespsfrag

FIGS = Adder.eps Alogix.eps ABlogix.eps Antennas.eps Audio.eps AmpTable.eps \
  AntiqueClock.eps \
  Bip.eps Btree.eps Byte.eps Buttons.eps \
  CanLogic.eps CctTable.eps Conn.eps Connectors.eps \
  Counting.eps Crossbar.eps Crow.eps \
  Decoder.eps Demultiplexer.eps Dini.eps Diodes.eps Drive.eps \
  Contact.eps Contacts.eps \
  Csource.eps \
  Emarrows.eps Flow.eps Fuses.eps \
  GrayCode.eps Grounds.eps Headers.eps Heathkit.eps Jack.eps \
  I2L.eps Inclpdf.eps \
  Lyap.eps Logic.eps Loglog.eps \
  MC.eps Mixer.eps MotorControl.eps Multiplexer.eps \
  NLG.eps NPDT.eps Nport.eps \
  Opamp.eps Optoiso.eps Pconn.eps PushPull.eps Quantum.eps \
  Rectifiers.eps Relay.eps Rotbox.eps \
  Schottky.eps Sierpinski.eps ShiftR.eps Sixpole.eps Sources.eps SQUID.eps \
  Switches.eps \
  Tgate.eps Three.eps Timer.eps TTLnand.eps Ttree.eps Tubediags.eps \
  Windings.eps Variable.eps Xform.eps XOR.eps \
  control.eps csc.eps diamond.eps \
  ex00.eps ex01.eps ex02.eps ex03.eps ex04.eps \
  ex05.eps ex06.eps ex08.eps ex09.eps ex10.eps ex11.eps ex12.eps \
  ex15.eps ex16.eps ex17.eps ex18.eps ex21.eps exp.eps \
  fet.eps graysurf.eps lcct.eps pwrsupply.eps quick.eps \
  random.eps recycle.eps relaycoil.eps rose.eps sfg.eps shapes.eps \
  thyristor.eps ujt.eps worm.eps

LOCALFIGS = ex21

# Files using boxdims macros:
BOXDIMS = ex09 Crow Inclpdf Loglog TTLnand Opamp Ttree Windings

# It is advisable to do `make clean' between test examples.
#---------------------------------------------

DPIC = dpic
# DPIC = $$HOME/dpic/test/dpic
# DPIC = $$HOME/dpic/build/p2c/ftp/dpic

TR = | tr '=' '\134'

LATEX = latex --quiet

DIMFILE = tmp.dim

.SUFFIXES: .tex .m4 .eps .ps
.tex.ps:
	$(LATEX) $*
	dvips -Ppdf $*

.m4.eps:
	touch $(DIMFILE)
	$(M4) $(M4MACROS) $(DIMFILE) $*.m4 > $*.pic
	$(DPIC) -f $*.pic > $*.eps
#	$(M4) $(M4MACROS) $(DIMFILE) $*.m4 | $(DPIC) -f >> $*.eps

$(DOC).ps: $(DOC).dvi
	dvips -Ppdf $(DOC)

$(DOC).dvi: $(DOC).tex
	-if test "$(DOC)"="examplespsfrag" ; then make exlinks ;\
    $(MKDIM) $(TR) > setdim.tex; fi
	make $(FIGS) Incl.eps
	$(LATEX) $(DOC)
	-if test -n "$(BOXDIMS)" ; then \
       for box in $(BOXDIMS) ; do rm -f $$box.eps; make $$box.eps ; done; \
       $(LATEX) $(DOC); fi
	-if test -n "$(BOXDIMS)" ; then \
       for box in $(BOXDIMS) ; do rm -f $$box.eps; make $$box.eps ; done; \
       $(LATEX) $(DOC); fi

Incl.eps: ../Incl.eps.gz
	rm -f Incl.eps.gz
	cp ../Incl.eps.gz .
	gunzip Incl.eps.gz

figs: exlinks $(FIGS)

exlinks:
	@echo ""
	@echo 'Ignore "cannot create ... exists" warnings.'
	-@if test ! -f ex11.m4 ; then \
      ls ../*.m4 | sed -e 's/^/ln -s /' -e '/test.m4/d' | sh;\
      ls ../../doc/*.m4 ../*.bb ../*.gz | sed -e 's/^/ln -s /' | sh;\
      fi
	touch exlinks
#	for file in $(LOCALFIGS); do cp $${file}PSF.m4 $${file}.m4 ; done

clobber: clean
	rm -f $(DOC).ps test.m4

tst: tstpsfrag.ps

tstpsfrag.ps: tstpsfrag.dvi
	dvips tstpsfrag

tstpsfrag.dvi: test.eps
	$(LATEX) tstpsfrag

test.eps: test.pic
	$(DPIC) -f test.pic > test.eps

test.pic: test.m4 testlinks
	$(M4) $(M4MACROS) test.m4 > test.pic
	$(DPIC) -f test.pic > test.eps
	$(LATEX) tstpsfrag
	touch tstpsfrag.dim
	$(M4) $(M4MACROS) tstpsfrag.dim test.m4 > test.pic

testlinks:
	for file in ics.m4 FlowchartDefs.m4 ; do ln -s ../$$file ; done
	touch testlinks

clean:
	@printf "\n psfrag clean:\n"
	rm -f stamp-* $(FIGS) *.dvi *.bb *.gz tstpsfrag.ps *.out *.pfg Incl.eps
	-if /usr/bin/test -f exlinks ; then \
     ls -l *.m4 | grep '\->' | \
       sed -e 's/^.* \([^ ][^ ]*\) ->.*$$/rm -f \1/' | sh; rm -f exlinks ; fi
	-if /usr/bin/test -f testlinks ; then \
     ls -l *.m4 | grep '\->' | \
       sed -e 's/^.* \([^ ][^ ]*\) ->.*$$/rm -f \1/' | sh; rm -f testlinks ; fi
	for file in $(LOCALFIGS); do rm -f $${file}.m4 ; done
	rm -f *.log *.ps *.aux *.mp *.[0-9] *.[0-9][0-9] *.mpx *.eps *.dim *.pic
	rm -f core log mpxerr* *links figs.* *.dim dims F_test.* setdim.tex
	rm -f man[0-9]*.pic man[0-9]*.m4 figs.m4 test.1 test.mp test.pic test.tex
	-if test -n "$(BOXDIMS)" ; then for box in $(BOXDIMS) ; do \
      rm -f F_$$box.tex $$box.tex ; done; fi
	@printf "\n"