home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / ltroff / part01 / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-15  |  3.5 KB  |  184 lines

  1. # @(#)Makefile    4.1
  2.  
  3. #    XXX--correct "or" character
  4. #    XXX--better width tables
  5.  
  6. # Tune these to taste, then
  7. #    make install
  8. # and
  9. #    ltroff your-favorite-troff-input
  10. # If you get reasonable results, you're in business.
  11. # You can use the file "testfile" in the ltroff source directory
  12. # if you lack anything better to test with.
  13.  
  14. TOPDIR=            /usr/local
  15. BINDIR=            $(TOPDIR)/bin
  16. LIBDIR=            $(TOPDIR)/lib
  17. MANDIR=            $(TOPDIR)/man
  18. DATADIR=        $(LIBDIR)/lfont
  19. DEFCART=        uc    # to save a tree or two
  20.  
  21. ALIASES= \
  22.             ao antique-olive \
  23.             c courier \
  24.             co cg-omega \
  25.             ct cg-times \
  26.             ga garamond-antiqua \
  27.             lg letter-gothic \
  28.             u univers \
  29.             uc univers-condensed
  30.  
  31. # On older BSD systems, you'll get to add
  32. #    -Dstrchr=index -Dstrrchr=rindex
  33. # to the end of the next line.
  34.  
  35. DEFINES=        -DDATADIR=\"$(DATADIR)\"
  36.  
  37. #
  38. # Not as likely to be tuned. . .
  39. #
  40.  
  41. LINTFLAGS=        -hbac
  42. CC=            cc $(DEFINES)
  43. CFLAGS=            -g
  44.  
  45. #
  46. # End of stuff you might want to tune.
  47. #
  48.  
  49. CARTS=            ao c co ct ga lg u uc
  50.  
  51. LINT=            lint $(DEFINES)
  52.  
  53. BINS=            ltroff tlc
  54.  
  55. COMMON= \
  56.             common.H \
  57.             fixed.H \
  58.             ftXX.M \
  59.             math-8.M \
  60.             ms_publ.M \
  61.             pitch10.H \
  62.             pitch12.H \
  63.             prop.H \
  64.             tmac \
  65.             win_l1.M \
  66.             wingdings.M \
  67.             wingdings.R
  68.  
  69. UNCOMMON= \
  70.             ao-math-8.R ao-ms_publ.B ao-ms_publ.I ao-ms_publ.R \
  71.             ao-table ao-win_l1.B ao-win_l1.I ao-win_l1.R \
  72.             c-table \
  73.             co-math-8.R co-ms_publ.B co-ms_publ.I co-ms_publ.R \
  74.             co-table co-win_l1.B co-win_l1.I co-win_l1.R \
  75.             ct-math-8.R ct-ms_publ.B ct-ms_publ.I ct-ms_publ.R \
  76.             ct-table ct-win_l1.B ct-win_l1.I ct-win_l1.R \
  77.             ga-math-8.R ga-ms_publ.B ga-ms_publ.I ga-ms_publ.R \
  78.             ga-table ga-win_l1.B ga-win_l1.I ga-win_l1.R \
  79.             lg-table \
  80.             u-math-8.R u-ms_publ.B u-ms_publ.I u-ms_publ.R \
  81.             u-table u-win_l1.B u-win_l1.I u-win_l1.R \
  82.             uc-math-8.R uc-ms_publ.B uc-ms_publ.I uc-ms_publ.R \
  83.             uc-table uc-win_l1.B uc-win_l1.I uc-win_l1.R
  84.  
  85. DATA=            $(COMMON) $(UNCOMMON)
  86.  
  87. MAN1=            ltroff.1
  88. MAN3=            catsup.3
  89. MANS=            $(MAN1) $(MAN3)
  90.  
  91. HEADERS= \
  92.             ansic.h \
  93.             cat.h
  94.  
  95. SOURCES= \
  96.             tlc.c \
  97.             catsup.c
  98.  
  99. OBJECTS= \
  100.             tlc.o \
  101.             catsup.o
  102.  
  103. PUBLIC= \
  104.             README \
  105.             INSTALL \
  106.             $(MANS) \
  107.             testfile \
  108.             Makefile \
  109.             $(HEADERS) \
  110.             $(SOURCES) \
  111.             $(COMMON) \
  112.             $(UNCOMMON)
  113.  
  114. all:            $(BINS) $(DATA) $(MANS)
  115.  
  116. public:            ltroff.tar.Z
  117.  
  118. ltroff.tar.Z:        $(PUBLIC)
  119.             tar cfvp - $(PUBLIC) | compress > $@
  120.  
  121. install:        all
  122.             for i in $(BINS); do install -c $$i $(BINDIR); done
  123.             -mkdir $(LIBDIR) $(DATADIR)
  124.             for i in $(COMMON) ; \
  125.             do \
  126.                 install -c -m 444 $$i $(DATADIR) ; \
  127.             done
  128.             -cd $(DATADIR) ; mkdir $(CARTS)
  129.             for i in $(CARTS) ; \
  130.             do \
  131.                 echo $$i-- ; \
  132.                 dir=$(DATADIR)/$$i ; \
  133.                 for j in $$i-* ; \
  134.                 do \
  135.                     file=`expr $$j : $$i-'\(.*\)'` ; \
  136.                     install -c -m 444 $$j $$dir/$$file ; \
  137.                 done ; \
  138.                 tlc -w $$dir ; \
  139.             done
  140.             set $(DEFCART) default $(ALIASES) ; \
  141.                 chdir $(DATADIR) ; \
  142.                 while [ $$# -ne 0 ] ; \
  143.                 do \
  144.                     rm -f $$2 ; \
  145.                     ln -s $$1 $$2 ; \
  146.                     shift ; \
  147.                     shift ; \
  148.                 done
  149.             -for i in $(MAN1); \
  150.             do \
  151.                 sed 's@DATADIR@$(DATADIR)@' $$i > ,$$i ; \
  152.                 install -m 444 ,$$i $(MANDIR)/man1/$$i ; \
  153.                 rm ,$$i ; \
  154.             done
  155.             -for i in $(MAN3); \
  156.             do \
  157.                 sed 's@DATADIR@$(DATADIR)@' $$i > ,$$i ; \
  158.                 install -m 444 ,$$i $(MANDIR)/man3/$$i ; \
  159.                 rm ,$$i ; \
  160.             done
  161.  
  162. sure:            $(SOURCES) $(HEADERS)
  163.             $(LINT) $(LINTFLAGS) $(SOURCES)
  164.  
  165. clean:
  166.             rm -f $(BINS) *.o *.out core ,* ltroff.tar.Z
  167.  
  168. CLEAN:            clean
  169.             sccs clean
  170.  
  171. tlc:            $(OBJECTS)
  172.             $(CC) $(CFLAGS) $(OBJECTS) -o $@
  173.  
  174. ltroff:            ltroff.sh
  175.             rm -f $@
  176.             sed 's@DATADIR@$(DATADIR)@;s@LIBDIR@$(LIBDIR)@' $? > $@
  177.             chmod +x $@
  178.  
  179. catsup.o:        cat.h
  180.  
  181. tlc.o:            ansic.h cat.h
  182.  
  183. .KEEP_STATE:
  184.