home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / regexps.zip / makefile next >
Makefile  |  1996-09-05  |  2KB  |  112 lines

  1. # Things you might want to put in ENV:
  2. # -DERRAVAIL        have utzoo-compatible error() function and friends
  3. ENV=
  4.  
  5. # Things you might want to put in TEST:
  6. # -DDEBUG        debugging hooks
  7. # -I.            regexp.h from current directory, not /usr/include
  8. TEST=-I.
  9.  
  10. # Things you might want to put in PROF:
  11. # -pg            profiler
  12. PROF=
  13.  
  14. CFLAGS=-O $(ENV) $(TEST) $(PROF)
  15. LDFLAGS=$(PROF)
  16.  
  17. LIB=libregexp.a
  18. OBJ=regexp.o regsub.o regerror.o
  19. TMP=dtr.tmp
  20.  
  21. default:    r
  22.  
  23. try:    try.o $(LIB)
  24.     cc $(LDFLAGS) try.o $(LIB) -o try
  25.  
  26. # Making timer will probably require putting stuff in $(PROF) and then
  27. # recompiling everything; the following is just the final stage.
  28. timer:    timer.o $(LIB)
  29.     cc $(LDFLAGS) timer.o $(LIB) -o timer
  30.  
  31. timer.o:    timer.c timer.t.h
  32.  
  33. timer.t.h:    tests
  34.     sed 's/    /","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
  35.  
  36. # Regression test.
  37. r:    try tests
  38.     ./try <tests        # no news is good news...
  39.  
  40. $(LIB):    $(OBJ)
  41.     ar cr $(LIB) $(OBJ)
  42.  
  43. regexp.o:    regexp.c regexp.h regmagic.h
  44. regsub.o:    regsub.c regexp.h regmagic.h
  45.  
  46. clean:
  47.     rm -f *.o core mon.out gmon.out timer.t.h copy try timer r.*
  48.     rm -f residue rs.* re.1 rm.h re.h ch.soe ch.ps j badcom fig[012]
  49.     rm -f ch.sml fig[12].ps $(LIB)
  50.     rm -rf $(TMP) dtr.*
  51.  
  52. # the rest of this is unlikely to be of use to you
  53.  
  54. BITS = r.1 rs.1 re.1 rm.h re.h
  55. OPT=-p -ms
  56.  
  57. ch.soe:    ch $(BITS)
  58.     soelim ch >$@
  59.  
  60. ch.sml:    ch $(BITS) smlize splitfigs
  61.     splitfigs ch | soelim | smlize >$@
  62.  
  63. fig0 fig1 fig2:    ch splitfigs
  64.     splitfigs ch >/dev/null
  65.  
  66. f:    fig0 fig1 fig2 figs
  67.     groff -Tps -s $(OPT) figs | lpr
  68.  
  69. fig1.ps:    fig0 fig1
  70.     ( cat fig0 ; echo ".LP" ; cat fig1 ) | groff -Tps $(OPT) >$@
  71.  
  72. fig2.ps:    fig0 fig2
  73.     ( cat fig0 ; echo ".LP" ; cat fig2 ) | groff -Tps $(OPT) >$@
  74.  
  75. fp:    fig1.ps fig2.ps
  76.  
  77. r.1:    regexp.c splitter
  78.     splitter regexp.c
  79.  
  80. rs.1:    regsub.c splitter
  81.     splitter regsub.c
  82.  
  83. re.1:    regerror.c splitter
  84.     splitter regerror.c
  85.  
  86. rm.h:    regmagic.h splitter
  87.     splitter regmagic.h
  88.  
  89. re.h:    regexp.h splitter
  90.     splitter regexp.h
  91.  
  92. PLAIN=COPYRIGHT README Makefile regexp.3 try.c timer.c tests
  93. FIX=regexp.h regexp.c regsub.c regerror.c regmagic.h
  94. DTR=$(PLAIN) $(FIX)
  95.  
  96. dtr:    r $(DTR)
  97.     rm -rf $(TMP)
  98.     mkdir $(TMP)
  99.     cp $(PLAIN) $(TMP)
  100.     for f in $(FIX) ; do normalize $$f >$(TMP)/$$f ; done
  101.     ( cd $(TMP) ; makedtr $(DTR) ) >bookregexp.shar
  102.     ( cd $(TMP) ; tar -cvf ../bookregexp.tar $(DTR) )
  103.     rm -rf $(TMP)
  104.  
  105. ch.ps:    ch Makefile $(BITS)
  106.     groff -Tps $(OPT) ch >$@
  107.  
  108. copy:    ch.soe ch.sml fp
  109.     makedtr REMARKS ch.sml fig*.ps ch.soe >$@
  110.  
  111. go:    copy dtr
  112.