17 |
# given in its arguments, or which it finds out for itself. # |
# given in its arguments, or which it finds out for itself. # |
18 |
#---------------------------------------------------------------------------# |
#---------------------------------------------------------------------------# |
19 |
|
|
20 |
# BINDIR is the directory in which the pgrep command is installed. |
# BINDIR is the directory in which the pcregrep command is installed. |
21 |
# INCDIR is the directory in which the public header file pcre.h is installed. |
# INCDIR is the directory in which the public header file pcre.h is installed. |
22 |
# LIBDIR is the directory in which the libraries are installed. |
# LIBDIR is the directory in which the libraries are installed. |
23 |
# MANDIR is the directory in which the man pages are installed. |
# MANDIR is the directory in which the man pages are installed. |
27 |
prefix = @prefix@ |
prefix = @prefix@ |
28 |
exec_prefix = @exec_prefix@ |
exec_prefix = @exec_prefix@ |
29 |
|
|
30 |
BINDIR = $(exec_prefix)/bin |
BINDIR = @bindir@ |
31 |
LIBDIR = $(exec_prefix)/lib |
LIBDIR = @libdir@ |
32 |
INCDIR = $(prefix)/include |
INCDIR = @includedir@ |
33 |
MANDIR = $(prefix)/man |
MANDIR = @mandir@ |
34 |
|
|
35 |
CC = @CC@ |
CC = @CC@ |
36 |
CFLAGS = @CFLAGS@ |
CFLAGS = @CFLAGS@ |
37 |
RANLIB = @RANLIB@ |
RANLIB = @RANLIB@ |
38 |
|
UTF8 = @UTF8@ |
39 |
|
|
40 |
# LIBTOOL defaults to "", which cuts out the building of shared libraries. |
# LIBTOOL defaults to "./libtool", which enables the building of shared |
41 |
# If "configure" is called with --enable-shared-libraries, then LIBTOOL is |
# libraries. If "configure" is called with --disable-shared-libraries, LIBTOOL |
42 |
# set to "libtool", which causes shared libraries to be built, and LIBSUFFIX |
# is set to "", which stops shared libraries from being built, and LIBSUFFIX |
43 |
# is set to "la" instead of "a", which causes the shared libraries to be |
# is set to "a" instead of "la", which causes the shared libraries not to be |
44 |
# installed. |
# installed. |
45 |
|
|
46 |
LIBTOOL = @LIBTOOL@ |
LIBTOOL = @LIBTOOL@ |
47 |
LIBSUFFIX = @LIBSUFFIX@ |
LIBSUFFIX = @LIBSUFFIX@ |
48 |
|
|
49 |
|
# These are the version numbers for the shared libraries |
50 |
|
|
51 |
|
PCRELIBVERSION = @PCRE_LIB_VERSION@ |
52 |
|
PCREPOSIXLIBVERSION = @PCRE_POSIXLIB_VERSION@ |
53 |
|
|
54 |
|
|
55 |
#---------------------------------------------------------------------------# |
#---------------------------------------------------------------------------# |
56 |
# A copy of install-sh is in this distribution and is used by default. # |
# A copy of install-sh is in this distribution and is used by default. # |
62 |
|
|
63 |
#---------------------------------------------------------------------------# |
#---------------------------------------------------------------------------# |
64 |
# For almost all systems, the command to create a library is "ar cq", but # |
# For almost all systems, the command to create a library is "ar cq", but # |
65 |
# there is at least one where it is different, to make this configurable. # |
# there is at least one where it is different, so this command must be # |
66 |
# However, I haven't got round to learning how to make "configure" find # |
# configurable. However, I haven't got round to learning how to make # |
67 |
# this out for itself. It is necessary to use a command such as # |
# "configure" find this out for itself. It is necessary to use a command # |
68 |
# "make AR='ar -rc'" if you need to vary this. # |
# such as "make AR='ar -rc'" if you need to vary this. The setting of AR is # |
69 |
|
# *not* passed over to ./ltconfig, because it does its own setting up. # |
70 |
#---------------------------------------------------------------------------# |
#---------------------------------------------------------------------------# |
71 |
|
|
72 |
AR = ar cq |
AR = ar cq |
78 |
OBJ = maketables.o get.o study.o pcre.o |
OBJ = maketables.o get.o study.o pcre.o |
79 |
LOBJ = maketables.lo get.lo study.lo pcre.lo |
LOBJ = maketables.lo get.lo study.lo pcre.lo |
80 |
|
|
81 |
all: libtool libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest pgrep |
all: libtool libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest pcregrep |
82 |
|
|
83 |
libtool: config.guess config.sub ltconfig ltmain.sh |
libtool: config.guess config.sub ltconfig ltmain.sh |
84 |
@if test "$(LIBTOOL)" = "libtool"; then \ |
@if test "$(LIBTOOL)" = "./libtool"; then \ |
85 |
echo '--- Building libtool ---'; \ |
echo '--- Building libtool ---'; \ |
86 |
./ltconfig ./ltmain.sh; \ |
CC=$(CC) CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)' ./ltconfig ./ltmain.sh; \ |
87 |
echo '--- Built libtool ---'; fi |
echo '--- Built libtool ---'; fi |
88 |
|
|
89 |
pgrep: libpcre.$(LIBSUFFIX) pgrep.o |
pcregrep: libpcre.$(LIBSUFFIX) pcregrep.o |
90 |
@echo ' ' |
@echo ' ' |
91 |
@echo '--- Building pgrep utility' |
@echo '--- Building pcregrep utility' |
92 |
@echo ' ' |
@echo ' ' |
93 |
$(LIBTOOL) $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.$(LIBSUFFIX) |
$(LIBTOOL) $(CC) $(CFLAGS) -o pcregrep pcregrep.o libpcre.$(LIBSUFFIX) |
94 |
|
|
95 |
pcretest: libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest.o |
pcretest: libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest.o |
96 |
@echo ' ' |
@echo ' ' |
112 |
@echo '--- Building shared library: libpcre' |
@echo '--- Building shared library: libpcre' |
113 |
@echo ' ' |
@echo ' ' |
114 |
-rm -f libpcre.la |
-rm -f libpcre.la |
115 |
libtool $(CC) -o libpcre.la -rpath $(LIBDIR) $(LOBJ) |
./libtool $(CC) -version-info '$(PCRELIBVERSION)' -o libpcre.la -rpath $(LIBDIR) $(LOBJ) |
116 |
|
|
117 |
libpcreposix.a: pcreposix.o |
libpcreposix.a: pcreposix.o |
118 |
@echo ' ' |
@echo ' ' |
127 |
@echo '--- Building shared library: libpcreposix' |
@echo '--- Building shared library: libpcreposix' |
128 |
@echo ' ' |
@echo ' ' |
129 |
-rm -f libpcreposix.la |
-rm -f libpcreposix.la |
130 |
libtool $(CC) -o libpcreposix.la -rpath $(LIBDIR) pcreposix.lo |
./libtool $(CC) -version-info '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la -rpath $(LIBDIR) pcreposix.lo |
131 |
|
|
132 |
pcre.o: chartables.c pcre.c pcre.h internal.h config.h Makefile |
pcre.o: chartables.c pcre.c pcre.h internal.h config.h Makefile |
133 |
$(LIBTOOL) $(CC) -c $(CFLAGS) pcre.c |
$(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) pcre.c |
134 |
|
|
135 |
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h config.h Makefile |
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h config.h Makefile |
136 |
$(LIBTOOL) $(CC) -c $(CFLAGS) pcreposix.c |
$(LIBTOOL) $(CC) -c $(CFLAGS) pcreposix.c |
142 |
$(LIBTOOL) $(CC) -c $(CFLAGS) get.c |
$(LIBTOOL) $(CC) -c $(CFLAGS) get.c |
143 |
|
|
144 |
study.o: study.c pcre.h internal.h config.h Makefile |
study.o: study.c pcre.h internal.h config.h Makefile |
145 |
$(LIBTOOL) $(CC) -c $(CFLAGS) study.c |
$(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) study.c |
146 |
|
|
147 |
pcretest.o: pcretest.c pcre.h config.h Makefile |
pcretest.o: pcretest.c pcre.h config.h Makefile |
148 |
$(CC) -c $(CFLAGS) pcretest.c |
$(CC) -c $(CFLAGS) $(UTF8) pcretest.c |
149 |
|
|
150 |
pgrep.o: pgrep.c pcre.h Makefile config.h |
pcregrep.o: pcregrep.c pcre.h Makefile config.h |
151 |
$(CC) -c $(CFLAGS) pgrep.c |
$(CC) -c $(CFLAGS) $(UTF8) pcregrep.c |
152 |
|
|
153 |
# An auxiliary program makes the default character table source |
# An auxiliary program makes the default character table source |
154 |
|
|
159 |
$(CC) -o dftables $(CFLAGS) dftables.c |
$(CC) -o dftables $(CFLAGS) dftables.c |
160 |
|
|
161 |
install: all |
install: all |
162 |
$(LIBTOOL) $(INSTALL_DATA) libpcre.$(LIBSUFFIX) $(LIBDIR)/libpcre.$(LIBSUFFIX) |
$(LIBTOOL) $(INSTALL_DATA) libpcre.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcre.$(LIBSUFFIX) |
163 |
$(LIBTOOL) $(INSTALL_DATA) libpcreposix.$(LIBSUFFIX) $(LIBDIR)/libpcreposix.$(LIBSUFFIX) |
$(LIBTOOL) $(INSTALL_DATA) libpcreposix.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcreposix.$(LIBSUFFIX) |
164 |
$(INSTALL_DATA) pcre.h $(INCDIR)/pcre.h |
$(INSTALL_DATA) pcre.h $(DESTDIR)/$(INCDIR)/pcre.h |
165 |
$(INSTALL_DATA) doc/pcre.3 $(MANDIR)/man3/pcre.3 |
$(INSTALL_DATA) pcreposix.h $(DESTDIR)/$(INCDIR)/pcreposix.h |
166 |
$(INSTALL_DATA) doc/pcreposix.3 $(MANDIR)/man3/pcre.3 |
$(INSTALL_DATA) doc/pcre.3 $(DESTDIR)/$(MANDIR)/man3/pcre.3 |
167 |
$(INSTALL_DATA) doc/pgrep.1 $(MANDIR)/man1/pgrep.1 |
$(INSTALL_DATA) doc/pcreposix.3 $(DESTDIR)/$(MANDIR)/man3/pcreposix.3 |
168 |
@if test "$(LIBTOOL)" = "libtool"; then \ |
$(INSTALL_DATA) doc/pcregrep.1 $(DESTDIR)/$(MANDIR)/man1/pcregrep.1 |
169 |
echo '--- Rebuilding pgrep to use installed shared library ---'; \ |
@if test "$(LIBTOOL)" = "./libtool"; then \ |
170 |
echo $(CC) $(CFLAGS) -o pgrep pgrep.o -L$(LIBDIR) -lpcre; \ |
echo ' '; \ |
171 |
$(CC) $(CFLAGS) -o pgrep pgrep.o -L$(LIBDIR) -lpcre; \ |
echo '--- Rebuilding pcregrep to use installed shared library ---'; \ |
172 |
|
echo $(CC) $(CFLAGS) -o pcregrep pcregrep.o -L$(DESTDIR)/$(LIBDIR) -lpcre; \ |
173 |
|
$(CC) $(CFLAGS) -o pcregrep pcregrep.o -L$(DESTDIR)/$(LIBDIR) -lpcre; \ |
174 |
|
echo '--- Rebuilding pcretest to use installed shared library ---'; \ |
175 |
|
echo $(CC) $(CFLAGS) -o pcretest pcretest.o -L$(DESTDIR)/$(LIBDIR) -lpcre -lpcreposix; \ |
176 |
|
$(CC) $(CFLAGS) -o pcretest pcretest.o -L$(DESTDIR)/$(LIBDIR) -lpcre -lpcreposix; \ |
177 |
fi |
fi |
178 |
$(INSTALL) pgrep $(BINDIR)/pgrep \ |
$(INSTALL) pcregrep $(DESTDIR)/$(BINDIR)/pcregrep |
179 |
|
$(INSTALL) pcre-config $(DESTDIR)/$(BINDIR)/pcre-config |
180 |
|
|
181 |
# We deliberately omit dftables and chartables.c from 'make clean'; once made |
# We deliberately omit dftables and chartables.c from 'make clean'; once made |
182 |
# chartables.c shouldn't change, and if people have edited the tables by hand, |
# chartables.c shouldn't change, and if people have edited the tables by hand, |
183 |
# you don't want to throw them away. |
# you don't want to throw them away. |
184 |
|
|
185 |
clean:; -rm -rf *.o *.lo *.a *.la .libs pcretest pgrep testtry |
clean:; -rm -rf *.o *.lo *.a *.la .libs pcretest pcregrep testtry |
186 |
|
|
187 |
# But "make distclean" should get back to a virgin distribution |
# But "make distclean" should get back to a virgin distribution |
188 |
|
|
189 |
distclean: clean |
distclean: clean |
190 |
-rm -f chartables.c libtool \ |
-rm -f chartables.c libtool pcre-config pcre.h \ |
191 |
Makefile config.h config.status config.log config.cache |
Makefile config.h config.status config.log config.cache |
192 |
|
|
193 |
check: runtest |
check: runtest |
194 |
|
|
195 |
|
test: runtest |
196 |
|
|
197 |
runtest: all |
runtest: all |
198 |
./RunTest |
./RunTest |
199 |
|
|
202 |
# This addition for mingw32 was contributed by Paul Sokolovsky |
# This addition for mingw32 was contributed by Paul Sokolovsky |
203 |
# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it! |
# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it! |
204 |
|
|
205 |
dll: _dll libpcre.dll.a pgrep_d pcretest_d |
dll: _dll libpcre.dll.a pcregrep_d pcretest_d |
206 |
|
|
207 |
_dll: |
_dll: |
208 |
$(MAKE) CFLAGS=-DSTATIC pcre.dll |
$(MAKE) CFLAGS=-DSTATIC pcre.dll |
210 |
pcre.dll: $(OBJ) pcreposix.o pcre.def |
pcre.dll: $(OBJ) pcreposix.o pcre.def |
211 |
libpcre.dll.a: pcre.def |
libpcre.dll.a: pcre.def |
212 |
|
|
213 |
pgrep_d: libpcre.dll.a pgrep.o |
pcregrep_d: libpcre.dll.a pcregrep.o |
214 |
$(CC) $(CFLAGS) -L. -o pgrep pgrep.o -lpcre.dll |
$(CC) $(CFLAGS) -L. -o pcregrep pcregrep.o -lpcre.dll |
215 |
|
|
216 |
pcretest_d: libpcre.dll.a pcretest.o |
pcretest_d: libpcre.dll.a pcretest.o |
217 |
$(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll |
$(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll |