/[pcre]/code/trunk/Makefile
ViewVC logotype

Contents of /code/trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 37 - (show annotations)
Sat Feb 24 21:39:09 2007 UTC (12 years, 6 months ago) by nigel
File size: 4112 byte(s)
Load pcre-2.07 into code/trunk.
1 # Make file for PCRE (Perl-Compatible Regular Expression) library.
2
3 # If you are using a Unix system, see below.
4
5 ##############################################################################
6 # If you want to compile PCRE for a non-Unix system, note that it consists
7 # entirely of code written in Standard C, and so should compile successfully
8 # using normal compiling commands to do the following:
9 #
10 # (1) Compile dftables.c as a stand-alone program, and then run it with
11 # output sent to chartables.c. This generates a set of standard character
12 # tables.
13 #
14 # (2) Compile maketables.c, get.c, study.c and pcre.c and link them all
15 # together. This is the pcre library (chartables.c gets included by means of
16 # an #include directive).
17 #
18 # (3) Compile pcreposix.c and link it as the pcreposix library.
19 #
20 # (4) Compile the test program pcretest.c. This needs the functions in the
21 # pcre and pcreposix libraries when linking.
22 #
23 # (5) Run pcretest on the testinput files, and check that the output matches
24 # the corresponding testoutput files. You must use the -i option with
25 # testinput2.
26
27
28 ##############################################################################
29 # On a Unix system:
30 #
31 # Edit CC, CFLAGS, and RANLIB for your system.
32 #
33 # It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
34 # MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
35 #
36 # Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
37 # memmove() function, but has bcopy().
38 #
39 # Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
40 # lacks the strerror() function, but can provide the equivalent by indexing
41 # into errlist.
42
43 AR = ar cq
44 CC = gcc -O2 -Wall
45 CFLAGS =
46 RANLIB = @true
47
48 # If you are going to obey "make install", edit these settings for your
49 # system. BINDIR is the directory in which the pgrep command is installed.
50 # INCDIR is the directory in which the public header file pcre.h is installed.
51 # LIBDIR is the directory in which the libraries are installed. MANDIR is the
52 # directory in which the man pages are installed. The pcretest program, as it
53 # is a test program, does not get installed anywhere.
54
55 BINDIR = /usr/local/bin
56 INCDIR = /usr/local/include
57 LIBDIR = /usr/local/lib
58 MANDIR = /usr/local/man
59
60
61 ##############################################################################
62
63 OBJ = maketables.o get.o study.o pcre.o
64
65 all: libpcre.a libpcreposix.a pcretest pgrep
66
67 pgrep: libpcre.a pgrep.o
68 $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
69
70 pcretest: libpcre.a libpcreposix.a pcretest.o
71 $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
72
73 libpcre.a: $(OBJ)
74 -rm -f libpcre.a
75 $(AR) libpcre.a $(OBJ)
76 $(RANLIB) libpcre.a
77
78 libpcreposix.a: pcreposix.o
79 -rm -f libpcreposix.a
80 $(AR) libpcreposix.a pcreposix.o
81 $(RANLIB) libpcreposix.a
82
83 pcre.o: chartables.c pcre.c pcre.h internal.h Makefile
84 $(CC) -c $(CFLAGS) pcre.c
85
86 pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h Makefile
87 $(CC) -c $(CFLAGS) pcreposix.c
88
89 maketables.o: maketables.c pcre.h internal.h Makefile
90 $(CC) -c $(CFLAGS) maketables.c
91
92 get.o: get.c pcre.h internal.h Makefile
93 $(CC) -c $(CFLAGS) get.c
94
95 study.o: study.c pcre.h internal.h Makefile
96 $(CC) -c $(CFLAGS) study.c
97
98 pcretest.o: pcretest.c pcre.h Makefile
99 $(CC) -c $(CFLAGS) pcretest.c
100
101 pgrep.o: pgrep.c pcre.h Makefile
102 $(CC) -c $(CFLAGS) pgrep.c
103
104 # An auxiliary program makes the default character table source
105
106 chartables.c: dftables
107 ./dftables >chartables.c
108
109 dftables: dftables.c maketables.c pcre.h internal.h Makefile
110 $(CC) -o dftables $(CFLAGS) dftables.c
111
112 install: all
113 cp libpcre.a libpcreposix.a $(LIBDIR)
114 cp pcre.h $(INCDIR)
115 cp pgrep $(BINDIR)
116 cp pcre.3 pcreposix.3 $(MANDIR)/man3
117 cp pgrep.1 $(MANDIR)/man1
118
119 # We deliberately omit dftables and chartables.c from 'make clean'; once made
120 # chartables.c shouldn't change, and if people have edited the tables by hand,
121 # you don't want to throw them away.
122
123 clean:; -rm -f *.o *.a pcretest pgrep
124
125 runtest: all
126 ./RunTest
127
128 # End

  ViewVC Help
Powered by ViewVC 1.1.5