home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / mpware / SMakefile < prev   
Makefile  |  1995-04-12  |  4KB  |  137 lines

  1. # Makefile for the MetaPost support programs.
  2.  
  3. SHELL = rx
  4. srcdir = .
  5. VPATH = .
  6.  
  7. # The missing `configure' mechanism requires this to be done by hand.
  8. bindir = TeXMF:bin/web2c61
  9. rexxdir = TeXMF:web2c61/rexx
  10.  
  11. # This is so kpathsea will get remade automatically if you change
  12. # something in it and recompile from the package directory.
  13. kpathsea_parent = ../..
  14. kpathsea_dir = $(kpathsea_parent)/kpathsea
  15. kpathsea = $(kpathsea_dir)/kpathsea.lib
  16.  
  17. # Routines used everywhere.
  18. commondefines = $(srcdir)/../lib/common.defines
  19. commonh = $(srcdir)/../lib/config.h $(kpathsea_dir)/paths.h
  20. commono = ../lib/lib.lib $(kpathsea)
  21.  
  22. CC = sc
  23. CFLAGS = define=_STRICT_ANSI define=ANSI data=far math=ieee \
  24.     ignore=85+88 noicons optimize
  25. CPPFLAGS = idir=$(srcdir)/../lib idir=../..
  26.  
  27. CCLD = $(CC)
  28. LDFLAGS = $(CFLAGS) $(XLDFLAGS)
  29. LIBS = $(extralibs)
  30. libs = $(commono) $(LIBS)
  31.  
  32. TIE = tie
  33. WMERGE = wmerge
  34.  
  35. INSTALL = copy
  36. INSTALL_PROGRAM = copy
  37. INSTALL_DATA = copy
  38.  
  39. .SUFFIXES:
  40. .SUFFIXES: .o .c .p .ch
  41. .p.c:
  42.     $(SHELL) $(srcdir)/../lib/convert.rexx $*.p $*.c
  43. .ch.p:
  44.     ../web/tangle $*.web $*.ch
  45. .c.o:
  46.     $(CC) $(CPPFLAGS) $(CFLAGS) $*.c
  47.  
  48. default: all
  49.  
  50. all: tex troff
  51. tex: dvitomp mptotex newer
  52. troff: dmp mptotr newer
  53.  
  54. # Don't test mptotr because its source file is identical to mptotex.c
  55. # except for a few string constants.
  56. # This will abort if either diff returns nonzero exit status
  57. # otherwise the test is considered passed.
  58. run-triptrap: mptotex newer
  59.     ./mptotex testex.mp > testex.tex.new
  60.     diff testex.tex.new testex.tex
  61.     @delete testex.tex.new
  62.     sed "16s/^%//" <testex.mp >testex1
  63.     -mptotex testex1 -Etestex2.1 >NIL:
  64.     sed "17s/^%//" <testex.mp >testex1
  65.     -mptotex testex1 -Etestex2.2 >NIL:
  66.     sed "18s/^%//" <testex.mp >testex1
  67.     -mptotex testex1 -Etestex2.3 >NIL:
  68.     sed "19s/^%//" <testex.mp >testex1
  69.     -mptotex testex1 -Etestex2.4 >NIL:
  70.     sed "20s/^%//" <testex.mp >testex1
  71.     -mptotex testex1 -Etestex2.5 >NIL:
  72.     join testex2.1 testex2.2 testex2.3 testex2.4 testex2.5 to testex2
  73.     @delete testex2.?
  74.     diff testex.err testex2
  75.  
  76. # DVItoMP
  77. dvitomp: dvitomp.o $(commono)
  78.     $(CCLD)  link to dvitomp $(LDFLAGS) dvitomp.o $(libs)
  79. dvitomp.o: dvitomp.c $(commonh)
  80. dvitomp.c: dvitomp.p $(commondefines)
  81. dvitomp.p: dvitomp.web andydvitomp.ch
  82.     ../web/tangle dvitomp.web andydvitomp.ch
  83. andydvitomp.ch: dvitomp.ch dvitomp.chch
  84.     $(TIE) -c andydvitomp.ch dvitomp.web dvitomp.ch dvitomp.chch
  85.  
  86. # MPtoTEX
  87. mptotex: andymptotex.o
  88.     $(CCLD) link to mptotex $(LDFLAGS) andymptotex.o
  89. andymptotex.o: andymptotex.c
  90. andymptotex.c: mptotex.c mptotex.ch
  91.     $(WMERGE) mptotex.c mptotex.ch andymptotex.c
  92.  
  93. # MPtoTR
  94. mptotr: andymptotr.o
  95.     $(CCLD) link to mptotr $(LDFLAGS) andymptotr.o
  96. andymptotr.o: andymptotr.c
  97. andymptotr.c: mptotr.c mptotr.ch
  98.     $(WMERGE) mptotr.c mptotr.ch andymptotr.c
  99.  
  100. # DMP
  101.  
  102. SITEDIR = ../mpdist # where the original "site.h" and "default.h" are found
  103.  
  104. dmp: andydmp.o pathexp.o
  105.     $(CCLD) link to dmp $(LDFLAGS) andydmp.o pathexp.o
  106. andydmp.o: andydmp.c site.h
  107.     $(CC) $(CPPFLAGS) $(CFLAGS) idir=.. idir=$(SITEDIR) andydmp.c
  108. andydmp.c: dmp.c dmp.ch
  109.     $(WMERGE) dmp.c dmp.ch andydmp.c
  110. pathexp.o: ../mp/pathexp.c pathexp.ch
  111.     $(WMERGE) ../mp/pathexp.c pathexp.ch pathexp.c
  112.     $(CC) $(CPPFLAGS) $(CFLAGS) idir=.. idir=$(SITEDIR) pathexp.c
  113.  
  114. site.h: $(SITEDIR)/site.h site.hch
  115.     $(WMERGE) $(SITEDIR)/site.h site.hch site.h
  116.  
  117. # newer
  118. newer: andynewer.o
  119.     $(CCLD) link to newer $(LDFLAGS) andynewer.o
  120. andynewer.o: andynewer.c
  121. andynewer.c: newer.c newer.ch
  122.     $(WMERGE) newer.c newer.ch andynewer.c
  123.  
  124. install: install-exec install-data
  125.  
  126. install-exec: all
  127.     $(INSTALL_PROGRAM) $(program) $(bindir)
  128. install-data: makempx.rexx
  129.     $(INSTALL_DATA) makempx.rexx $(rexxdir)
  130.  
  131. clean:
  132.     - delete dvitomp.p dvitomp.pool \#?.o \#?.lnk testex1 testex2
  133.     - delete dvitomp mptotex mptotr dmp newer
  134. veryclean:    clean
  135.     - delete dvitomp.c dvitomp.h \#?.bak \#?.ckp andy\#? \
  136.     site.h pathexp.c
  137.