1 # Makefile for dv2dt, dt2dv
7 # Changes 27 July 2005 by Angus Leeming to enable the Makefile to
8 # work out of the box on both *nix and Windows machines under
9 # the MinSYS environment.
11 # The Makefile can also be used unaltered to build a Windows executable
12 # from a Linux box if make is invoked as:
13 # $ make EXEEXT='.exe' CC='i386-mingw32-gcc'
14 #=======================================================================
16 BINDIR = /usr/local/bin
17 CATDIR = $(MANDIR)/../cat$(MANEXT)
20 # Some compilers don't optimise correctly; for those, don't use `-O2' :
28 # This is a GNU make extension.
29 # If your flavour of make refuses to accept it,
30 # then simply hardcode EXEEXT.
37 DT2DV = dt2dv$(EXEEXT)
38 DV2DT = dv2dt$(EXEEXT)
39 EXES = $(DT2DV) $(DV2DT)
43 MANDIR = /usr/local/man/man$(MANEXT)
45 OBJS = dt2dv.o dv2dt.o
49 DOCS = README dtl.doc dvi.doc dt2dv.man dv2dt.man
50 SRC = Makefile dtl.h dt2dv.c dv2dt.c man2ps
51 TESTS = hello.tex example.tex tripvdu.tex edited.txt
53 DTL_DBN = $(DOCS) $(SRC) $(TESTS)
55 #=======================================================================
57 .SUFFIXES: .hlp .ps .man
60 $(DITROFF) -man -Tascii $< | $(COL) >$@
65 #=======================================================================
69 doc: dt2dv.hlp dv2dt.hlp dt2dv.ps dv2dt.ps
73 check tests: hello example tripvdu edited
76 $(CC) $(CFLAGS) $(LDFLAGS) -o $(DV2DT) dv2dt.o
79 $(CC) $(CFLAGS) $(LDFLAGS) -o $(DT2DV) dt2dv.o
81 hello: hello.dtl dv2dt dt2dv
82 ./$(DT2DV) hello.dtl hello2.dvi
83 ./$(DV2DT) hello2.dvi hello2.dtl
84 -@diff hello.dtl hello2.dtl > hello.dif
85 @if [ -s hello.dif ] ; \
86 then echo ERROR: differences in hello.dif ; \
87 else $(RM) hello.dif ; \
92 ./$(DV2DT) hello.dvi hello.dtl
94 example: example.dtl dv2dt dt2dv
95 ./$(DT2DV) example.dtl example2.dvi
96 ./$(DV2DT) example2.dvi example2.dtl
97 -@diff example.dtl example2.dtl > example.dif
98 @if [ -s example.dif ] ; \
99 then echo ERROR: differences in example.dif ; \
100 else $(RM) example.dif ; \
103 example.dtl: example.tex
105 ./$(DV2DT) example.dvi example.dtl
107 tripvdu: tripvdu.dtl dv2dt dt2dv
108 ./$(DT2DV) tripvdu.dtl tripvdu2.dvi
109 ./$(DV2DT) tripvdu2.dvi tripvdu2.dtl
110 -@diff tripvdu.dtl tripvdu2.dtl > tripvdu.dif
111 @if [ -s tripvdu.dif ] ; \
112 then echo ERROR: differences in tripvdu.dif ; \
113 else $(RM) tripvdu.dif ; \
116 tripvdu.dtl: tripvdu.tex
118 ./$(DV2DT) tripvdu.dvi tripvdu.dtl
120 # edited.txt is already a dtl file.
122 edited: edited.txt dv2dt dt2dv
123 ./$(DT2DV) edited.txt edited.dvi
124 ./$(DV2DT) edited.dvi edited2.dtl
125 ./$(DT2DV) edited2.dtl edited2.dvi
126 ./$(DV2DT) edited2.dvi edited3.dtl
127 @if [ -s edited.dif ] ; \
128 then echo ERROR : differences in edited.dif ; \
129 else $(RM) edited.dif ; \
136 -$(RM) $(EXES) *~ core *.log *.dvi *.dtl *.dif
138 distclean realclean: clobber
139 -$(RM) dt2dv.hlp dv2dt.hlp dt2dv.ps dv2dt.ps
143 $(CP) dt2dv $(BINDIR)/dt2dv
144 $(CHMOD) 775 $(BINDIR)/dt2dv
145 $(CP) dv2dt $(BINDIR)/dv2dt
146 $(CHMOD) 775 $(BINDIR)/dv2dt
147 $(CP) dt2dv.man $(MANDIR)/dt2dv.$(MANEXT)
148 $(CHMOD) 664 $(MANDIR)/dt2dv.$(MANEXT)
149 $(CP) dv2dt.man $(MANDIR)/dv2dt.$(MANEXT)
150 $(CHMOD) 664 $(MANDIR)/dv2dt.$(MANEXT)
153 -$(RM) $(BINDIR)/dt2dv
154 -$(RM) $(BINDIR)/dv2dt
155 -$(RM) $(CATDIR)/dt2dv.$(MANEXT)
156 -$(RM) $(CATDIR)/dv2dt.$(MANEXT)
160 dtl.tar.gz: $(DTL_DBN)
161 tar -czf dtl.tar.gz $(DTL_DBN)
166 zip dtl.zip $(DTL_DBN)