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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
# @configure_input@
#
# Makefile for ifile
# Copyright (C) 1997 Jason Daniel Rennie
#
# Written by Jason Rennie <jrennie@ai.mit.edu>
# parts taken from libbow Makefile.in, written by Andrew Kachites McCallum
#
# $Id: Makefile.in,v 1.8 2004/04/30 11:59:57 jrennie Exp $
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SHELL = /bin/sh
#### Start of system configuration section. ####
default:
srcdir = @srcdir@
VPATH = @srcdir@
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
PERL = @PERL@
CC = @CC@
DEFS = @DEFS@
LIBS = @LIBS@
# All these are optional. You can redifine CFLAGS, CPPFLAGS,
# INCLUDEFLAGS and LDFLAGS on the command line however you like.
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
INCLUDEFLAGS =
LDFLAGS =
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
# Installation locations
#if [ ! $bindir ] ; then bindir = $(exec_prefix)/bin; fi
#if [ ! $mandir ] ; then mandir = $(prefix)/man; fi
#### This is just a test---feel free to delete ###
printdirs:
echo $(bindir)
echo $(mandir)
#### End of system configuration section. ####
include $(srcdir)/Version
MAN_1_PAGES = ifile.1
MAN_PAGES = $(MAN_1_PAGES)
LIB_H_FILES = \
include/ifile.h \
include/extendable_array.h \
include/hash_table.h
LIB_C_FILES = \
database.c \
error.c \
hash_table.c \
int4str.c \
istext.c \
lex-define.c \
lex-email.c \
lex-indirect.c \
lex-simple.c \
opts.c \
primes.c \
scan.c \
stem.c \
stoplist.c \
stopwords.c \
util.c
LIB_O_FILES = $(LIB_C_FILES:.c=.o)
MAIN_C_FILES = \
ifile.c
MAIN_O_FILES = $(MAIN_C_FILES:.c=.o)
MAIN_EXECUTABLES = $(MAIN_O_FILES:.o=)
DIST_FILES = \
$(MAN_PAGES) \
$(LIB_C_FILES) \
$(LIB_H_FILES) \
$(MAIN_C_FILES) \
ChangeLog \
COPYING \
INSTALL \
Makefile.in \
NOTES \
Version \
configure \
install-sh \
mkinstalldirs \
test.sh \
README \
INSTALL
# Pattern rule
ALL_CPPFLAGS = $(CPPFLAGS) $(INCLUDEFLAGS) -I$(srcdir) $(DEFS)
ALL_CFLAGS = $(CFLAGS)
%.o: %.c $(LIB_H_FILES) Makefile
$(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
# Rules
default: $(MAIN_EXECUTABLES)
all: libifile.a $(MAIN_EXECUTABLES)
# Compiling code
libifile.a: $(LIB_O_FILES)
$(AR) rc $@ $^
$(RANLIB) $@
argp/libargp.a:
cd argp ; $(MAKE) libargp.a
ALL_LIBS = $(LIBS) -L. -lifile -lm
$(MAIN_EXECUTABLES): %: libifile.a %.o
$(CC) $(CFLAGS) $@.o -o $@ $(LDFLAGS) $(ALL_LIBS)
# ifile.h has macros that indicate ifile's version number; these
# must be kept up-to-date.
include/ifile.h: Version
rm -f $(srcdir)/include/ifile-tmp.h~
mv -f $(srcdir)/include/ifile.h $(srcdir)/include/ifile-tmp.h~
cat $(srcdir)/include/ifile-tmp.h~ | sed -e \
's/e IFILE_MAJOR_VERSION .*/e IFILE_MAJOR_VERSION $(IFILE_MAJOR_VERSION)/' \
| sed -e \
's/e IFILE_MINOR_VERSION .*/e IFILE_MINOR_VERSION $(IFILE_MINOR_VERSION)/' \
| sed -e \
's/e IFILE_TRIFLING_VERSION .*/e IFILE_TRIFLING_VERSION $(IFILE_TRIFLING_VERSION)/' \
| sed -e \
's/e IFILE_VERSION .*/e IFILE_VERSION \"ifile $(IFILE_VERSION)\"/' \
> $(srcdir)/include/ifile.h
# Compiling the Makefile
Makefile: Makefile.in config.status
$(SHELL) config.status
config.status: $(srcdir)/configure
$(SHELL) $(srcdir)/configure --no-create
# Installing
installdirs:
$(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) \
$(DESTDIR)$(mandir)/man1
BUILD_FILES = $(MAIN_EXECUTABLES)
install: $(BUILD_FILES) installdirs
#cd argp ; $(MAKE) install
cd $(DESTDIR)$(bindir) ; rm -f $(MAIN_EXECUTABLES)
for file in $(MAIN_EXECUTABLES); do \
$(INSTALL) $(STRIP) -m 0755 $$file $(DESTDIR)$(bindir) ; \
done
cd $(mandir)/man1 ; rm -f $(MAN_1_PAGES)
for file in $(MAN_1_PAGES); do \
$(INSTALL) -m 0644 $(srcdir)/$$file $(DESTDIR)$(mandir)/man1; \
done
# Cleaning
mostlyclean:
rm -f core *~
cd argp ; $(MAKE) mostlyclean
clean: mostlyclean
rm -f *.o libifile.a $(MAIN_EXECUTABLES)
cd argp ; $(MAKE) clean
maintainer-clean: clean
rm -f config.cache config.log config.status Makefile
cd argp ; $(MAKE) maintainer-clean
# Making a distribution .tar.gz file
# cvs rtag -F release-`echo $(IFILE_VERSION) | tr . -` ifile
dist: ifile-$(IFILE_VERSION).tar.gz
ifile-$(IFILE_VERSION).tar.gz: $(DIST_FILES)
echo ifile-$(IFILE_VERSION) > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
mkdir `cat .fname`/include
for file in $(DIST_FILES); do \
cp $$file `cat .fname`/$$file ; \
done
mkdir `cat .fname`/argp
cd argp ; SNAP=../`cat ../.fname`/argp $(MAKE) snap
tar -chvf `cat .fname`.tar `cat .fname`
rm -f `cat .fname`.tar.gz
gzip -9 `cat .fname`.tar
rm -rf `cat .fname`
# rm -rf /tmp/sv_upload
# mkdir -p /tmp/sv_upload/default.pkg/$(IFILE_VERSION) && cp `cat .fname`.tar.gz /tmp/sv_upload/default.pkg/$(IFILE_VERSION)
# scp -r /tmp/sv_upload/* jrennie@subversions.gnu.org:/upload/ifile
rm -f .fname
diff: $(DIST_FILES)
@if [ ! $(OLD) ] ; then \
echo You must set OLD to the version number against which to diff ; \
exit -1 ; \
fi
@if [ ! $(NEW) ] ; then \
echo You must set NEW to the version number with which to diff ; \
exit -1 ; \
fi
gunzip -c ifile-$(NEW).tar.gz | (cd /tmp ; tar -xf -)
gunzip -c ifile-$(OLD).tar.gz | (cd /tmp ; tar -xf -)
rm -f ifile-$(OLD)-$(NEW).diff
-diff -u -r /tmp/ifile-$(OLD) /tmp/ifile-$(NEW) > ifile-$(OLD)-$(NEW).diff
rm -rf /tmp/ifile-$(NEW)
rm -rf /tmp/ifile-$(OLD)
snapshot: $(DIST_FILES)
echo ifile-`date +%y%m%d` > .fname
rm -rf `cat .fname`
mkdir `cat .fname`
mkdir `cat .fname`/include
for file in $(DIST_FILES); do \
cp $(srcdir)/$$file `cat .fname`/$$file ; \
done
mkdir `cat .fname`/argp
cd argp ; SNAP=`pwd`/../`cat ../.fname`/argp $(MAKE) snap
tar -chvf `cat .fname`.tar `cat .fname`
rm -f `cat .fname`.tar.gz
gzip -9 `cat .fname`.tar
rm -rf `cat .fname`
cvs rtag -F snapshot-`cat .fname` ifile
rm -f .fname
|