home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / web2c / web / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  4KB  |  158 lines

  1. # Makefile for the WEB programs.
  2. # tangle is bootstrapped from the supplied C source.
  3.  
  4. SHELL = /bin/sh
  5. srcdir = @srcdir@
  6. VPATH = @srcdir@
  7.  
  8. # This is so kpathsea will get remade automatically if you change
  9. # something in it and recompile from the package directory.
  10. kpathsea_parent = ../..
  11. kpathsea_dir = $(kpathsea_parent)/kpathsea
  12. kpathsea = $(kpathsea_dir)/kpathsea.a
  13.  
  14. # Routines used everywhere.
  15. commondefines = $(srcdir)/../lib/common.defines
  16. commonh = $(srcdir)/../lib/config.h $(kpathsea_dir)/paths.h
  17. commono = ../lib/lib.a $(kpathsea)
  18.  
  19. program = tangle weave pooltype
  20.  
  21. CC = @CC@
  22. CFLAGS =
  23. CPPFLAGS = -I../lib -I$(srcdir)/../lib -I../.. -I$(srcdir)/../..
  24.  
  25. CCLD = $(CC)
  26. LDFLAGS = $(CFLAGS) $(XLDFLAGS)
  27. LIBS = @LIBS@ $(extralibs)
  28. libs = $(commono) $(LIBS)
  29.  
  30. INSTALL = @INSTALL@
  31. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  32.  
  33.  
  34. .SUFFIXES:
  35. .SUFFIXES: .o .c .p .ch
  36. .p.c:
  37.     $(SHELL) $(srcdir)/../lib/convert $< $*.c $(srcdir)
  38. .ch.p:
  39.     ./tangle $(srcdir)/$*.web $<
  40.     cp $(srcdir)/$*.p $*.p
  41.     rm -f $(srcdir)/$*.p
  42. .c.o:
  43.     $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
  44.  
  45.  
  46. default: $(all)
  47. all: $(program)
  48. triptrap: tangle
  49.  
  50.  
  51. tangleboot: tangleboot.o $(commono)
  52.     $(CCLD) -o tangleboot $(LDFLAGS) tangleboot.o $(libs)
  53.  
  54. tangleboot.o: tangleboot.c tangleboot.h
  55.  
  56. tangleboot.c tangleboot.h: tangleboot.p
  57.     cd ../web2c; $(MAKE) all
  58.     $(SHELL) $(srcdir)/../lib/convert tangleboot.p temp.c $(srcdir)
  59.     sed s/tangle.h/tangleboot.h/ < temp.c > tangleboot.c
  60.     rm -f temp.c
  61.  
  62. # To make tangleboot.p, we must assume a working tangle.
  63. tangleboot.p: tangle.web tangle.ch
  64.     tangle $(srcdir)/tangle.web $(srcdir)/tangle.ch
  65.     mv tangle.p tangleboot.p
  66.  
  67.  
  68. tangle: tangle.o $(commono)
  69.     $(CCLD) -o tangle $(LDFLAGS) tangle.o $(libs)
  70. tangle.o: tangle.c $(commonh)
  71. tangle.c: tangle.p $(commondefines)
  72.  
  73. # Making tangle.p is a special case, since it is needed to compile
  74. # itself.  We compile the (distributed) tangleboot.c to make a tangle
  75. # which we can use to make the other programs.  (We don't bother to make
  76. # tangle again using itself.)
  77. tangle.p: tangleboot tangle.web tangle.ch
  78.     ./tangleboot $(srcdir)/tangle.web $(srcdir)/tangle.ch
  79.     cp $(srcdir)/tangle.p tangle.p
  80.     rm -f $(srcdir)/tangle.p
  81.  
  82. tangle.web:
  83.     @echo "You seem to be missing tangle.web, perhaps because you"
  84.     @echo "only retrieved web2c.tar.gz, and not web.tar.gz."
  85.     @echo "You need both."
  86.     @echo
  87.     @echo "web.tar.gz should be available from the"
  88.     @echo "same place that you got web2c.tar.gz."
  89.     @echo "In any case, you can get it from ftp.cs.umb.edu:pub/tex."
  90.     exit 1
  91.  
  92. pooltype: pooltype.o $(commono)
  93.     $(CCLD) -o pooltype $(LDFLAGS) pooltype.o $(libs)
  94. pooltype.o: pooltype.c $(commonh)
  95. pooltype.c: pooltype.p $(commondefines)
  96. pooltype.p: pooltype.web pooltype.ch
  97.  
  98.  
  99. weave: weave.o $(commono)
  100.     $(CCLD) -o weave $(LDFLAGS) weave.o $(libs)
  101. weave.o: weave.c $(commonh)
  102. weave.c: weave.p $(commondefines)
  103. weave.p: weave.web weave.ch
  104.  
  105.  
  106. Makefile: Makefile.in ../config.status
  107.     (cd ..; sh config.status)
  108.  
  109. c-sources: pooltype.c tangle.c weave.c
  110. .PHONY: c-sources
  111.  
  112. install install-exec: all
  113.     for p in $(program); do $(INSTALL_PROGRAM) $$p $(bindir)/$$p; done
  114. install-data:
  115.  
  116. TAGS: *.c *.h
  117.     etags -t *.c *.h
  118.  
  119.  
  120. mostlyclean::
  121.     rm -f *.o $(program) $(lib) $(programs)
  122.  
  123. clean:: mostlyclean
  124.     rm -f *.dvi *.pool
  125.  
  126. distclean:: clean
  127.     rm -f Makefile config.status c-auto.h
  128.  
  129. # Although we can remake configure and c-auto.h.in, we don't remove
  130. # them, since many people may lack Autoconf.  Use configclean for that.
  131. realclean:: distclean
  132.     rm -f TAGS *.info*
  133.  
  134. extraclean::
  135.     rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.orig *.pl *.rej
  136.     rm -f *.i *.s *.tfm *.vf *.vpl *\#* *gf *pk *~
  137.     rm -f CONTENTS.tex a.out core mfput.* patch* texput.*
  138.  
  139. configclean:
  140.     rm -f configure c-auto.h.in c-auto.h
  141.  
  142.  
  143. # Prevent GNU make 3 from overflowing arg limit on system V.
  144. .NOEXPORT:
  145.  
  146. mostlyclean::
  147.     rm -f tangleboot
  148.  
  149. # Can't remove *.p *.c *.h because of tangleboot.
  150. clean::
  151.     rm -f pooltype.p pooltype.c pooltype.h
  152.     rm -f tangle.p tangle.c tangle.h
  153.     rm -f weave.p weave.c weave.h
  154.  
  155. # Do not remove tangleboot.[chp] at realclean, even though there are
  156. # targets for them in this Makefile, because we need a working tangle to
  157. # use them, and we might not have one.
  158.