summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/nsvg/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/circuit_macros/examples/nsvg/Makefile')
-rw-r--r--graphics/circuit_macros/examples/nsvg/Makefile92
1 files changed, 92 insertions, 0 deletions
diff --git a/graphics/circuit_macros/examples/nsvg/Makefile b/graphics/circuit_macros/examples/nsvg/Makefile
new file mode 100644
index 0000000000..b2132e1ee8
--- /dev/null
+++ b/graphics/circuit_macros/examples/nsvg/Makefile
@@ -0,0 +1,92 @@
+LIBDIR = $$HOME/lib
+M4LIBS = svg.m4 SVGconfig.m4
+M4LIBS = svg.m4
+
+# To process a single file, copy it to test.m4 and type "make tst"
+# to produce tstSVG.html
+
+DPIC = dpic
+#DPIC = $$HOME/dpic/build/p2c/ftp/dpic
+#DPIC = ../../../dpic/build/p2c/ftp/dpic
+#DPIC = ../../../dpic/bison/dpic
+#DPIC = ../../../dpic/bdev/dpic
+
+# To test the Windows executable. Change these as needed for the operating
+# system. NOTE: AntiqueClockSVG.m4 and Connectors.m4 use awk and sed which
+# do not work at present with the Windows version.
+# M4LIBS = svg.m4 windows.m4
+# DPIC = ../../../dpic/bison/distsrc/Windows/dpic
+
+.SUFFIXES: .pic .svg .m4
+.pic.svg:
+ $(DPIC) -v $*.pic > $*.svg
+ grep '<\!-- width' $*.svg | sed -e 's%<\!-- *%%' -e 's% *-->%%' > $*.siz
+.m4.svg:
+ m4 $(M4LIBS) $*.m4 | sed -e '/^\%/d' > $*.pic
+ $(DPIC) -v $*.pic > $*.svg
+ grep '<\!-- width' $*.svg | sed -e 's%<\!-- *%%' -e 's% *-->%%' > $*.siz
+
+PAGES = examples_1.svg
+
+examplesSVG.html: examplesSVG.htmx pages
+ Version=`sed -e 's/Version //' $(LIBDIR)/doc/Version.tex` ; \
+ sed -e 's/Version XXX/Version '$$Version'/' examplesSVG.htmx \
+ | m4 > examplesSVG.html
+
+pages:
+ (cd .. ; make )
+ cp ../examples.pdf .
+ pdf2svg examples.pdf
+ touch pages
+
+SED = sed -e '/^\%/d'
+TEST = test
+tst:
+ if test -f test.pic; then printf "\n\nUsage: make clean tst\n\n"; exit 1; fi
+ m4 $(M4LIBS) test.m4 | $(SED) > test.pic
+ $(DPIC) -v $(TEST).pic > $(TEST).svg
+ m4 $(M4LIBS) $(TEST).m4 | $(SED) > $(TEST).pic
+ $(DPIC) -v $(TEST).pic > $(TEST).svg
+ grep '<\!-- width' $(TEST).svg | sed -e 's%<\!-- *%%' -e 's% *-->%%' \
+ > $(TEST).siz
+ make tstSVG.html
+
+test.pic:
+ if test -f test.pic ; then echo "Usage: make clean tst" ; fi
+ m4 $(M4LIBS) test.m4 | $(SED) > test.pic
+ m4 $(M4LIBS) test.m4 | $(SED) > test.pic
+
+tstSVG.html: tstSVG.htmx $(TEST).svg
+ Version=`sed -e 's/Version //' $(LIBDIR)/doc/Version.tex` ; \
+ sed -e 's/Version XXX/Version '$$Version'/' \
+ -e 's/XXXXX/'$(TEST)'/g' \
+ tstSVG.htmx | m4 > tstSVG.html
+# cp tstSVG.html $(TEST) $$HOME/public_html/svg
+
+xst: Incleps.png
+
+AntiqueClockSVG.svg ConnectorsSVG.svg:
+ m4 $(M4LIBS) $*.m4 | sed -e '/^\%/d' > $*.pic
+ $(DPIC) -v $*.pic > $*.svg
+ m4 $(M4LIBS) $*.m4 | sed -e '/^\%/d' > $*.pic
+ $(DPIC) -v $*.pic > $*.svg
+ grep '<\!-- width' $*.svg | sed -e 's%<\!-- *%%' -e 's% *-->%%' > $*.siz
+
+InclepsSVG.svg: InclepsSVG.m4
+ m4 $(M4LIBS) $*.m4 | sed -e '/^\%/d' > $*.pic
+ $(DPIC) -v $*.pic > $*.svg
+ $(DPIC) -v $*.pic > $*.svg
+
+Incleps.png:
+ (cd ..; make Incleps.png); cp ../Incleps.png .
+
+clean:
+ @printf "\n svg clean:\n"
+ rm -f *.svg *.dim *.ps *log *.siz *.pic examplesSVG.html Incleps.png
+ rm -f tstSVG.html copy_tmp__
+ rm -f pages
+ @printf "\n"
+
+clobber: clean
+ (cd dev; make clobber)
+ rm -f test.m4