home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxregexp.zip / makefile.htm next >
Makefile  |  2002-09-14  |  2KB  |  68 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. DEST = ..
  30.  
  31. try:    try.o $(OBJ)
  32.     cc $(LDFLAGS) try.o $(OBJ) -o try
  33.  
  34. # Making timer will probably require putting stuff in $(PROF) and then
  35. # recompiling everything; the following is just the final stage.
  36. timer:    timer.o $(OBJ)
  37.     cc $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer
  38.  
  39. timer.o:    timer.c timer.t.h
  40.  
  41. timer.t.h:    tests
  42.     sed 's/    /","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
  43.  
  44. # Regression test.
  45. r:    try tests
  46.     @echo 'No news is good news...'
  47.     try <tests
  48.  
  49. lint:    timer.t.h
  50.     @echo 'Complaints about multiply-declared regerror() are legit.'
  51.     lint $(LINTFLAGS) $(LSRC) try.c
  52.     lint $(LINTFLAGS) $(LSRC) timer.c
  53.  
  54. regexp.o:    regexp.c regexp.h regmagic.h
  55. regsub.o:    regsub.c regexp.h regmagic.h
  56.  
  57. clean:
  58.     rm -f *.o core mon.out timer.t.h dMakefile dtr try timer
  59.  
  60. dtr:    r makedtr $(DTR)
  61.     makedtr $(DTR) >dtr
  62.  
  63. dMakefile:    Makefile
  64.     sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile
  65.  
  66. mv:    $(OBJ) regerror.o
  67.     mv $(OBJ) regerror.o $(DEST)
  68.