1 |
# Make file for PCRE (Perl-Compatible Regular Expression) library.
|
2 |
|
3 |
# Edit CC, CFLAGS, and RANLIB for your system.
|
4 |
|
5 |
# It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
|
6 |
# MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
|
7 |
|
8 |
# Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
|
9 |
# memmove() function, but has bcopy().
|
10 |
|
11 |
# Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
|
12 |
# lacks the strerror() function, but can provide the equivalent by indexing
|
13 |
# into errlist.
|
14 |
|
15 |
CC = gcc -O2 -Wall
|
16 |
CFLAGS =
|
17 |
RANLIB = @true
|
18 |
|
19 |
##########################################################################
|
20 |
|
21 |
OBJ = chartables.o study.o pcre.o
|
22 |
|
23 |
all: libpcre.a libpcreposix.a pcretest pgrep
|
24 |
|
25 |
pgrep: libpcre.a pgrep.o
|
26 |
$(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
|
27 |
|
28 |
pcretest: libpcre.a libpcreposix.a pcretest.o
|
29 |
$(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
|
30 |
|
31 |
libpcre.a: $(OBJ)
|
32 |
/bin/rm -f libpcre.a
|
33 |
ar cq libpcre.a $(OBJ)
|
34 |
$(RANLIB) libpcre.a
|
35 |
|
36 |
libpcreposix.a: pcreposix.o
|
37 |
/bin/rm -f libpcreposix.a
|
38 |
ar cq libpcreposix.a pcreposix.o
|
39 |
$(RANLIB) libpcreposix.a
|
40 |
|
41 |
pcre.o: pcre.c pcre.h internal.h Makefile
|
42 |
$(CC) -c $(CFLAGS) pcre.c
|
43 |
|
44 |
pcreposix.o: pcreposix.c pcreposix.h internal.h Makefile
|
45 |
$(CC) -c $(CFLAGS) pcreposix.c
|
46 |
|
47 |
chartables.o: chartables.c
|
48 |
$(CC) -c $(CFLAGS) chartables.c
|
49 |
|
50 |
study.o: study.c pcre.h internal.h Makefile
|
51 |
$(CC) -c $(CFLAGS) study.c
|
52 |
|
53 |
pcretest.o: pcretest.c pcre.h Makefile
|
54 |
$(CC) -c $(CFLAGS) pcretest.c
|
55 |
|
56 |
pgrep.o: pgrep.c pcre.h Makefile
|
57 |
$(CC) -c $(CFLAGS) pgrep.c
|
58 |
|
59 |
# An auxiliary program makes the character tables
|
60 |
|
61 |
chartables.c: maketables
|
62 |
./maketables >chartables.c
|
63 |
|
64 |
maketables: maketables.c Makefile
|
65 |
$(CC) -o maketables $(CFLAGS) maketables.c
|
66 |
|
67 |
# We deliberately omit maketables and chartables.c from 'make clean'; once made
|
68 |
# chartables.c shouldn't change, and if people have edited the tables by hand,
|
69 |
# you don't want to throw them away.
|
70 |
|
71 |
clean:; /bin/rm -f *.o *.a pcretest pgrep
|
72 |
|
73 |
# Run the tests
|
74 |
|
75 |
runtest: all
|
76 |
./pcretest testinput testtry
|
77 |
diff testtry testoutput
|
78 |
./pcretest -i testinput2 testtry
|
79 |
diff testtry testoutput2
|
80 |
rm -f testtry
|
81 |
|
82 |
# End
|