home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / REGEXP.ZIP / MAKEFILE.BSD < prev    next >
Text File  |  1986-04-26  |  2KB  |  64 lines

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