home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / grep20.zip / Makefile < prev    next >
Makefile  |  1993-10-17  |  3KB  |  89 lines

  1. # Makefile for GNU grep
  2. # Copyright (C) 1992 Free Software Foundation, Inc.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #### Start of system configuration section. ####
  19.  
  20. CC=gcc
  21. LINT=lint
  22.  
  23. # Things you might add to DEFS:
  24. # -DSTDC_HEADERS    If you have ANSI C headers and libraries.
  25. # -DHAVE_UNISTD_H    If you have unistd.h.
  26. # -DUSG            If you have System V/ANSI C string
  27. #            and memory functions and headers.
  28. # -D__CHAR_UNSIGNED__    If type `char' is unsigned.
  29. #            gcc defines this automatically.
  30. DEFS=    -DGREP -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_GETPAGESIZE \
  31.         -DHAVE_SYS_PARAM_H -DHAVE_STRING_H
  32. # Standard flags for gcc 
  33. CFLAGS=-O2
  34. # use the following line if you want to use the runtime library of emx
  35. # CFLAGS=-O2 -Zmtd
  36. LDFLAGS=-s $(CFLAGS)
  37.  
  38. # Location of source files
  39. srcdir=.
  40. # Prefix for installed program, normally empty or `c:'.
  41. binprefix=
  42. # Prefix for installed man page, normally empty.
  43. manprefix=
  44.  
  45. # Where to install executables.
  46. bindir=/os2/apps
  47. # Where to install emx.dll
  48. dlldir=/os2/apps/dll
  49. #### End of system configuration section. ####
  50.  
  51. SRCS=grep.c getopt.c regex.c dfa.c kwset.c obstack.c search.c
  52. OBJS=grep.o getopt.o regex.o dfa.o kwset.o obstack.o search.o
  53.  
  54. .c.o:
  55.     $(CC) $(CFLAGS) $(DEFS) -I$(srcdir) -c $<
  56.  
  57. all: grep.exe 
  58.  
  59. # For Saber C.
  60. grep.load: $(SRCS)
  61.     #load $(CFLAGS) $(DEFS) -I$(srcdir) (SRCS)
  62.  
  63. # For Lint.
  64. grep.lint: $(SRCS)
  65.     $(LINT) $(CFLAGS) $(DEFS) -I$(srcdir) $(SRCS)
  66.  
  67. check: grep.exe
  68.     $(srcdir)/tests/check
  69.  
  70. install: grep.exe
  71.     copy grep.exe $(BINDIR)/
  72.     copy emx.dll $(DLLDIR)/
  73.  
  74. grep.exe: $(OBJS) $(LIBOBJS) $(ALLOCA)
  75.     $(CC) $(LDFLAGS) -o grep.exe $(OBJS) $(LIBOBJS) $(LIBS) $(ALLOCA)
  76.  
  77. clean:
  78.     if exist grep.exe del grep.exe
  79.     if exist *.o del *.o 
  80.     if exist khadafy.out del khadafy.out
  81.     if exist core del core 
  82.  
  83. # Some header file dependencies that really ought to be automatically deduced.
  84. dfa.o search.o: dfa.h
  85. grep.o search.o: grep.h
  86. kwset.o search.o: kwset.h
  87. kwset.o obstack.o: obstack.h
  88. regex.o search.o: regex.h
  89.