home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / unix / grep1_5.zoo / makefile < prev    next >
Encoding:
Makefile  |  1990-09-02  |  2.0 KB  |  95 lines

  1. #                -*-Fun-*-
  2. # Makefile for GNU e?grep
  3. #
  4.  
  5. XCFLAGS=
  6. MODEL=C
  7. LDFLAGS=/NOE/STACK:0XA000
  8. LIBS=$(GLOB_LIB)
  9. LIB_OBJS=$(BINMODE) $(SETARGV)
  10.  
  11. # Add -DUSG for System V.
  12. CFLAGS = -A$(MODEL) -DUSG $(GLOB_FLAG) $(XCFLAGS)
  13.  
  14. BINMODE=c:\msc\lib\binmode.obj
  15.  
  16. # To use SETARGV.OBJ
  17. # SETARGV=c:\msc\lib\setargv.obj
  18. # GLOB_FLAG=
  19. # GLOB_LIB=
  20.  
  21. # To use GLOBARGV.LIB (GNU globbing)
  22. SETARGV=
  23. GLOB_FLAG=-DGNU_GLOBBING
  24. GLOB_LIB=globargv.lib
  25.  
  26.  
  27. #
  28. # You may add getopt.o if your C library lacks getopt(); note that
  29. # 4.3BSD getopt() is said to be somewhat broken.
  30. #
  31. # Add alloca.o if your machine does not support alloca().
  32. #
  33. OBJS = dfa.obj regex.obj getopt.obj
  34. GOBJ = grep.obj
  35. EOBJ = egrep.obj
  36.  
  37.  
  38. default: egrep.exe grep.exe
  39.  
  40. all: regress
  41.  
  42. regress: egrep.exe grep.exe
  43.     cd tests; sh regress.sh
  44.  
  45. egrep.exe: $(OBJS) $(EOBJ) $(GLOB_LIB)
  46.     link $(LDFLAGS) $(OBJS) $(EOBJ) $(LIB_OBJS),$@,nul,$(LIBS)
  47.  
  48.  
  49. egrep.obj: grep.c
  50.     $(CC) $(CFLAGS) -DEGREP -Fo$@ -c grep.c
  51. #    rm -f egrep.c; cp grep.c egrep.c
  52. #    $(CC) $(CFLAGS) -DEGREP -c egrep.c
  53. #    rm -f egrep.c
  54.  
  55. grep.exe: $(OBJS) $(GOBJ) $(GLOB_LIB)
  56.     link $(LDFLAGS) $(OBJS) $(GOBJ) $(LIB_OBJS),$@,nul,$(LIBS)
  57.  
  58.  
  59. # Compile regex.c with enhancements for matching `$' with `\r\n' sequences.
  60. regex.obj: regex.c regex.h
  61.     $(CC) $(CFLAGS) -DDOLLARS_MATCH_CRLF -c regex.c
  62.  
  63. #clean:
  64. #    rm -f grep egrep *.obj core tests/core tests/tmp.script \
  65. #    tests/khadafy.out egrep.c
  66.  
  67. RM=rm -fv
  68.  
  69. cleanbackups:
  70.     @$(RM) *.~ *.bak *.old
  71.  
  72. clean: cleanbackups
  73.     @$(RM) *.lib *.obj tests\tmp.script tests\khadafy.out
  74. #    @$(RM) egrep.c
  75.  
  76. clobber: clean
  77.     @$(RM) egrep.exe grep.exe
  78.  
  79. ######################################
  80. # GLOBARGV.LIB (GNU globbing of command line arguments)
  81.  
  82. # Order is in general significant in GLOB_OBJ
  83. GLOB_OBJ=globargv.obj glob.obj msd_dir2.obj getwd.obj
  84.  
  85. globargv.lib: $(GLOB_OBJ)
  86.     rm -f $@
  87.     lib $@ $(GLOB_OBJ), nul;
  88.  
  89. msd_dir2.obj glob.obj: msd_dir.h
  90.  
  91. ######################################
  92.  
  93. dfa.obj egrep.obj grep.obj: dfa.h
  94. egrep.obj grep.obj regex.obj: regex.h
  95.