| 1 |
nigel |
41 |
|
| 2 |
|
|
# Makefile.in for PCRE (Perl-Compatible Regular Expression) library. |
| 3 |
|
|
|
| 4 |
|
|
#---------------------------------------------------------------------------# |
| 5 |
|
|
# To build mingw32 DLL uncomment the next two lines. This addition for # |
| 6 |
|
|
# mingw32 was contributed by <Paul.Sokolovsky@technologist.com>. I (Philip # |
| 7 |
|
|
# Hazel) don't know anything about it! There are some additional targets at # |
| 8 |
|
|
# the bottom of this Makefile. # |
| 9 |
|
|
#---------------------------------------------------------------------------# |
| 10 |
|
|
# |
| 11 |
|
|
# include dll.mk |
| 12 |
|
|
# DLL_LDFLAGS=-s |
| 13 |
|
|
|
| 14 |
|
|
|
| 15 |
|
|
#---------------------------------------------------------------------------# |
| 16 |
|
|
# The next few lines are modified by "configure" to insert data that it is # |
| 17 |
|
|
# given in its arguments, or which it finds out for itself. # |
| 18 |
|
|
#---------------------------------------------------------------------------# |
| 19 |
|
|
|
| 20 |
nigel |
49 |
# BINDIR is the directory in which the pcregrep command is installed. |
| 21 |
nigel |
41 |
# 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. |
| 23 |
|
|
# MANDIR is the directory in which the man pages are installed. |
| 24 |
|
|
# The pcretest program, as it is a test program, does not get installed |
| 25 |
|
|
# anywhere. |
| 26 |
|
|
|
| 27 |
|
|
prefix = @prefix@ |
| 28 |
|
|
exec_prefix = @exec_prefix@ |
| 29 |
|
|
|
| 30 |
nigel |
43 |
BINDIR = @bindir@ |
| 31 |
|
|
LIBDIR = @libdir@ |
| 32 |
|
|
INCDIR = @includedir@ |
| 33 |
|
|
MANDIR = @mandir@ |
| 34 |
nigel |
41 |
|
| 35 |
|
|
CC = @CC@ |
| 36 |
|
|
CFLAGS = @CFLAGS@ |
| 37 |
|
|
RANLIB = @RANLIB@ |
| 38 |
nigel |
49 |
UTF8 = @UTF8@ |
| 39 |
nigel |
41 |
|
| 40 |
nigel |
49 |
# LIBTOOL defaults to "./libtool", which enables the building of shared |
| 41 |
|
|
# libraries. If "configure" is called with --disable-shared-libraries, LIBTOOL |
| 42 |
|
|
# is set to "", which stops shared libraries from being built, and LIBSUFFIX |
| 43 |
|
|
# is set to "a" instead of "la", which causes the shared libraries not to be |
| 44 |
nigel |
41 |
# installed. |
| 45 |
|
|
|
| 46 |
|
|
LIBTOOL = @LIBTOOL@ |
| 47 |
|
|
LIBSUFFIX = @LIBSUFFIX@ |
| 48 |
|
|
|
| 49 |
nigel |
43 |
# These are the version numbers for the shared libraries |
| 50 |
nigel |
41 |
|
| 51 |
nigel |
43 |
PCRELIBVERSION = @PCRE_LIB_VERSION@ |
| 52 |
|
|
PCREPOSIXLIBVERSION = @PCRE_POSIXLIB_VERSION@ |
| 53 |
|
|
|
| 54 |
|
|
|
| 55 |
nigel |
41 |
#---------------------------------------------------------------------------# |
| 56 |
|
|
# A copy of install-sh is in this distribution and is used by default. # |
| 57 |
|
|
#---------------------------------------------------------------------------# |
| 58 |
|
|
|
| 59 |
|
|
INSTALL = ./install-sh -c |
| 60 |
|
|
INSTALL_DATA = ${INSTALL} -m 644 |
| 61 |
|
|
|
| 62 |
|
|
|
| 63 |
|
|
#---------------------------------------------------------------------------# |
| 64 |
|
|
# For almost all systems, the command to create a library is "ar cq", but # |
| 65 |
nigel |
49 |
# there is at least one where it is different, so this command must be # |
| 66 |
|
|
# configurable. However, I haven't got round to learning how to make # |
| 67 |
|
|
# "configure" find this out for itself. It is necessary to use a command # |
| 68 |
|
|
# 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 |
nigel |
41 |
#---------------------------------------------------------------------------# |
| 71 |
|
|
|
| 72 |
|
|
AR = ar cq |
| 73 |
|
|
|
| 74 |
|
|
|
| 75 |
|
|
############################################################################## |
| 76 |
|
|
|
| 77 |
|
|
|
| 78 |
|
|
OBJ = maketables.o get.o study.o pcre.o |
| 79 |
|
|
LOBJ = maketables.lo get.lo study.lo pcre.lo |
| 80 |
|
|
|
| 81 |
nigel |
49 |
all: libtool libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest pcregrep |
| 82 |
nigel |
41 |
|
| 83 |
|
|
libtool: config.guess config.sub ltconfig ltmain.sh |
| 84 |
nigel |
47 |
@if test "$(LIBTOOL)" = "./libtool"; then \ |
| 85 |
nigel |
41 |
echo '--- Building libtool ---'; \ |
| 86 |
nigel |
49 |
CC=$(CC) CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)' ./ltconfig ./ltmain.sh; \ |
| 87 |
nigel |
41 |
echo '--- Built libtool ---'; fi |
| 88 |
|
|
|
| 89 |
nigel |
49 |
pcregrep: libpcre.$(LIBSUFFIX) pcregrep.o |
| 90 |
nigel |
41 |
@echo ' ' |
| 91 |
nigel |
49 |
@echo '--- Building pcregrep utility' |
| 92 |
nigel |
41 |
@echo ' ' |
| 93 |
nigel |
49 |
$(LIBTOOL) $(CC) $(CFLAGS) -o pcregrep pcregrep.o libpcre.$(LIBSUFFIX) |
| 94 |
nigel |
41 |
|
| 95 |
|
|
pcretest: libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest.o |
| 96 |
|
|
@echo ' ' |
| 97 |
|
|
@echo '--- Building pcretest testing program' |
| 98 |
|
|
@echo ' ' |
| 99 |
|
|
$(LIBTOOL) $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o \ |
| 100 |
|
|
libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) |
| 101 |
|
|
|
| 102 |
|
|
libpcre.a: $(OBJ) |
| 103 |
|
|
@echo ' ' |
| 104 |
|
|
@echo '--- Building static library: libpcre' |
| 105 |
|
|
@echo ' ' |
| 106 |
|
|
-rm -f libpcre.a |
| 107 |
|
|
$(AR) libpcre.a $(OBJ) |
| 108 |
|
|
$(RANLIB) libpcre.a |
| 109 |
|
|
|
| 110 |
|
|
libpcre.la: $(OBJ) |
| 111 |
|
|
@echo ' ' |
| 112 |
|
|
@echo '--- Building shared library: libpcre' |
| 113 |
|
|
@echo ' ' |
| 114 |
|
|
-rm -f libpcre.la |
| 115 |
nigel |
47 |
./libtool $(CC) -version-info '$(PCRELIBVERSION)' -o libpcre.la -rpath $(LIBDIR) $(LOBJ) |
| 116 |
nigel |
41 |
|
| 117 |
|
|
libpcreposix.a: pcreposix.o |
| 118 |
|
|
@echo ' ' |
| 119 |
|
|
@echo '--- Building static library: libpcreposix' |
| 120 |
|
|
@echo ' ' |
| 121 |
|
|
-rm -f libpcreposix.a |
| 122 |
|
|
$(AR) libpcreposix.a pcreposix.o |
| 123 |
|
|
$(RANLIB) libpcreposix.a |
| 124 |
|
|
|
| 125 |
|
|
libpcreposix.la: pcreposix.o |
| 126 |
|
|
@echo ' ' |
| 127 |
|
|
@echo '--- Building shared library: libpcreposix' |
| 128 |
|
|
@echo ' ' |
| 129 |
|
|
-rm -f libpcreposix.la |
| 130 |
nigel |
47 |
./libtool $(CC) -version-info '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la -rpath $(LIBDIR) pcreposix.lo |
| 131 |
nigel |
41 |
|
| 132 |
|
|
pcre.o: chartables.c pcre.c pcre.h internal.h config.h Makefile |
| 133 |
nigel |
49 |
$(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) pcre.c |
| 134 |
nigel |
41 |
|
| 135 |
|
|
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h config.h Makefile |
| 136 |
|
|
$(LIBTOOL) $(CC) -c $(CFLAGS) pcreposix.c |
| 137 |
|
|
|
| 138 |
|
|
maketables.o: maketables.c pcre.h internal.h config.h Makefile |
| 139 |
|
|
$(LIBTOOL) $(CC) -c $(CFLAGS) maketables.c |
| 140 |
|
|
|
| 141 |
|
|
get.o: get.c pcre.h internal.h config.h Makefile |
| 142 |
|
|
$(LIBTOOL) $(CC) -c $(CFLAGS) get.c |
| 143 |
|
|
|
| 144 |
|
|
study.o: study.c pcre.h internal.h config.h Makefile |
| 145 |
nigel |
49 |
$(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) study.c |
| 146 |
nigel |
41 |
|
| 147 |
|
|
pcretest.o: pcretest.c pcre.h config.h Makefile |
| 148 |
nigel |
49 |
$(CC) -c $(CFLAGS) $(UTF8) pcretest.c |
| 149 |
nigel |
41 |
|
| 150 |
nigel |
49 |
pcregrep.o: pcregrep.c pcre.h Makefile config.h |
| 151 |
|
|
$(CC) -c $(CFLAGS) $(UTF8) pcregrep.c |
| 152 |
nigel |
41 |
|
| 153 |
|
|
# An auxiliary program makes the default character table source |
| 154 |
|
|
|
| 155 |
|
|
chartables.c: dftables |
| 156 |
|
|
./dftables >chartables.c |
| 157 |
|
|
|
| 158 |
|
|
dftables: dftables.c maketables.c pcre.h internal.h config.h Makefile |
| 159 |
|
|
$(CC) -o dftables $(CFLAGS) dftables.c |
| 160 |
|
|
|
| 161 |
|
|
install: all |
| 162 |
nigel |
49 |
$(LIBTOOL) $(INSTALL_DATA) libpcre.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcre.$(LIBSUFFIX) |
| 163 |
|
|
$(LIBTOOL) $(INSTALL_DATA) libpcreposix.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcreposix.$(LIBSUFFIX) |
| 164 |
|
|
$(INSTALL_DATA) pcre.h $(DESTDIR)/$(INCDIR)/pcre.h |
| 165 |
|
|
$(INSTALL_DATA) pcreposix.h $(DESTDIR)/$(INCDIR)/pcreposix.h |
| 166 |
|
|
$(INSTALL_DATA) doc/pcre.3 $(DESTDIR)/$(MANDIR)/man3/pcre.3 |
| 167 |
|
|
$(INSTALL_DATA) doc/pcreposix.3 $(DESTDIR)/$(MANDIR)/man3/pcreposix.3 |
| 168 |
|
|
$(INSTALL_DATA) doc/pcregrep.1 $(DESTDIR)/$(MANDIR)/man1/pcregrep.1 |
| 169 |
nigel |
47 |
@if test "$(LIBTOOL)" = "./libtool"; then \ |
| 170 |
nigel |
43 |
echo ' '; \ |
| 171 |
nigel |
49 |
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 |
nigel |
43 |
echo '--- Rebuilding pcretest to use installed shared library ---'; \ |
| 175 |
nigel |
49 |
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 |
nigel |
41 |
fi |
| 178 |
nigel |
49 |
$(INSTALL) pcregrep $(DESTDIR)/$(BINDIR)/pcregrep |
| 179 |
|
|
$(INSTALL) pcre-config $(DESTDIR)/$(BINDIR)/pcre-config |
| 180 |
nigel |
41 |
|
| 181 |
|
|
# 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, |
| 183 |
|
|
# you don't want to throw them away. |
| 184 |
|
|
|
| 185 |
nigel |
49 |
clean:; -rm -rf *.o *.lo *.a *.la .libs pcretest pcregrep testtry |
| 186 |
nigel |
41 |
|
| 187 |
|
|
# But "make distclean" should get back to a virgin distribution |
| 188 |
|
|
|
| 189 |
|
|
distclean: clean |
| 190 |
nigel |
43 |
-rm -f chartables.c libtool pcre-config pcre.h \ |
| 191 |
nigel |
41 |
Makefile config.h config.status config.log config.cache |
| 192 |
|
|
|
| 193 |
|
|
check: runtest |
| 194 |
|
|
|
| 195 |
nigel |
49 |
test: runtest |
| 196 |
|
|
|
| 197 |
nigel |
41 |
runtest: all |
| 198 |
|
|
./RunTest |
| 199 |
|
|
|
| 200 |
|
|
######## MINGW32 ############### MINGW32 ############### MINGW32 ############# |
| 201 |
|
|
|
| 202 |
|
|
# This addition for mingw32 was contributed by Paul Sokolovsky |
| 203 |
|
|
# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it! |
| 204 |
|
|
|
| 205 |
nigel |
49 |
dll: _dll libpcre.dll.a pcregrep_d pcretest_d |
| 206 |
nigel |
41 |
|
| 207 |
|
|
_dll: |
| 208 |
|
|
$(MAKE) CFLAGS=-DSTATIC pcre.dll |
| 209 |
|
|
|
| 210 |
|
|
pcre.dll: $(OBJ) pcreposix.o pcre.def |
| 211 |
|
|
libpcre.dll.a: pcre.def |
| 212 |
|
|
|
| 213 |
nigel |
49 |
pcregrep_d: libpcre.dll.a pcregrep.o |
| 214 |
|
|
$(CC) $(CFLAGS) -L. -o pcregrep pcregrep.o -lpcre.dll |
| 215 |
nigel |
41 |
|
| 216 |
|
|
pcretest_d: libpcre.dll.a pcretest.o |
| 217 |
|
|
$(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll |
| 218 |
|
|
|
| 219 |
|
|
# End |