home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / SOURCE / REGEXP / MAKEFILE next >
Text File  |  1996-06-04  |  2KB  |  80 lines

  1. #CC=gcc
  2.  
  3. # Things you might want to put in ENV and LENV:
  4. # -Dvoid=int        compilers that don't do void
  5. # -DCHARBITS=0377    compilers that don't do unsigned char
  6. # -DSTATIC=extern    compilers that don't like "static foo();" as forward decl
  7. # -DSTRCSPN        library does not have strcspn()
  8. # -Dstrchr=index    library does not have strchr()
  9. # -DERRAVAIL        have utzoo-compatible error() function and friends
  10. # ENV=-Dvoid=int -DCHARBITS=0377 -DSTATIC=extern
  11. # LENV=-Dvoid=int -DCHARBITS=0377
  12.  
  13. # Things you might want to put in TEST:
  14. # -DDEBUG        debugging hooks
  15. # -I.            regexp.h from current directory, not /usr/include
  16. TEST=-I.
  17.  
  18. # Things you might want to put in PROF:
  19. # -Dstatic='/* */'    make everything global so profiler can see it.
  20. # -p            profiler
  21. PROF=
  22.  
  23. CFLAGS=-O $(ENV) $(TEST) $(PROF)
  24. LINTFLAGS=$(LENV) $(TEST) -ha
  25. LDFLAGS=
  26.  
  27. OBJ=regexp.o regsub.o
  28. LSRC=regexp.c regsub.c regerror.c
  29. DTR=README dMakefile regexp.3 regexp.h regexp.c regsub.c regerror.c \
  30.     regmagic.h Try.c timer.c tests
  31. DEST = ..
  32.  
  33. Try:    Try.o $(OBJ)
  34.     $(CC) $(LDFLAGS) Try.o $(OBJ) -o Try
  35.  
  36. # Making timer will probably require putting stuff in $(PROF) and then
  37. # recompiling everything; the following is just the final stage.
  38. timer:    timer.o $(OBJ)
  39.     $(CC) $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer
  40.  
  41. timer.o:    timer.c timer.t.h
  42.  
  43. timer.t.h:    tests
  44.     sed 's/    /","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
  45.  
  46. # Regression test.
  47. r:    Try tests
  48.     @echo 'No news is good news...'
  49.     Try <tests
  50.  
  51. lint:    timer.t.h
  52.     @echo 'Complaints about multiply-declared regerror() are legit.'
  53.     lint $(LINTFLAGS) $(LSRC) Try.c
  54.     lint $(LINTFLAGS) $(LSRC) timer.c
  55.  
  56. regexp.o:    regexp.c regexp.h regmagic.h
  57. regsub.o:    regsub.c regexp.h regmagic.h
  58.  
  59. clean:
  60.     rm -f *~ *.o core mon.out timer.t.h dMakefile dtr Try timer
  61.  
  62. dtr:    r makedtr $(DTR)
  63.     makedtr $(DTR) >dtr
  64.  
  65. dMakefile:    Makefile
  66.     sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile
  67.  
  68. mv:    $(OBJ) regerror.o
  69.     mv $(OBJ) regerror.o $(DEST)
  70.  
  71. foo: foo.o regexp.o
  72.     $(CC) -o foo foo.o regexp.o
  73.  
  74. DISTSOURCE = Makefile README Try.c regerror.c regexp.3 regexp.README \
  75.     regexp.c regexp.h regmagic.h regsub.c tests timer.c
  76.  
  77. dist:
  78.     test -d $(distdir)/Source/regexp || $(MKDIRHIER) $(distdir)/Source/regexp
  79.     $(CP) $(DISTSOURCE) $(distdir)/Source/regexp/
  80.