1 |
# Make file for PCRE (Perl-Compatible Regular Expression) library.
|
2 |
|
3 |
# If you are using a Unix system, see below. I am a Unix person, so that is
|
4 |
# the stuff I really know about. PCRE is developed on a Unix box.
|
5 |
|
6 |
# To build mingw32 DLL uncomment the next two lines. This addition for mingw32
|
7 |
# was contributed by Paul Sokolovsky <Paul.Sokolovsky@technologist.com>. I
|
8 |
# (Philip Hazel) don't know anything about it! There are some additional
|
9 |
# targets at the bottom of this Makefile.
|
10 |
#
|
11 |
# include dll.mk
|
12 |
# DLL_LDFLAGS=-s
|
13 |
|
14 |
|
15 |
######## NON-UNIX ############ NON-UNIX ############## NON-UNIX ##############
|
16 |
# If you want to compile PCRE for a non-Unix system, note that it consists
|
17 |
# entirely of code written in Standard C, and so should compile successfully
|
18 |
# using normal compiling commands to do the following:
|
19 |
#
|
20 |
# (1) Compile dftables.c as a stand-alone program, and then run it with
|
21 |
# output sent to chartables.c. This generates a set of standard character
|
22 |
# tables.
|
23 |
#
|
24 |
# (2) Compile maketables.c, get.c, study.c and pcre.c and link them all
|
25 |
# together. This is the pcre library (chartables.c gets included by means of
|
26 |
# an #include directive).
|
27 |
#
|
28 |
# (3) Compile pcreposix.c and link it as the pcreposix library.
|
29 |
#
|
30 |
# (4) Compile the test program pcretest.c. This needs the functions in the
|
31 |
# pcre and pcreposix libraries when linking.
|
32 |
#
|
33 |
# (5) Run pcretest on the testinput files, and check that the output matches
|
34 |
# the corresponding testoutput files. You must use the -i option with
|
35 |
# testinput2.
|
36 |
|
37 |
|
38 |
######## UNIX ################## UNIX ################## UNIX ################
|
39 |
# On a Unix system:
|
40 |
#
|
41 |
# Edit CC, CFLAGS, and RANLIB for your system.
|
42 |
#
|
43 |
# It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
|
44 |
# MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
|
45 |
#
|
46 |
# Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
|
47 |
# memmove() function, but has bcopy().
|
48 |
#
|
49 |
# Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
|
50 |
# lacks the strerror() function, but can provide the equivalent by indexing
|
51 |
# into errlist.
|
52 |
|
53 |
AR = ar cq
|
54 |
CC = gcc -O2 -Wall
|
55 |
CFLAGS =
|
56 |
RANLIB = @true
|
57 |
|
58 |
# If you are going to obey "make install", edit these settings for your
|
59 |
# system. BINDIR is the directory in which the pgrep command is installed.
|
60 |
# INCDIR is the directory in which the public header file pcre.h is installed.
|
61 |
# LIBDIR is the directory in which the libraries are installed. MANDIR is the
|
62 |
# directory in which the man pages are installed. The pcretest program, as it
|
63 |
# is a test program, does not get installed anywhere.
|
64 |
|
65 |
BINDIR = /usr/local/bin
|
66 |
INCDIR = /usr/local/include
|
67 |
LIBDIR = /usr/local/lib
|
68 |
MANDIR = /usr/local/man
|
69 |
|
70 |
|
71 |
##############################################################################
|
72 |
|
73 |
|
74 |
OBJ = maketables.o get.o study.o pcre.o
|
75 |
|
76 |
all: libpcre.a libpcreposix.a pcretest pgrep
|
77 |
|
78 |
pgrep: libpcre.a pgrep.o
|
79 |
$(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
|
80 |
|
81 |
pcretest: libpcre.a libpcreposix.a pcretest.o
|
82 |
$(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
|
83 |
|
84 |
libpcre.a: $(OBJ)
|
85 |
-rm -f libpcre.a
|
86 |
$(AR) libpcre.a $(OBJ)
|
87 |
$(RANLIB) libpcre.a
|
88 |
|
89 |
libpcreposix.a: pcreposix.o
|
90 |
-rm -f libpcreposix.a
|
91 |
$(AR) libpcreposix.a pcreposix.o
|
92 |
$(RANLIB) libpcreposix.a
|
93 |
|
94 |
pcre.o: chartables.c pcre.c pcre.h internal.h Makefile
|
95 |
$(CC) -c $(CFLAGS) pcre.c
|
96 |
|
97 |
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h Makefile
|
98 |
$(CC) -c $(CFLAGS) pcreposix.c
|
99 |
|
100 |
maketables.o: maketables.c pcre.h internal.h Makefile
|
101 |
$(CC) -c $(CFLAGS) maketables.c
|
102 |
|
103 |
get.o: get.c pcre.h internal.h Makefile
|
104 |
$(CC) -c $(CFLAGS) get.c
|
105 |
|
106 |
study.o: study.c pcre.h internal.h Makefile
|
107 |
$(CC) -c $(CFLAGS) study.c
|
108 |
|
109 |
pcretest.o: pcretest.c pcre.h Makefile
|
110 |
$(CC) -c $(CFLAGS) pcretest.c
|
111 |
|
112 |
pgrep.o: pgrep.c pcre.h Makefile
|
113 |
$(CC) -c $(CFLAGS) pgrep.c
|
114 |
|
115 |
# An auxiliary program makes the default character table source
|
116 |
|
117 |
chartables.c: dftables
|
118 |
./dftables >chartables.c
|
119 |
|
120 |
dftables: dftables.c maketables.c pcre.h internal.h Makefile
|
121 |
$(CC) -o dftables $(CFLAGS) dftables.c
|
122 |
|
123 |
install: all
|
124 |
cp libpcre.a libpcreposix.a $(LIBDIR)
|
125 |
cp pcre.h $(INCDIR)
|
126 |
cp pgrep $(BINDIR)
|
127 |
cp pcre.3 pcreposix.3 $(MANDIR)/man3
|
128 |
cp pgrep.1 $(MANDIR)/man1
|
129 |
|
130 |
# We deliberately omit dftables and chartables.c from 'make clean'; once made
|
131 |
# chartables.c shouldn't change, and if people have edited the tables by hand,
|
132 |
# you don't want to throw them away.
|
133 |
|
134 |
clean:; -rm -f *.o *.a pcretest pgrep
|
135 |
|
136 |
runtest: all
|
137 |
./RunTest
|
138 |
|
139 |
######## MINGW32 ############### MINGW32 ############### MINGW32 #############
|
140 |
|
141 |
# This addition for mingw32 was contributed by Paul Sokolovsky
|
142 |
# <Paul.Sokolovsky@technologist.com>. I (PH) don't know anything about it!
|
143 |
|
144 |
dll: _dll libpcre.dll.a pgrep_d pcretest_d
|
145 |
|
146 |
_dll:
|
147 |
$(MAKE) CFLAGS=-DSTATIC pcre.dll
|
148 |
|
149 |
pcre.dll: $(OBJ) pcreposix.o pcre.def
|
150 |
libpcre.dll.a: pcre.def
|
151 |
|
152 |
pgrep_d: libpcre.dll.a pgrep.o
|
153 |
$(CC) $(CFLAGS) -L. -o pgrep pgrep.o -lpcre.dll
|
154 |
|
155 |
pcretest_d: libpcre.dll.a pcretest.o
|
156 |
$(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll
|
157 |
|
158 |
# End
|