blob: 24d3f0b4f20b18f67d26aa8d6e837de932d54f1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
#
## DOS/WIN (not including DJGPP):
# OBJEXT = obj
# EXEEXT = .exe
EXEEXT =
OBJEXT = o
OBJS = alloca.$(OBJEXT) \
dfa.$(OBJEXT) \
getopt.$(OBJEXT) \
getopt1.$(OBJEXT) \
grep.$(OBJEXT) \
kwset.$(OBJEXT) \
memchr.$(OBJEXT) \
obstack.$(OBJEXT) \
regex.$(OBJEXT) \
savedir.$(OBJEXT) \
search.$(OBJEXT) \
stpcpy.$(OBJEXT)
# Where is DIR and opendir/readdir defined.
# or -DHAVE_DIRENT_H
# or -DHAVE_SYS_NDIR_H
# or -DHAVE_SYS_DIR_H
# or -DHAVE_NDIR_H
#
# undef HAVE_STRERROR if lacking strerror()
# undef HAVE_MEMCHR if lacking memchr()
#
# default dry run
DEFS = -I. \
-DSTDC_HEADERS \
-DHAVE_MEMCHR \
-DHAVE_DIRENT_H \
-DHAVE_STRERROR \
-Dconst= \
-Dsize_t=unsigned
# SunOS-4.1.x k&r cc
#DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -Dconst=
# Solaris
#DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_DIRENT_H -DHAVE_STRERROR
# DOS/WIN (change also OBJEXT/EXEEXT, see above)
# DOS/DJGPP
DEFS = -DSTDC_HEADERS -DHAVE_MEMCHR -DHAVE_STRERROR -DHAVE_DIRENT_H \
-DHAVE_DOS_FILE_NAMES -DHAVE_UNISTD_H -DHAVE_SETMODE
####
CFLAGS = $(DEFS) -I. -DVERSION=\"bootstrap\" -DPACKAGE=\"grep\"
PROGS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT)
all : $(PROGS)
grep$(EXEEXT) : $(OBJS) grepmat.$(OBJEXT)
$(CC) $(OBJS) grepmat.$(OBJEXT) -o grep
egrep$(EXEEXT) : $(OBJS) egrepmat.$(OBJEXT)
$(CC) $(OBJS) egrepmat.$(OBJEXT) -o egrep
fgrep$(EXEEXT) : $(OBJS) fgrepmat.$(OBJEXT)
$(CC) $(OBJS) fgrepmat.$(OBJEXT) -o fgrep
clean :
$(RM) grepmat.$(OBJEXT) egrepmat.$(OBJEXT) fgrepmat.$(OBJEXT)
$(RM) $(OBJS)
$(RM) $(PROGS)
|