1 |
|
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 |
# BINDIR is the directory in which the pgrep command is installed.
|
21 |
# 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 |
BINDIR = @bindir@
|
31 |
LIBDIR = @libdir@
|
32 |
INCDIR = @includedir@
|
33 |
MANDIR = @mandir@
|
34 |
|
35 |
CC = @CC@
|
36 |
CFLAGS = @CFLAGS@
|
37 |
RANLIB = @RANLIB@
|
38 |
|
39 |
# LIBTOOL defaults to "", which cuts out the building of shared libraries.
|
40 |
# If "configure" is called with --enable-shared-libraries, then LIBTOOL is
|
41 |
# set to "./libtool", which causes shared libraries to be built, and LIBSUFFIX
|
42 |
# is set to "la" instead of "a", which causes the shared libraries to be
|
43 |
# installed.
|
44 |
|
45 |
LIBTOOL = @LIBTOOL@
|
46 |
LIBSUFFIX = @LIBSUFFIX@
|
47 |
|
48 |
# These are the version numbers for the shared libraries
|
49 |
|
50 |
PCRELIBVERSION = @PCRE_LIB_VERSION@
|
51 |
PCREPOSIXLIBVERSION = @PCRE_POSIXLIB_VERSION@
|
52 |
|
53 |
|
54 |
#---------------------------------------------------------------------------#
|
55 |
# A copy of install-sh is in this distribution and is used by default. #
|
56 |
#---------------------------------------------------------------------------#
|
57 |
|
58 |
INSTALL = ./install-sh -c
|
59 |
INSTALL_DATA = ${INSTALL} -m 644
|
60 |
|
61 |
|
62 |
#---------------------------------------------------------------------------#
|
63 |
# For almost all systems, the command to create a library is "ar cq", but #
|
64 |
# there is at least one where it is different, to make this configurable. #
|
65 |
# However, I haven't got round to learning how to make "configure" find #
|
66 |
# this out for itself. It is necessary to use a command such as #
|
67 |
# "make AR='ar -rc'" if you need to vary this. #
|
68 |
#---------------------------------------------------------------------------#
|
69 |
|
70 |
AR = ar cq
|
71 |
|
72 |
|
73 |
##############################################################################
|
74 |
|
75 |
|
76 |
OBJ = maketables.o get.o study.o pcre.o
|
77 |
LOBJ = maketables.lo get.lo study.lo pcre.lo
|
78 |
|
79 |
all: libtool libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest pgrep
|
80 |
|
81 |
libtool: config.guess config.sub ltconfig ltmain.sh
|
82 |
@if test "$(LIBTOOL)" = "./libtool"; then \
|
83 |
echo '--- Building libtool ---'; \
|
84 |
./ltconfig ./ltmain.sh; \
|
85 |
echo '--- Built libtool ---'; fi
|
86 |
|
87 |
pgrep: libpcre.$(LIBSUFFIX) pgrep.o
|
88 |
@echo ' '
|
89 |
@echo '--- Building pgrep utility'
|
90 |
@echo ' '
|
91 |
$(LIBTOOL) $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.$(LIBSUFFIX)
|
92 |
|
93 |
pcretest: libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest.o
|
94 |
@echo ' '
|
95 |
@echo '--- Building pcretest testing program'
|
96 |
@echo ' '
|
97 |
$(LIBTOOL) $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o \
|
98 |
libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX)
|
99 |
|
100 |
libpcre.a: $(OBJ)
|
101 |
@echo ' '
|
102 |
@echo '--- Building static library: libpcre'
|
103 |
@echo ' '
|
104 |
-rm -f libpcre.a
|
105 |
$(AR) libpcre.a $(OBJ)
|
106 |
$(RANLIB) libpcre.a
|
107 |
|
108 |
libpcre.la: $(OBJ)
|
109 |
@echo ' '
|
110 |
@echo '--- Building shared library: libpcre'
|
111 |
@echo ' '
|
112 |
-rm -f libpcre.la
|
113 |
./libtool $(CC) -version-info '$(PCRELIBVERSION)' -o libpcre.la -rpath $(LIBDIR) $(LOBJ)
|
114 |
|
115 |
libpcreposix.a: pcreposix.o
|
116 |
@echo ' '
|
117 |
@echo '--- Building static library: libpcreposix'
|
118 |
@echo ' '
|
119 |
-rm -f libpcreposix.a
|
120 |
$(AR) libpcreposix.a pcreposix.o
|
121 |
$(RANLIB) libpcreposix.a
|
122 |
|
123 |
libpcreposix.la: pcreposix.o
|
124 |
@echo ' '
|
125 |
@echo '--- Building shared library: libpcreposix'
|
126 |
@echo ' '
|
127 |
-rm -f libpcreposix.la
|
128 |
./libtool $(CC) -version-info '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la -rpath $(LIBDIR) pcreposix.lo
|
129 |
|
130 |
pcre.o: chartables.c pcre.c pcre.h internal.h config.h Makefile
|
131 |
$(LIBTOOL) $(CC) -c $(CFLAGS) pcre.c
|
132 |
|
133 |
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h config.h Makefile
|
134 |
$(LIBTOOL) $(CC) -c $(CFLAGS) pcreposix.c
|
135 |
|
136 |
maketables.o: maketables.c pcre.h internal.h config.h Makefile
|
137 |
$(LIBTOOL) $(CC) -c $(CFLAGS) maketables.c
|
138 |
|
139 |
get.o: get.c pcre.h internal.h config.h Makefile
|
140 |
$(LIBTOOL) $(CC) -c $(CFLAGS) get.c
|
141 |
|
142 |
study.o: study.c pcre.h internal.h config.h Makefile
|
143 |
$(LIBTOOL) $(CC) -c $(CFLAGS) study.c
|
144 |
|
145 |
pcretest.o: pcretest.c pcre.h config.h Makefile
|
146 |
$(CC) -c $(CFLAGS) pcretest.c
|
147 |
|
148 |
pgrep.o: pgrep.c pcre.h Makefile config.h
|
149 |
$(CC) -c $(CFLAGS) pgrep.c
|
150 |
|
151 |
# An auxiliary program makes the default character table source
|
152 |
|
153 |
chartables.c: dftables
|
154 |
./dftables >chartables.c
|
155 |
|
156 |
dftables: dftables.c maketables.c pcre.h internal.h config.h Makefile
|
157 |
$(CC) -o dftables $(CFLAGS) dftables.c
|
158 |
|
159 |
install: all
|
160 |
$(LIBTOOL) $(INSTALL_DATA) libpcre.$(LIBSUFFIX) $(LIBDIR)/libpcre.$(LIBSUFFIX)
|
161 |
$(LIBTOOL) $(INSTALL_DATA) libpcreposix.$(LIBSUFFIX) $(LIBDIR)/libpcreposix.$(LIBSUFFIX)
|
162 |
$(INSTALL_DATA) pcre.h $(INCDIR)/pcre.h
|
163 |
$(INSTALL_DATA) pcreposix.h $(INCDIR)/pcreposix.h
|
164 |
$(INSTALL_DATA) doc/pcre.3 $(MANDIR)/man3/pcre.3
|
165 |
$(INSTALL_DATA) doc/pcreposix.3 $(MANDIR)/man3/pcreposix.3
|
166 |
$(INSTALL_DATA) doc/pgrep.1 $(MANDIR)/man1/pgrep.1
|
167 |
@if test "$(LIBTOOL)" = "./libtool"; then \
|
168 |
echo ' '; \
|
169 |
echo '--- Rebuilding pgrep to use installed shared library ---'; \
|
170 |
echo $(CC) $(CFLAGS) -o pgrep pgrep.o -L$(LIBDIR) -lpcre; \
|
171 |
$(CC) $(CFLAGS) -o pgrep pgrep.o -L$(LIBDIR) -lpcre; \
|
172 |
echo '--- Rebuilding pcretest to use installed shared library ---'; \
|
173 |
echo $(CC) $(CFLAGS) -o pcretest pcretest.o -L$(LIBDIR) -lpcre -lpcreposix; \
|
174 |
$(CC) $(CFLAGS) -o pcretest pcretest.o -L$(LIBDIR) -lpcre -lpcreposix; \
|
175 |
fi
|
176 |
$(INSTALL) pgrep $(BINDIR)/pgrep
|
177 |
$(INSTALL) pcre-config $(BINDIR)/pcre-config
|
178 |
|
179 |
# We deliberately omit dftables and chartables.c from 'make clean'; once made
|
180 |
# chartables.c shouldn't change, and if people have edited the tables by hand,
|
181 |
# you don't want to throw them away.
|
182 |
|
183 |
clean:; -rm -rf *.o *.lo *.a *.la .libs pcretest pgrep testtry
|
184 |
|
185 |
# But "make distclean" should get back to a virgin distribution
|
186 |
|
187 |
distclean: clean
|
188 |
-rm -f chartables.c libtool pcre-config pcre.h \
|
189 |
Makefile config.h config.status config.log config.cache
|
190 |
|
191 |
check: runtest
|
192 |
|
193 |
runtest: all
|
194 |
./RunTest
|
195 |
|
196 |
######## MINGW32 ############### MINGW32 ############### MINGW32 #############
|
197 |
|
198 |
# This addition for mingw32 was contributed by Paul Sokolovsky
|
199 |
# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it!
|
200 |
|
201 |
dll: _dll libpcre.dll.a pgrep_d pcretest_d
|
202 |
|
203 |
_dll:
|
204 |
$(MAKE) CFLAGS=-DSTATIC pcre.dll
|
205 |
|
206 |
pcre.dll: $(OBJ) pcreposix.o pcre.def
|
207 |
libpcre.dll.a: pcre.def
|
208 |
|
209 |
pgrep_d: libpcre.dll.a pgrep.o
|
210 |
$(CC) $(CFLAGS) -L. -o pgrep pgrep.o -lpcre.dll
|
211 |
|
212 |
pcretest_d: libpcre.dll.a pcretest.o
|
213 |
$(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll
|
214 |
|
215 |
# End
|