home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / regexp / Makefile.orig < prev    next >
Encoding:
Makefile  |  1994-04-27  |  2.1 KB  |  91 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=
  9. LENV=
  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=-I.
  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. #CC=gcc -traditional
  22. CFLAGS=-O $(ENV) $(TEST) $(PROF)
  23. LINTFLAGS=$(LENV) $(TEST) -ha
  24. LDFLAGS=
  25.  
  26. # If your ar already sets up symbol tables
  27. RANLIB=: no ranlib needed for
  28. # If your ar does not do it
  29. # RANLIB=ranlib
  30.  
  31.  
  32.  
  33. OBJ=regexp.o regsub.o regerror.o
  34.  
  35. LSRC=regexp.c regsub.c regerror.c
  36.  
  37. DTR=README dMakefile regexp.3 regexp.h regexp.c regsub.c regerror.c \
  38.         regmagic.h try.c timer.c tests
  39.  
  40.  
  41. all:    libregexp.a
  42.  
  43. libregexp.a: $(OBJ)
  44.     ar r libregexp.a $(OBJ)
  45.     $(RANLIB) libregexp.a
  46.  
  47.  
  48. regexp.o:    regexp.c regexp.h regmagic.h
  49.  
  50. regsub.o:    regsub.c regexp.h regmagic.h
  51.  
  52.  
  53.  
  54. try:    try.o libregexp.a
  55.         $(CC) $(LDFLAGS) try.o libregexp.a -o try
  56.  
  57. # Making timer will probably require putting stuff in $(PROF) and then
  58. # recompiling everything; the following is just the final stage.
  59. timer:    timer.o libregexp.a
  60.         $(CC) $(LDFLAGS) $(PROF) timer.o libregexp.a -o timer
  61.  
  62. timer.o:    timer.c timer.t.h
  63.  
  64. timer.t.h:    tests
  65.         sed 's/    /","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
  66.  
  67. # Regression test.
  68. r:    try tests
  69.         @echo 'No news is good news...'
  70.         try <tests
  71.  
  72. lint:    timer.t.h
  73.         @echo 'Complaints about multiply-declared regerror() are legit.'
  74.         lint $(LINTFLAGS) $(LSRC) try.c
  75.         lint $(LINTFLAGS) $(LSRC) timer.c
  76.  
  77.  
  78.  
  79.  
  80. clean:
  81.         rm -f *.o core mon.out timer.t.h dMakefile dtr try timer
  82.  
  83. realclean: clean
  84.     rm -f libregexp.a
  85.  
  86. dtr:    r makedtr $(DTR)
  87.         makedtr $(DTR) >dtr
  88.  
  89. dMakefile:    Makefile
  90.         sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile
  91.