| 1 |
nigel |
3 |
# Make file for PCRE (Perl-Compatible Regular Expression) library. |
| 2 |
|
|
|
| 3 |
nigel |
39 |
# 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 |
nigel |
37 |
|
| 6 |
nigel |
39 |
# 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 |
nigel |
37 |
# 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 |
nigel |
39 |
######## UNIX ################## UNIX ################## UNIX ################ |
| 39 |
nigel |
37 |
# On a Unix system: |
| 40 |
|
|
# |
| 41 |
nigel |
7 |
# Edit CC, CFLAGS, and RANLIB for your system. |
| 42 |
nigel |
37 |
# |
| 43 |
nigel |
3 |
# It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux, |
| 44 |
|
|
# MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix. |
| 45 |
nigel |
37 |
# |
| 46 |
nigel |
3 |
# Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the |
| 47 |
|
|
# memmove() function, but has bcopy(). |
| 48 |
nigel |
37 |
# |
| 49 |
nigel |
3 |
# 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 |
nigel |
23 |
AR = ar cq |
| 54 |
nigel |
9 |
CC = gcc -O2 -Wall |
| 55 |
nigel |
3 |
CFLAGS = |
| 56 |
|
|
RANLIB = @true |
| 57 |
|
|
|
| 58 |
nigel |
37 |
# 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 |
nigel |
3 |
|
| 65 |
nigel |
37 |
BINDIR = /usr/local/bin |
| 66 |
|
|
INCDIR = /usr/local/include |
| 67 |
|
|
LIBDIR = /usr/local/lib |
| 68 |
|
|
MANDIR = /usr/local/man |
| 69 |
|
|
|
| 70 |
|
|
|
| 71 |
|
|
############################################################################## |
| 72 |
|
|
|
| 73 |
nigel |
39 |
|
| 74 |
nigel |
29 |
OBJ = maketables.o get.o study.o pcre.o |
| 75 |
nigel |
3 |
|
| 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 |
nigel |
27 |
$(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a |
| 83 |
nigel |
3 |
|
| 84 |
|
|
libpcre.a: $(OBJ) |
| 85 |
nigel |
27 |
-rm -f libpcre.a |
| 86 |
nigel |
23 |
$(AR) libpcre.a $(OBJ) |
| 87 |
nigel |
3 |
$(RANLIB) libpcre.a |
| 88 |
|
|
|
| 89 |
|
|
libpcreposix.a: pcreposix.o |
| 90 |
nigel |
27 |
-rm -f libpcreposix.a |
| 91 |
nigel |
23 |
$(AR) libpcreposix.a pcreposix.o |
| 92 |
nigel |
3 |
$(RANLIB) libpcreposix.a |
| 93 |
|
|
|
| 94 |
nigel |
25 |
pcre.o: chartables.c pcre.c pcre.h internal.h Makefile |
| 95 |
nigel |
3 |
$(CC) -c $(CFLAGS) pcre.c |
| 96 |
|
|
|
| 97 |
nigel |
23 |
pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h Makefile |
| 98 |
nigel |
3 |
$(CC) -c $(CFLAGS) pcreposix.c |
| 99 |
|
|
|
| 100 |
nigel |
25 |
maketables.o: maketables.c pcre.h internal.h Makefile |
| 101 |
|
|
$(CC) -c $(CFLAGS) maketables.c |
| 102 |
nigel |
3 |
|
| 103 |
nigel |
29 |
get.o: get.c pcre.h internal.h Makefile |
| 104 |
|
|
$(CC) -c $(CFLAGS) get.c |
| 105 |
|
|
|
| 106 |
nigel |
7 |
study.o: study.c pcre.h internal.h Makefile |
| 107 |
nigel |
3 |
$(CC) -c $(CFLAGS) study.c |
| 108 |
|
|
|
| 109 |
nigel |
7 |
pcretest.o: pcretest.c pcre.h Makefile |
| 110 |
nigel |
3 |
$(CC) -c $(CFLAGS) pcretest.c |
| 111 |
|
|
|
| 112 |
nigel |
7 |
pgrep.o: pgrep.c pcre.h Makefile |
| 113 |
nigel |
3 |
$(CC) -c $(CFLAGS) pgrep.c |
| 114 |
|
|
|
| 115 |
nigel |
25 |
# An auxiliary program makes the default character table source |
| 116 |
nigel |
3 |
|
| 117 |
nigel |
27 |
chartables.c: dftables |
| 118 |
|
|
./dftables >chartables.c |
| 119 |
nigel |
3 |
|
| 120 |
nigel |
27 |
dftables: dftables.c maketables.c pcre.h internal.h Makefile |
| 121 |
|
|
$(CC) -o dftables $(CFLAGS) dftables.c |
| 122 |
nigel |
3 |
|
| 123 |
nigel |
37 |
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 |
nigel |
27 |
# We deliberately omit dftables and chartables.c from 'make clean'; once made |
| 131 |
nigel |
3 |
# 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 |
nigel |
27 |
clean:; -rm -f *.o *.a pcretest pgrep |
| 135 |
nigel |
3 |
|
| 136 |
nigel |
7 |
runtest: all |
| 137 |
nigel |
23 |
./RunTest |
| 138 |
nigel |
7 |
|
| 139 |
nigel |
39 |
######## 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 |
nigel |
3 |
# End |