--- code/trunk/Makefile.in 2007/02/24 21:39:33 49 +++ code/trunk/Makefile.in 2007/02/24 21:40:08 65 @@ -2,30 +2,52 @@ # Makefile.in for PCRE (Perl-Compatible Regular Expression) library. #---------------------------------------------------------------------------# -# To build mingw32 DLL uncomment the next two lines. This addition for # -# mingw32 was contributed by . I (Philip # -# Hazel) don't know anything about it! There are some additional targets at # -# the bottom of this Makefile. # +# MinGW DLLs are built automatically with this configure.in and Makefile.in # +# as long you are using autoconf 2.50 or higher. The Win32 static libraries # +# have not been tested, but appear to be generated. This functionality is # +# by courtesy of Fred Cox. I (Philip Hazel) don't know anything about it, # +# as I live entirely in a non-Windows world. # #---------------------------------------------------------------------------# -# -# include dll.mk -# DLL_LDFLAGS=-s + + +############################################################################# + +# PCRE is developed on a Unix system. I do not use Windows or Macs, and know +# nothing about building software on them. Although the code of PCRE should +# be very portable, the building system in this Makefile is designed for Unix +# systems, with the exception of the mingw32 stuff just mentioned. + +# This setting enables Unix-style directory scanning in pcregrep, triggered +# by the -f option. Maybe one day someone will add code for other systems. + +PCREGREP_OSTYPE=-DIS_UNIX + +############################################################################# #---------------------------------------------------------------------------# -# The next few lines are modified by "configure" to insert data that it is # +# The following lines are modified by "configure" to insert data that it is # # given in its arguments, or which it finds out for itself. # #---------------------------------------------------------------------------# -# BINDIR is the directory in which the pcregrep command is installed. -# INCDIR is the directory in which the public header file pcre.h is installed. -# LIBDIR is the directory in which the libraries are installed. -# MANDIR is the directory in which the man pages are installed. -# The pcretest program, as it is a test program, does not get installed -# anywhere. - +SHELL = @SHELL@ prefix = @prefix@ exec_prefix = @exec_prefix@ +top_srcdir = @top_srcdir@ + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + +# NB: top_builddir is not referred to directly below, but it is used in the +# setting of $(LIBTOOL), so don't remove it! + +top_builddir = . + +# BINDIR is the directory in which the pcregrep, pcretest, and pcre-config +# commands are installed. +# INCDIR is the directory in which the public header files pcre.h and +# pcreposix.h are installed. +# LIBDIR is the directory in which the libraries are installed. +# MANDIR is the directory in which the man pages are installed. BINDIR = @bindir@ LIBDIR = @libdir@ @@ -34,149 +56,138 @@ CC = @CC@ CFLAGS = @CFLAGS@ -RANLIB = @RANLIB@ -UTF8 = @UTF8@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +UTF8 = @UTF8@ +NEWLINE = @NEWLINE@ +POSIX_MALLOC_THRESHOLD = @POSIX_MALLOC_THRESHOLD@ +LINK_SIZE = @LINK_SIZE@ +MATCH_LIMIT= @MATCH_LIMIT@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ -# LIBTOOL defaults to "./libtool", which enables the building of shared -# libraries. If "configure" is called with --disable-shared-libraries, LIBTOOL -# is set to "", which stops shared libraries from being built, and LIBSUFFIX -# is set to "a" instead of "la", which causes the shared libraries not to be -# installed. +# LIBTOOL enables the building of shared and static libraries. It is set up +# to do one or the other or both by ./configure. LIBTOOL = @LIBTOOL@ -LIBSUFFIX = @LIBSUFFIX@ +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) -I. -I$(top_srcdir) $(NEWLINE) $(LINK_SIZE) $(MATCH_LIMIT) +LINK = $(LIBTOOL) --mode=link $(CC) --no-undefined $(CFLAGS) -I. -I$(top_srcdir) # These are the version numbers for the shared libraries PCRELIBVERSION = @PCRE_LIB_VERSION@ PCREPOSIXLIBVERSION = @PCRE_POSIXLIB_VERSION@ - -#---------------------------------------------------------------------------# -# A copy of install-sh is in this distribution and is used by default. # -#---------------------------------------------------------------------------# - -INSTALL = ./install-sh -c -INSTALL_DATA = ${INSTALL} -m 644 - - -#---------------------------------------------------------------------------# -# For almost all systems, the command to create a library is "ar cq", but # -# there is at least one where it is different, so this command must be # -# configurable. However, I haven't got round to learning how to make # -# "configure" find this out for itself. It is necessary to use a command # -# such as "make AR='ar -rc'" if you need to vary this. The setting of AR is # -# *not* passed over to ./ltconfig, because it does its own setting up. # -#---------------------------------------------------------------------------# - -AR = ar cq - - ############################################################################## -OBJ = maketables.o get.o study.o pcre.o -LOBJ = maketables.lo get.lo study.lo pcre.lo +OBJ = maketables.o get.o study.o pcre.o @POSIX_OBJ@ +LOBJ = maketables.lo get.lo study.lo pcre.lo @POSIX_LOBJ@ -all: libtool libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest pcregrep +all: libpcre.la @POSIX_LIB@ pcretest pcregrep -libtool: config.guess config.sub ltconfig ltmain.sh - @if test "$(LIBTOOL)" = "./libtool"; then \ - echo '--- Building libtool ---'; \ - CC=$(CC) CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)' ./ltconfig ./ltmain.sh; \ - echo '--- Built libtool ---'; fi - -pcregrep: libpcre.$(LIBSUFFIX) pcregrep.o - @echo ' ' - @echo '--- Building pcregrep utility' - @echo ' ' - $(LIBTOOL) $(CC) $(CFLAGS) -o pcregrep pcregrep.o libpcre.$(LIBSUFFIX) - -pcretest: libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) pcretest.o - @echo ' ' - @echo '--- Building pcretest testing program' - @echo ' ' - $(LIBTOOL) $(PURIFY) $(CC) $(CFLAGS) -o pcretest pcretest.o \ - libpcre.$(LIBSUFFIX) libpcreposix.$(LIBSUFFIX) - -libpcre.a: $(OBJ) - @echo ' ' - @echo '--- Building static library: libpcre' - @echo ' ' - -rm -f libpcre.a - $(AR) libpcre.a $(OBJ) - $(RANLIB) libpcre.a +pcregrep: libpcre.la pcregrep.o + $(LINK) -o pcregrep pcregrep.o libpcre.la + +pcretest: libpcre.la @POSIX_LIB@ pcretest.o + $(LINK) $(PURIFY) $(EFENCE) -o pcretest pcretest.o \ + libpcre.la @POSIX_LIB@ libpcre.la: $(OBJ) - @echo ' ' - @echo '--- Building shared library: libpcre' - @echo ' ' -rm -f libpcre.la - ./libtool $(CC) -version-info '$(PCRELIBVERSION)' -o libpcre.la -rpath $(LIBDIR) $(LOBJ) - -libpcreposix.a: pcreposix.o - @echo ' ' - @echo '--- Building static library: libpcreposix' - @echo ' ' - -rm -f libpcreposix.a - $(AR) libpcreposix.a pcreposix.o - $(RANLIB) libpcreposix.a + $(LINK) -rpath $(LIBDIR) -version-info \ + '$(PCRELIBVERSION)' -o libpcre.la $(LOBJ) libpcreposix.la: pcreposix.o - @echo ' ' - @echo '--- Building shared library: libpcreposix' - @echo ' ' -rm -f libpcreposix.la - ./libtool $(CC) -version-info '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la -rpath $(LIBDIR) pcreposix.lo - -pcre.o: chartables.c pcre.c pcre.h internal.h config.h Makefile - $(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) pcre.c - -pcreposix.o: pcreposix.c pcreposix.h internal.h pcre.h config.h Makefile - $(LIBTOOL) $(CC) -c $(CFLAGS) pcreposix.c - -maketables.o: maketables.c pcre.h internal.h config.h Makefile - $(LIBTOOL) $(CC) -c $(CFLAGS) maketables.c + $(LINK) -rpath $(LIBDIR) -L. -lpcre -version-info \ + '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la pcreposix.lo -get.o: get.c pcre.h internal.h config.h Makefile - $(LIBTOOL) $(CC) -c $(CFLAGS) get.c +pcre.o: $(top_srcdir)/chartables.c $(top_srcdir)/pcre.c \ + $(top_srcdir)/internal.h $(top_srcdir)/printint.c \ + pcre.h config.h Makefile + $(LTCOMPILE) $(UTF8) $(POSIX_MALLOC_THRESHOLD) $(top_srcdir)/pcre.c + +pcreposix.o: $(top_srcdir)/pcreposix.c $(top_srcdir)/pcreposix.h \ + $(top_srcdir)/internal.h pcre.h config.h Makefile + $(LTCOMPILE) $(POSIX_MALLOC_THRESHOLD) $(top_srcdir)/pcreposix.c + +maketables.o: $(top_srcdir)/maketables.c $(top_srcdir)/internal.h \ + pcre.h config.h Makefile + $(LTCOMPILE) $(top_srcdir)/maketables.c + +get.o: $(top_srcdir)/get.c $(top_srcdir)/internal.h \ + pcre.h config.h Makefile + $(LTCOMPILE) $(top_srcdir)/get.c + +study.o: $(top_srcdir)/study.c $(top_srcdir)/internal.h \ + pcre.h config.h Makefile + $(LTCOMPILE) $(UTF8) $(top_srcdir)/study.c + +pcretest.o: $(top_srcdir)/pcretest.c $(top_srcdir)/internal.h \ + $(top_srcdir)/printint.c \ + pcre.h config.h Makefile + $(CC) -c $(CFLAGS) -I. $(UTF8) $(LINK_SIZE) $(top_srcdir)/pcretest.c -study.o: study.c pcre.h internal.h config.h Makefile - $(LIBTOOL) $(CC) -c $(CFLAGS) $(UTF8) study.c - -pcretest.o: pcretest.c pcre.h config.h Makefile - $(CC) -c $(CFLAGS) $(UTF8) pcretest.c - -pcregrep.o: pcregrep.c pcre.h Makefile config.h - $(CC) -c $(CFLAGS) $(UTF8) pcregrep.c +pcregrep.o: $(top_srcdir)/pcregrep.c pcre.h Makefile config.h + $(CC) -c $(CFLAGS) -I. $(UTF8) $(PCREGREP_OSTYPE) $(top_srcdir)/pcregrep.c # An auxiliary program makes the default character table source -chartables.c: dftables - ./dftables >chartables.c +$(top_srcdir)/chartables.c: dftables + ./dftables >$(top_srcdir)/chartables.c + +dftables.o: $(top_srcdir)/dftables.c $(top_srcdir)/maketables.c \ + $(top_srcdir)/internal.h pcre.h config.h Makefile + $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -I. $(top_srcdir)/dftables.c -dftables: dftables.c maketables.c pcre.h internal.h config.h Makefile - $(CC) -o dftables $(CFLAGS) dftables.c +dftables: dftables.o + $(LINK) -o dftables dftables.o install: all - $(LIBTOOL) $(INSTALL_DATA) libpcre.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcre.$(LIBSUFFIX) - $(LIBTOOL) $(INSTALL_DATA) libpcreposix.$(LIBSUFFIX) $(DESTDIR)/$(LIBDIR)/libpcreposix.$(LIBSUFFIX) - $(INSTALL_DATA) pcre.h $(DESTDIR)/$(INCDIR)/pcre.h - $(INSTALL_DATA) pcreposix.h $(DESTDIR)/$(INCDIR)/pcreposix.h - $(INSTALL_DATA) doc/pcre.3 $(DESTDIR)/$(MANDIR)/man3/pcre.3 - $(INSTALL_DATA) doc/pcreposix.3 $(DESTDIR)/$(MANDIR)/man3/pcreposix.3 - $(INSTALL_DATA) doc/pcregrep.1 $(DESTDIR)/$(MANDIR)/man1/pcregrep.1 - @if test "$(LIBTOOL)" = "./libtool"; then \ - echo ' '; \ - echo '--- Rebuilding pcregrep to use installed shared library ---'; \ - echo $(CC) $(CFLAGS) -o pcregrep pcregrep.o -L$(DESTDIR)/$(LIBDIR) -lpcre; \ - $(CC) $(CFLAGS) -o pcregrep pcregrep.o -L$(DESTDIR)/$(LIBDIR) -lpcre; \ - echo '--- Rebuilding pcretest to use installed shared library ---'; \ - echo $(CC) $(CFLAGS) -o pcretest pcretest.o -L$(DESTDIR)/$(LIBDIR) -lpcre -lpcreposix; \ - $(CC) $(CFLAGS) -o pcretest pcretest.o -L$(DESTDIR)/$(LIBDIR) -lpcre -lpcreposix; \ - fi - $(INSTALL) pcregrep $(DESTDIR)/$(BINDIR)/pcregrep - $(INSTALL) pcre-config $(DESTDIR)/$(BINDIR)/pcre-config + $(mkinstalldirs) $(DESTDIR)$(LIBDIR) + echo "$(LIBTOOL) --mode=install $(INSTALL) libpcre.la $(DESTDIR)$(LIBDIR)/libpcre.la" + $(LIBTOOL) --mode=install $(INSTALL) libpcre.la $(DESTDIR)$(LIBDIR)/libpcre.la + echo "$(LIBTOOL) --mode=install $(INSTALL) libpcreposix.la $(DESTDIR)$(LIBDIR)/libpcreposix.la" + $(LIBTOOL) --mode=install $(INSTALL) libpcreposix.la $(DESTDIR)$(LIBDIR)/libpcreposix.la + $(LIBTOOL) --finish $(DESTDIR)$(LIBDIR) + $(mkinstalldirs) $(DESTDIR)$(INCDIR) + $(INSTALL_DATA) pcre.h $(DESTDIR)$(INCDIR)/pcre.h + $(INSTALL_DATA) $(top_srcdir)/pcreposix.h $(DESTDIR)$(INCDIR)/pcreposix.h + $(mkinstalldirs) $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre.3 $(DESTDIR)$(MANDIR)/man3/pcre.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreapi.3 $(DESTDIR)$(MANDIR)/man3/pcreapi.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrebuild.3 $(DESTDIR)$(MANDIR)/man3/pcrebuild.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrecallout.3 $(DESTDIR)$(MANDIR)/man3/pcrecallout.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrecompat.3 $(DESTDIR)$(MANDIR)/man3/pcrecompat.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcrepattern.3 $(DESTDIR)$(MANDIR)/man3/pcrepattern.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreperform.3 $(DESTDIR)$(MANDIR)/man3/pcreperform.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcreposix.3 $(DESTDIR)$(MANDIR)/man3/pcreposix.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcresample.3 $(DESTDIR)$(MANDIR)/man3/pcresample.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_compile.3 $(DESTDIR)$(MANDIR)/man3/pcre_compile.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_config.3 $(DESTDIR)$(MANDIR)/man3/pcre_config.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_copy_named_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_copy_named_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_copy_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_copy_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_exec.3 $(DESTDIR)$(MANDIR)/man3/pcre_exec.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_free_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_free_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_free_substring_list.3 $(DESTDIR)$(MANDIR)/man3/pcre_free_substring_list.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_fullinfo.3 $(DESTDIR)$(MANDIR)/man3/pcre_fullinfo.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_named_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_named_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_stringnumber.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_stringnumber.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_substring.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_substring.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_get_substring_list.3 $(DESTDIR)$(MANDIR)/man3/pcre_get_substring_list.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_info.3 $(DESTDIR)$(MANDIR)/man3/pcre_info.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_maketables.3 $(DESTDIR)$(MANDIR)/man3/pcre_maketables.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_study.3 $(DESTDIR)$(MANDIR)/man3/pcre_study.3 + $(INSTALL_DATA) $(top_srcdir)/doc/pcre_version.3 $(DESTDIR)$(MANDIR)/man3/pcre_version.3 + $(mkinstalldirs) $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_DATA) $(top_srcdir)/doc/pcregrep.1 $(DESTDIR)$(MANDIR)/man1/pcregrep.1 + $(INSTALL_DATA) $(top_srcdir)/doc/pcretest.1 $(DESTDIR)$(MANDIR)/man1/pcretest.1 + $(mkinstalldirs) $(DESTDIR)$(BINDIR) + $(LIBTOOL) --mode=install $(INSTALL) pcregrep $(DESTDIR)$(BINDIR)/pcregrep + $(LIBTOOL) --mode=install $(INSTALL) pcretest $(DESTDIR)$(BINDIR)/pcretest + $(INSTALL) pcre-config $(DESTDIR)$(BINDIR)/pcre-config # We deliberately omit dftables and chartables.c from 'make clean'; once made # chartables.c shouldn't change, and if people have edited the tables by hand, @@ -197,23 +208,4 @@ runtest: all ./RunTest -######## MINGW32 ############### MINGW32 ############### MINGW32 ############# - -# This addition for mingw32 was contributed by Paul Sokolovsky -# . I (PH) don't know anything about it! - -dll: _dll libpcre.dll.a pcregrep_d pcretest_d - -_dll: - $(MAKE) CFLAGS=-DSTATIC pcre.dll - -pcre.dll: $(OBJ) pcreposix.o pcre.def -libpcre.dll.a: pcre.def - -pcregrep_d: libpcre.dll.a pcregrep.o - $(CC) $(CFLAGS) -L. -o pcregrep pcregrep.o -lpcre.dll - -pcretest_d: libpcre.dll.a pcretest.o - $(PURIFY) $(CC) $(CFLAGS) -L. -o pcretest pcretest.o -lpcre.dll - # End