-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.in
166 lines (133 loc) · 5.69 KB
/
Makefile.in
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved.
srcdir = @srcdir@
VPATH = @srcdir@
SHELL = /bin/sh
CC = @CC@
LIBS = @LIBS@
CP = @CP@
STRIP = @STRIP@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_MAN = ${INSTALL} -m 444
DEFS =
DYNFILTER = @DYNFILTER@
prefix = @prefix@
exec_prefix = @exec_prefix@
binprefix =
manprefix =
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man/man1
manext = 1
MANUAL = glimpse.1 glimpseindex.1 glimpseserver.1
# YOU DON'T HAVE TO CHANGE ANYTHING BELOW THIS LINE
# The binaries will be made in ./bin/. and the libraries are assumed to
# be in ./lib . You normally don't have to change them.
# NOTE: GLIMPSEDIR can be relative or absolute.
GLIMPSEDIR = ..
BINDIR = bin
AGREPDIR = agrep
INDEXDIR = index
COMPRESSDIR = compress
TEMPLATEDIR = libtemplate
LIBDIR = lib
LIBTEMPLATEDIR = $(TEMPLATEDIR)/lib
SUBDIRS = compress agrep libtemplate index $(DYNFILTER)
LIBAGREP = agrep
LIBCOMPRESS = cast
LIBTEMPLATE = template
LIBUTIL = util
PROG = glimpse
PROGSERVER = glimpseserver
NOTSPROG = nots$(PROG)
NOTSPROGSERVER = nots$(PROGSERVER)
PROGINDEX = index/glimpseindex
PROGAGREP = agrep/agrep
OPTIMIZEFLAGS = -O2
INCLUDEFLAGS = -I$(INDEXDIR) -I$(AGREPDIR) -I$(TEMPLATEDIR)/include
CFLAGS = $(INCLUDEFLAGS) $(DEFS)
OBJS = get_filename.o \
get_index.o \
split.o \
$(INDEXDIR)/region.o \
$(INDEXDIR)/getword.o \
$(INDEXDIR)/filetype.o \
$(INDEXDIR)/simpletest.o \
$(INDEXDIR)/memlook.o \
$(INDEXDIR)/lib.o\
$(INDEXDIR)/io.o
HDRS = $(INDEXDIR)/glimpse.h $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(AGREPDIR)/re.h $(INDEXDIR)/region.h
SRC = main.c \
get_filename.c \
get_index.c \
split.c \
$(INDEXDIR)/region.c \
$(INDEXDIR)/getword.c \
$(INDEXDIR)/filetype.c \
$(INDEXDIR)/simpletest.c \
$(INDEXDIR)/memlook.c \
$(INDEXDIR)/io.c
all: build-sub @TARGET@
Sall: $(PROG) $(PROGSERVER) $(PROGINDEX)
agrep: $(PROGAGREP)
NOTSall: $(NOTSPROG) $(NOTSPROGSERVER)
build-sub:
# these empty dirs are not in git
[ -d $(BINDIR) ] || mkdir $(BINDIR)
[ -d $(LIBDIR) ] || mkdir $(LIBDIR)
for d in $(SUBDIRS) ; do \
( cd $$d; $(MAKE) ); \
done
# Check target
check: all
$(SHELL) test/check.sh
# INSTALL on Solaris should be carried one at a time. :-(
install: all installdirs install-man
for d in $(SUBDIRS) ; do \
( cd $$d; $(MAKE) $@ ); \
done
for d in $(BINDIR)/$(PROG) $(BINDIR)/$(PROGSERVER) ; do \
$(INSTALL) $$d $(bindir) ; \
done
install-man:
for d in $(MANUAL) ; do \
$(INSTALL_MAN) $$d $(mandir) ; \
done
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs $(bindir) $(mandir)
clean:
for d in $(SUBDIRS); do \
( cd $$d; $(MAKE) $@ ); \
done
rm -f main_server.o main_server.c main.o $(OBJS) core a.out config.log
rm -f $(LIBDIR)/lib$(LIBCOMPRESS).a $(LIBDIR)/lib$(LIBAGREP).a
rm -f $(BINDIR)/*
distclean: clean
for d in $(SUBDIRS); do \
( cd $$d; $(MAKE) $@ ); \
done
rm -f Makefile config.cache config.status
$(PROG): main.o $(OBJS) $(SRC) $(HDRS) $(LIBDIR)/lib$(LIBAGREP).a $(LIBTEMPLATEDIR)/lib$(LIBTEMPLATE).a $(LIBTEMPLATEDIR)/lib$(LIBUTIL).a $(LIBDIR)/lib$(LIBCOMPRESS).a
$(CC) $(LDFLAGS) -L$(LIBDIR) -L$(LIBTEMPLATEDIR) -o $(BINDIR)/$(PROG) main.o $(OBJS) -l$(LIBAGREP) -l$(LIBTEMPLATE) -l$(LIBUTIL) $(LIBS)
$(NOTSPROG): main.o $(OBJS) $(SRC) $(HDRS) $(LIBDIR)/lib$(LIBAGREP).a $(LIBDIR)/lib$(LIBCOMPRESS).a
$(CC) $(LDFLAGS) -L$(LIBDIR) -o $(BINDIR)/$(PROG) main.o $(OBJS) -l$(LIBAGREP) $(LIBS)
$(PROGINDEX): $(PROGAGREP) $(LIBDIR)/lib$(LIBAGREP).a $(LIBTEMPLATEDIR)/lib$(LIBTEMPLATE).a $(LIBTEMPLATEDIR)/lib$(LIBUTIL).a $(LIBDIR)/lib$(LIBCOMPRESS).a
cd $(INDEXDIR) ; $(MAKE) -f Makefile.linux CC="$(CC)" SUBDIRCFLAGS="$(SUBDIRCFLAGS)" SUBDIRLINKFLAGS="$(SUBDIRLINKFLAGS)" SHELL="$(SHELL)" HAVE_DIRENT_H="$(HAVE_DIRENT_H)" HAVE_SYS_DIR_H="$(HAVE_SYS_DIR_H)" HAVE_SYS_NDIR_H="$(HAVE_SYS_NDIR_H)" HAVE_NDIR_H="$(HAVE_NDIR_H)" UTIME="$(UTIME)" STRUCTURED_QUERIES="$(STRUCTURED_QUERIES)" ISO_CHAR_SET="$(ISO_CHAR_SET)" SFS_COMPAT="$(SFS_COMPAT)"
$(PROGAGREP): $(LIBDIR)/lib$(LIBCOMPRESS).a
cd $(AGREPDIR) ; $(MAKE) -f Makefile.linux CC="$(CC)" SUBDIRCFLAGS="$(SUBDIRCFLAGS)" SUBDIRLINKFLAGS="$(SUBDIRLINKFLAGS)" SHELL="$(SHELL)" HAVE_DIRENT_H="$(HAVE_DIRENT_H)" HAVE_SYS_DIR_H="$(HAVE_SYS_DIR_H)" HAVE_SYS_NDIR_H="$(HAVE_SYS_NDIR_H)" HAVE_NDIR_H="$(HAVE_NDIR_H)" UTIME="$(UTIME)" STRUCTURED_QUERIES="$(STRUCTURED_QUERIES)" ISO_CHAR_SET="$(ISO_CHAR_SET)" SFS_COMPAT="$(SFS_COMPAT)"
$(PROGSERVER): main_server.o $(OBJS) $(SRC) $(HDRS) $(LIBDIR)/lib$(LIBAGREP).a $(LIBTEMPLATEDIR)/lib$(LIBTEMPLATE).a $(LIBTEMPLATEDIR)/lib$(LIBUTIL).a $(LIBDIR)/lib$(LIBCOMPRESS).a
$(CC) $(LDFLAGS) -L$(LIBDIR) -L$(LIBTEMPLATEDIR) -o $(BINDIR)/$(PROGSERVER) main_server.o $(OBJS) -l$(LIBAGREP) -l$(LIBTEMPLATE) -l$(LIBUTIL) $(LIBS)
$(NOTSPROGSERVER): main_server.o $(OBJS) $(SRC) $(HDRS) $(LIBDIR)/lib$(LIBAGREP).a $(LIBDIR)/lib$(LIBCOMPRESS).a
$(CC) $(LDFLAGS) -L$(LIBDIR) -o $(BINDIR)/$(PROGSERVER) main_server.o $(OBJS) -l$(LIBAGREP) $(LIBS)
main_server.o: main.c defs.h $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(INDEXDIR)/glimpse.h
cp main.c main_server.c
$(CC) -c $(CFLAGS) -DISSERVER=1 -o $@ main_server.c
main.o: main.c defs.h $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(INDEXDIR)/glimpse.h
$(CC) -c $(CFLAGS) -DISSERVER=0 -o $@ main.c
get_filename.o: get_filename.c $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(INDEXDIR)/glimpse.h
$(CC) -c $(CFLAGS) -o $@ get_filename.c
get_index.o: get_index.c $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(INDEXDIR)/glimpse.h
$(CC) -c $(CFLAGS) -o $@ get_index.c
split.o: split.c $(AGREPDIR)/agrep.h $(AGREPDIR)/checkfile.h $(INDEXDIR)/glimpse.h
$(CC) -c $(CFLAGS) -o $@ split.c