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

Diff of /code/trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by nigel, Sat Feb 24 21:38:45 2007 UTC revision 37 by nigel, Sat Feb 24 21:39:09 2007 UTC
# Line 1  Line 1 
1  # Make file for PCRE (Perl-Compatible Regular Expression) library.  # Make file for PCRE (Perl-Compatible Regular Expression) library.
2    
3  # Edit CC, CFLAGS, and RANLIB for your system.  # 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,  # It is believed that RANLIB=ranlib is required for AIX, BSDI, FreeBSD, Linux,
34  # MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.  # MIPS RISCOS, NetBSD, OpenBSD, Digital Unix, and Ultrix.
35    #
36  # Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the  # Use CFLAGS = -DUSE_BCOPY on SunOS4 and any other system that lacks the
37  # memmove() function, but has bcopy().  # memmove() function, but has bcopy().
38    #
39  # Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that  # Use CFLAGS = -DSTRERROR_FROM_ERRLIST on SunOS4 and any other system that
40  # lacks the strerror() function, but can provide the equivalent by indexing  # lacks the strerror() function, but can provide the equivalent by indexing
41  # into errlist.  # into errlist.
# Line 17  CC = gcc -O2 -Wall Line 45  CC = gcc -O2 -Wall
45  CFLAGS =  CFLAGS =
46  RANLIB = @true  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  OBJ = maketables.o study.o pcre.o  
61    ##############################################################################
62    
63    OBJ = maketables.o get.o study.o pcre.o
64    
65  all:            libpcre.a libpcreposix.a pcretest pgrep  all:            libpcre.a libpcreposix.a pcretest pgrep
66    
# Line 27  pgrep:          libpcre.a pgrep.o Line 68  pgrep:          libpcre.a pgrep.o
68                  $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a                  $(CC) $(CFLAGS) -o pgrep pgrep.o libpcre.a
69    
70  pcretest:       libpcre.a libpcreposix.a pcretest.o  pcretest:       libpcre.a libpcreposix.a pcretest.o
71                  $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a                  $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
72    
73  libpcre.a:      $(OBJ)  libpcre.a:      $(OBJ)
74                  /bin/rm -f libpcre.a                  -rm -f libpcre.a
75                  $(AR) libpcre.a $(OBJ)                  $(AR) libpcre.a $(OBJ)
76                  $(RANLIB) libpcre.a                  $(RANLIB) libpcre.a
77    
78  libpcreposix.a: pcreposix.o  libpcreposix.a: pcreposix.o
79                  /bin/rm -f libpcreposix.a                  -rm -f libpcreposix.a
80                  $(AR) libpcreposix.a pcreposix.o                  $(AR) libpcreposix.a pcreposix.o
81                  $(RANLIB) libpcreposix.a                  $(RANLIB) libpcreposix.a
82    
# Line 48  pcreposix.o:    pcreposix.c pcreposix.h Line 89  pcreposix.o:    pcreposix.c pcreposix.h
89  maketables.o:   maketables.c pcre.h internal.h Makefile  maketables.o:   maketables.c pcre.h internal.h Makefile
90                  $(CC) -c $(CFLAGS) maketables.c                  $(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  study.o:        study.c pcre.h internal.h Makefile
96                  $(CC) -c $(CFLAGS) study.c                  $(CC) -c $(CFLAGS) study.c
97    
# Line 59  pgrep.o:        pgrep.c pcre.h Makefile Line 103  pgrep.o:        pgrep.c pcre.h Makefile
103    
104  # An auxiliary program makes the default character table source  # An auxiliary program makes the default character table source
105    
106  chartables.c:   deftables  chartables.c:   dftables
107                  ./deftables >chartables.c                  ./dftables >chartables.c
108    
109    dftables:       dftables.c maketables.c pcre.h internal.h Makefile
110                    $(CC) -o dftables $(CFLAGS) dftables.c
111    
112  deftables:      deftables.c maketables.c pcre.h internal.h Makefile  install:        all
113                  $(CC) -o deftables $(CFLAGS) deftables.c                  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 deftables and chartables.c from 'make clean'; once made  # 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,  # chartables.c shouldn't change, and if people have edited the tables by hand,
121  # you don't want to throw them away.  # you don't want to throw them away.
122    
123  clean:;         /bin/rm -f *.o *.a pcretest pgrep  clean:;         -rm -f *.o *.a pcretest pgrep
124    
125  runtest:        all  runtest:        all
126                  ./RunTest                  ./RunTest

Legend:
Removed from v.25  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.5