tgupdate: merge pcreposix-compat base into pcreposix-compat
[pcreposix-compat.git] / Makefile.am
blobbb56b4e84b98b772a09acea14af2959b486f1224
1 ## Process this file with automake to produce Makefile.in.
3 ACLOCAL_AMFLAGS = -I m4
5 dist_doc_DATA = \
6   doc/pcre.txt \
7   doc/pcre-config.txt \
8   doc/pcregrep.txt \
9   doc/pcretest.txt \
10   AUTHORS \
11   COPYING \
12   ChangeLog \
13   LICENCE \
14   NEWS \
15   README.txt \
16   README-PCRE \
17   README-GIT-REGEX \
18   config.mak
20 # Note that pcrecpp.html is not in this list; it is listed separately below.
22 dist_html_DATA = \
23   doc/html/NON-AUTOTOOLS-BUILD.txt \
24   doc/html/README.txt \
25   doc/html/index.html \
26   doc/html/pcre-config.html \
27   doc/html/pcre.html \
28   doc/html/pcre16.html \
29   doc/html/pcre32.html \
30   doc/html/pcre_assign_jit_stack.html \
31   doc/html/pcre_compile.html \
32   doc/html/pcre_compile2.html \
33   doc/html/pcre_config.html \
34   doc/html/pcre_copy_named_substring.html \
35   doc/html/pcre_copy_substring.html \
36   doc/html/pcre_dfa_exec.html \
37   doc/html/pcre_exec.html \
38   doc/html/pcre_free_study.html \
39   doc/html/pcre_free_substring.html \
40   doc/html/pcre_free_substring_list.html \
41   doc/html/pcre_fullinfo.html \
42   doc/html/pcre_get_named_substring.html \
43   doc/html/pcre_get_stringnumber.html \
44   doc/html/pcre_get_stringtable_entries.html \
45   doc/html/pcre_get_substring.html \
46   doc/html/pcre_get_substring_list.html \
47   doc/html/pcre_jit_exec.html \
48   doc/html/pcre_jit_stack_alloc.html \
49   doc/html/pcre_jit_stack_free.html \
50   doc/html/pcre_maketables.html \
51   doc/html/pcre_pattern_to_host_byte_order.html \
52   doc/html/pcre_refcount.html \
53   doc/html/pcre_study.html \
54   doc/html/pcre_utf16_to_host_byte_order.html \
55   doc/html/pcre_utf32_to_host_byte_order.html \
56   doc/html/pcre_version.html \
57   doc/html/pcreapi.html \
58   doc/html/pcrebuild.html \
59   doc/html/pcrecallout.html \
60   doc/html/pcrecompat.html \
61   doc/html/pcredemo.html \
62   doc/html/pcregrep.html \
63   doc/html/pcrejit.html \
64   doc/html/pcrelimits.html \
65   doc/html/pcrematching.html \
66   doc/html/pcrepartial.html \
67   doc/html/pcrepattern.html \
68   doc/html/pcreperform.html \
69   doc/html/pcreposix.html \
70   doc/html/pcreprecompile.html \
71   doc/html/pcresample.html \
72   doc/html/pcrestack.html \
73   doc/html/pcresyntax.html \
74   doc/html/pcretest.html \
75   doc/html/pcreunicode.html
77 pcrecpp_html = doc/html/pcrecpp.html
78 dist_noinst_DATA = $(pcrecpp_html)
80 if WITH_PCRE_CPP
81 html_DATA = $(pcrecpp_html)
82 endif
84 # The Libtool libraries to install.  We'll add to this later.
85 lib_LTLIBRARIES =
87 # Unit tests you want to run when people type 'make check'.
88 # TESTS is for binary unit tests, check_SCRIPTS for script-based tests
89 TESTS =
90 check_SCRIPTS =
91 dist_noinst_SCRIPTS =
93 # Some of the binaries we make are to be installed, and others are
94 # (non-user-visible) helper programs needed to build libpcre, libpcre16
95 # or libpcre32.
96 bin_PROGRAMS =
97 noinst_PROGRAMS =
99 # Additional files to delete on 'make clean' and 'make maintainer-clean'.
100 CLEANFILES = regex.h
101 MAINTAINERCLEANFILES =
103 # Additional files to bundle with the distribution, over and above what
104 # the Autotools include by default.
105 EXTRA_DIST =
107 # These files contain additional m4 macros that are used by autoconf.
108 EXTRA_DIST += \
109   m4/ax_pthread.m4 m4/pcre_visibility.m4
111 # These files contain maintenance information
112 EXTRA_DIST += \
113   doc/perltest.txt \
114   NON-UNIX-USE \
115   NON-AUTOTOOLS-BUILD \
116   HACKING
118 # These files are used in the preparation of a release
119 EXTRA_DIST += \
120   PrepareRelease \
121   CheckMan \
122   CleanTxt \
123   Detrail \
124   132html \
125   doc/index.html.src
127 # These files are to do with building for Virtual Pascal
128 EXTRA_DIST += \
129   makevp.bat \
130   makevp_c.txt \
131   makevp_l.txt \
132   pcregexp.pas
134 # These files are usable versions of pcre.h and config.h that are distributed
135 # for the benefit of people who are building PCRE manually, without the
136 # Autotools support.
137 EXTRA_DIST += \
138   pcre.h.generic \
139   config.h.generic
141 # The only difference between pcre.h.in and pcre.h is the setting of the PCRE
142 # version number. Therefore, we can create the generic version just by copying.
143 pcre.h.generic: pcre.h.in configure.ac
144         rm -f $@
145         cp -p pcre.h $@
147 # It is more complicated for config.h.generic. We need the version that results
148 # from a default configuration so as to get all the default values for PCRE
149 # configuration macros such as MATCH_LIMIT and NEWLINE. We can get this by
150 # doing a configure in a temporary directory. However, some trickery is needed,
151 # because the source directory may already be configured. If you just try
152 # running configure in a new directory, it complains. For this reason, we move
153 # config.status out of the way while doing the default configuration. The
154 # resulting config.h is munged by perl to put #ifdefs round any #defines for
155 # macros with values, and to #undef all boolean macros such as HAVE_xxx and
156 # SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make
157 # sure that PCRE_EXP_DEFN is unset (in case it has visibility settings).
158 config.h.generic: configure.ac
159         rm -rf $@ _generic
160         mkdir _generic
161         cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
162         cd _generic && $(abs_top_srcdir)/configure || :
163         cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
164         test -f _generic/config.h
165         perl -n \
166           -e 'BEGIN{$$blank=0;}' \
167           -e 'if(/PCRE_EXP_DEFN/){print"/* #undef PCRE_EXP_DEFN */\n";$$blank=0;next;}' \
168           -e 'if(/to make a symbol visible/){next;}' \
169           -e 'if(/__attribute__ \(\(visibility/){next;}' \
170           -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
171           -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
172           -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
173           -e 'if(/^\s*$$/){print unless $$blank; $$blank=1;} else{print;$$blank=0;}' \
174           _generic/config.h >$@
175         rm -rf _generic
177 MAINTAINERCLEANFILES += pcre.h.generic config.h.generic
179 # These are the header files we'll install. We do not distribute pcre.h because
180 # it is generated from pcre.h.in.
181 nodist_include_HEADERS = \
182   pcre.h
183 include_HEADERS =
184 otherincludedir = $(includedir)/pcreposix
185 otherinclude_HEADERS = \
186   pcreposix.h
187 nodist_otherinclude_HEADERS = \
188   regex.h
190 regex.h : $(srcdir)/pcreposix.h
191         cp -p $(srcdir)/pcreposix.h $@
193 # These additional headers will be be installed if C++ support is enabled. We
194 # do not distribute pcrecpparg.h or pcre_stringpiece.h, as these are generated
195 # from corresponding .h.in files (which we do distribute).
196 if WITH_PCRE_CPP
197 nodist_include_HEADERS += \
198   pcrecpparg.h \
199   pcre_stringpiece.h
200 include_HEADERS += \
201   pcrecpp.h \
202   pcre_scanner.h
203 endif # WITH_PCRE_CPP
205 bin_SCRIPTS = pcre-config
207 ## ---------------------------------------------------------------
208 ## The dftables program is used to rebuild character tables before compiling
209 ## PCRE, if --enable-rebuild-chartables is specified. It is not a user-visible
210 ## program. The default (when --enable-rebuild-chartables is not specified) is
211 ## to copy a distributed set of tables that are defined for ASCII code. In this
212 ## case, dftables is not needed.
214 if WITH_REBUILD_CHARTABLES
216 noinst_PROGRAMS += dftables
217 dftables_SOURCES = dftables.c
219 pcre_chartables.c: dftables$(EXEEXT)
220         ./dftables$(EXEEXT) $@
221 else
223 pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist
224         rm -f $@
225         $(LN_S) $(srcdir)/pcre_chartables.c.dist $@
227 endif # WITH_REBUILD_CHARTABLES
229 BUILT_SOURCES = pcre_chartables.c
231 ## The main pcre library
233 # Build the 8 bit library if it is enabled.
234 if WITH_PCRE8
235 lib_LTLIBRARIES += libpcre.la
237 libpcre_la_SOURCES = \
238   pcre_byte_order.c \
239   pcre_compile.c \
240   pcre_config.c \
241   pcre_dfa_exec.c \
242   pcre_exec.c \
243   pcre_fullinfo.c \
244   pcre_get.c \
245   pcre_globals.c \
246   pcre_internal.h \
247   pcre_jit_compile.c \
248   pcre_maketables.c \
249   pcre_newline.c \
250   pcre_ord2utf8.c \
251   pcre_refcount.c \
252   pcre_string_utils.c \
253   pcre_study.c \
254   pcre_tables.c \
255   pcre_ucd.c \
256   pcre_valid_utf8.c \
257   pcre_version.c \
258   pcre_xclass.c \
259   ucp.h
261 libpcre_la_CFLAGS = \
262   $(VISIBILITY_CFLAGS) \
263   $(AM_CFLAGS)
265 libpcre_la_LIBADD =
267 ## This file is generated as part of the building process, so don't distribute.
268 nodist_libpcre_la_SOURCES = \
269   pcre_chartables.c
271 endif # WITH_PCRE8
273 # Build the 16 bit library if it is enabled.
274 if WITH_PCRE16
275 lib_LTLIBRARIES += libpcre16.la
276 libpcre16_la_SOURCES = \
277   pcre16_byte_order.c \
278   pcre16_chartables.c \
279   pcre16_compile.c \
280   pcre16_config.c \
281   pcre16_dfa_exec.c \
282   pcre16_exec.c \
283   pcre16_fullinfo.c \
284   pcre16_get.c \
285   pcre16_globals.c \
286   pcre16_jit_compile.c \
287   pcre16_maketables.c \
288   pcre16_newline.c \
289   pcre16_ord2utf16.c \
290   pcre16_refcount.c \
291   pcre16_string_utils.c \
292   pcre16_study.c \
293   pcre16_tables.c \
294   pcre16_ucd.c \
295   pcre16_utf16_utils.c \
296   pcre16_valid_utf16.c \
297   pcre16_version.c \
298   pcre16_xclass.c
300 libpcre16_la_CFLAGS = \
301   $(VISIBILITY_CFLAGS) \
302   $(AM_CFLAGS)
304 libpcre16_la_LIBADD =
306 ## This file is generated as part of the building process, so don't distribute.
307 nodist_libpcre16_la_SOURCES = \
308   pcre_chartables.c
310 endif # WITH_PCRE16
312 # Build the 32 bit library if it is enabled.
313 if WITH_PCRE32
314 lib_LTLIBRARIES += libpcre32.la
315 libpcre32_la_SOURCES = \
316   pcre32_byte_order.c \
317   pcre32_chartables.c \
318   pcre32_compile.c \
319   pcre32_config.c \
320   pcre32_dfa_exec.c \
321   pcre32_exec.c \
322   pcre32_fullinfo.c \
323   pcre32_get.c \
324   pcre32_globals.c \
325   pcre32_jit_compile.c \
326   pcre32_maketables.c \
327   pcre32_newline.c \
328   pcre32_ord2utf32.c \
329   pcre32_refcount.c \
330   pcre32_string_utils.c \
331   pcre32_study.c \
332   pcre32_tables.c \
333   pcre32_ucd.c \
334   pcre32_utf32_utils.c \
335   pcre32_valid_utf32.c \
336   pcre32_version.c \
337   pcre32_xclass.c
339 libpcre32_la_CFLAGS = \
340   $(VISIBILITY_CFLAGS) \
341   $(AM_CFLAGS)
343 libpcre32_la_LIBADD =
345 ## This file is generated as part of the building process, so don't distribute.
346 nodist_libpcre32_la_SOURCES = \
347   pcre_chartables.c
349 endif # WITH_PCRE32
351 # The pcre_chartables.c.dist file is the default version of pcre_chartables.c,
352 # used unless --enable-rebuild-chartables is specified.
353 EXTRA_DIST += pcre_chartables.c.dist
355 # The JIT compiler lives in a separate directory, but its files are #included
356 # when pcre_jit_compile.c is processed, so they must be distributed.
357 EXTRA_DIST += \
358   sljit/sljitConfig.h \
359   sljit/sljitConfigInternal.h \
360   sljit/sljitExecAllocator.c \
361   sljit/sljitLir.c \
362   sljit/sljitLir.h \
363   sljit/sljitNativeARM_32.c \
364   sljit/sljitNativeARM_64.c \
365   sljit/sljitNativeARM_T2_32.c \
366   sljit/sljitNativeMIPS_32.c \
367   sljit/sljitNativeMIPS_64.c \
368   sljit/sljitNativeMIPS_common.c \
369   sljit/sljitNativePPC_32.c \
370   sljit/sljitNativePPC_64.c \
371   sljit/sljitNativePPC_common.c \
372   sljit/sljitNativeSPARC_32.c \
373   sljit/sljitNativeSPARC_common.c \
374   sljit/sljitNativeTILEGX_64.c \
375   sljit/sljitNativeTILEGX-encoder.c \
376   sljit/sljitNativeX86_32.c \
377   sljit/sljitNativeX86_64.c \
378   sljit/sljitNativeX86_common.c \
379   sljit/sljitUtils.c
381 if WITH_PCRE8
382 libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS)
383 endif # WITH_PCRE8
384 if WITH_PCRE16
385 libpcre16_la_LDFLAGS = $(EXTRA_LIBPCRE16_LDFLAGS)
386 endif # WITH_PCRE16
387 if WITH_PCRE32
388 libpcre32_la_LDFLAGS = $(EXTRA_LIBPCRE32_LDFLAGS)
389 endif # WITH_PCRE32
391 if WITH_VALGRIND
392 if WITH_PCRE8
393 libpcre_la_CFLAGS += $(VALGRIND_CFLAGS)
394 endif # WITH_PCRE8
395 if WITH_PCRE16
396 libpcre16_la_CFLAGS += $(VALGRIND_CFLAGS)
397 endif # WITH_PCRE16
398 if WITH_PCRE32
399 libpcre32_la_CFLAGS += $(VALGRIND_CFLAGS)
400 endif # WITH_PCRE32
401 endif # WITH_VALGRIND
403 if WITH_GCOV
404 if WITH_PCRE8
405 libpcre_la_CFLAGS += $(GCOV_CFLAGS)
406 endif # WITH_PCRE8
407 if WITH_PCRE16
408 libpcre16_la_CFLAGS += $(GCOV_CFLAGS)
409 endif # WITH_PCRE16
410 if WITH_PCRE32
411 libpcre32_la_CFLAGS += $(GCOV_CFLAGS)
412 endif # WITH_PCRE32
413 endif # WITH_GCOV
415 CLEANFILES += pcre_chartables.c
417 ## If JIT support is enabled, arrange for the JIT test program to run.
418 if WITH_JIT
419 TESTS += pcre_jit_test
420 noinst_PROGRAMS += pcre_jit_test
421 pcre_jit_test_SOURCES = pcre_jit_test.c
422 pcre_jit_test_CFLAGS = $(AM_CFLAGS)
423 pcre_jit_test_LDADD =
424 if WITH_PCRE8
425 pcre_jit_test_LDADD += libpcre.la
426 endif # WITH_PCRE8
427 if WITH_PCRE16
428 pcre_jit_test_LDADD += libpcre16.la
429 endif # WITH_PCRE16
430 if WITH_PCRE32
431 pcre_jit_test_LDADD += libpcre32.la
432 endif # WITH_PCRE32
433 if WITH_GCOV
434 pcre_jit_test_CFLAGS += $(GCOV_CFLAGS)
435 pcre_jit_test_LDADD += $(GCOV_LIBS)
436 endif # WITH_GCOV
437 endif # WITH_JIT
439 ## A version of the main pcre library that has a posix re API.
440 if WITH_PCRE8
442 lib_LTLIBRARIES += libpcreposix.la
443 libpcreposix_la_SOURCES = \
444   pcreposix.c
445 libpcreposix_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS)
446 libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
447 libpcreposix_la_LIBADD = libpcre.la
449 if WITH_GCOV
450 libpcreposix_la_CFLAGS += $(GCOV_CFLAGS)
451 endif # WITH_GCOV
453 endif # WITH_PCRE8
455 ## There's a C++ library as well.
456 if WITH_PCRE_CPP
458 lib_LTLIBRARIES += libpcrecpp.la
459 libpcrecpp_la_SOURCES = \
460   pcrecpp_internal.h \
461   pcrecpp.cc \
462   pcre_scanner.cc \
463   pcre_stringpiece.cc
464 libpcrecpp_la_CXXFLAGS = $(VISIBILITY_CXXFLAGS) $(AM_CXXFLAGS)
465 libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)
466 libpcrecpp_la_LIBADD = libpcre.la
468 TESTS += pcrecpp_unittest
469 noinst_PROGRAMS += pcrecpp_unittest
470 pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc
471 pcrecpp_unittest_CXXFLAGS = $(AM_CXXFLAGS)
472 pcrecpp_unittest_LDADD = libpcrecpp.la
474 TESTS += pcre_scanner_unittest
475 noinst_PROGRAMS += pcre_scanner_unittest
476 pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc
477 pcre_scanner_unittest_CXXFLAGS = $(AM_CXXFLAGS)
478 pcre_scanner_unittest_LDADD = libpcrecpp.la
480 TESTS += pcre_stringpiece_unittest
481 noinst_PROGRAMS += pcre_stringpiece_unittest
482 pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc
483 pcre_stringpiece_unittest_CXXFLAGS = $(AM_CXXFLAGS)
484 pcre_stringpiece_unittest_LDADD = libpcrecpp.la
486 if WITH_GCOV
487 libpcrecpp_la_CXXFLAGS += $(GCOV_CXXFLAGS)
488 pcrecpp_unittest_LDADD += $(GCOV_LIBS)
489 pcre_scanner_unittest_LDADD += $(GCOV_LIBS)
490 pcre_stringpiece_unittest_LDADD += $(GCOV_LIBS)
491 endif # WITH_GCOV
493 endif # WITH_PCRE_CPP
495 ## The main unit tests
497 # Each unit test is a binary plus a script that runs that binary in various
498 # ways. We install these test binaries in case folks find it helpful.
500 TESTS += RunTest
501 dist_noinst_SCRIPTS += RunTest
502 EXTRA_DIST += RunTest.bat
503 bin_PROGRAMS += pcretest
504 pcretest_SOURCES = pcretest.c
505 pcretest_CFLAGS = $(AM_CFLAGS)
506 pcretest_LDADD = $(LIBREADLINE)
507 if WITH_PCRE8
508 pcretest_SOURCES += pcre_printint.c
509 pcretest_LDADD += libpcre.la libpcreposix.la
510 endif # WITH_PCRE8
511 if WITH_PCRE16
512 pcretest_SOURCES += pcre16_printint.c
513 pcretest_LDADD += libpcre16.la
514 endif # WITH_PCRE16
515 if WITH_PCRE32
516 pcretest_SOURCES += pcre32_printint.c
517 pcretest_LDADD += libpcre32.la
518 endif # WITH_PCRE32
519 if WITH_VALGRIND
520 pcretest_CFLAGS += $(VALGRIND_CFLAGS)
521 endif # WITH_VALGRIND
522 if WITH_GCOV
523 pcretest_CFLAGS += $(GCOV_CFLAGS)
524 pcretest_LDADD += $(GCOV_LIBS)
525 endif # WITH_GCOV
527 if WITH_PCRE8
528 TESTS += RunGrepTest
529 dist_noinst_SCRIPTS += RunGrepTest
530 bin_PROGRAMS += pcregrep
531 pcregrep_SOURCES = pcregrep.c
532 pcregrep_CFLAGS = $(AM_CFLAGS)
533 pcregrep_LDADD = $(LIBZ) $(LIBBZ2)
534 pcregrep_LDADD += libpcre.la libpcreposix.la
535 if WITH_GCOV
536 pcregrep_CFLAGS += $(GCOV_CFLAGS)
537 pcregrep_LDADD += $(GCOV_LIBS)
538 endif # WITH_GCOV
539 endif # WITH_PCRE8
541 EXTRA_DIST += \
542   testdata/grepbinary \
543   testdata/grepfilelist \
544   testdata/grepinput \
545   testdata/grepinput3 \
546   testdata/grepinput8 \
547   testdata/grepinputv \
548   testdata/grepinputx \
549   testdata/greplist \
550   testdata/grepoutput \
551   testdata/grepoutput8 \
552   testdata/grepoutputN \
553   testdata/greppatN4 \
554   testdata/saved16 \
555   testdata/saved16BE-1 \
556   testdata/saved16BE-2 \
557   testdata/saved16LE-1 \
558   testdata/saved16LE-2 \
559   testdata/saved32 \
560   testdata/saved32BE-1 \
561   testdata/saved32BE-2 \
562   testdata/saved32LE-1 \
563   testdata/saved32LE-2 \
564   testdata/saved8 \
565   testdata/testinput1 \
566   testdata/testinput2 \
567   testdata/testinput3 \
568   testdata/testinput4 \
569   testdata/testinput5 \
570   testdata/testinput6 \
571   testdata/testinput7 \
572   testdata/testinput8 \
573   testdata/testinput9 \
574   testdata/testinput10 \
575   testdata/testinput11 \
576   testdata/testinput12 \
577   testdata/testinput13 \
578   testdata/testinput14 \
579   testdata/testinput15 \
580   testdata/testinput16 \
581   testdata/testinput17 \
582   testdata/testinput18 \
583   testdata/testinput19 \
584   testdata/testinput20 \
585   testdata/testinput21 \
586   testdata/testinput22 \
587   testdata/testinput23 \
588   testdata/testinput24 \
589   testdata/testinput25 \
590   testdata/testinput26 \
591   testdata/testinputEBC \
592   testdata/testoutput1 \
593   testdata/testoutput2 \
594   testdata/testoutput3 \
595   testdata/testoutput3A \
596   testdata/testoutput3B \
597   testdata/testoutput4 \
598   testdata/testoutput5 \
599   testdata/testoutput6 \
600   testdata/testoutput7 \
601   testdata/testoutput8 \
602   testdata/testoutput9 \
603   testdata/testoutput10 \
604   testdata/testoutput11-8 \
605   testdata/testoutput11-16 \
606   testdata/testoutput11-32 \
607   testdata/testoutput12 \
608   testdata/testoutput13 \
609   testdata/testoutput14 \
610   testdata/testoutput15 \
611   testdata/testoutput16 \
612   testdata/testoutput17 \
613   testdata/testoutput18-16 \
614   testdata/testoutput18-32 \
615   testdata/testoutput19 \
616   testdata/testoutput20 \
617   testdata/testoutput21-16 \
618   testdata/testoutput21-32 \
619   testdata/testoutput22-16 \
620   testdata/testoutput22-32 \
621   testdata/testoutput23 \
622   testdata/testoutput24 \
623   testdata/testoutput25 \
624   testdata/testoutput26 \
625   testdata/testoutputEBC \
626   testdata/valgrind-jit.supp \
627   testdata/wintestinput3 \
628   testdata/wintestoutput3 \
629   perltest.pl
631 CLEANFILES += \
632         testsavedregex \
633         teststderr \
634         testtemp* \
635         testtry \
636         testNinput \
637         testtrygrep \
638         teststderrgrep \
639         testNinputgrep
641 # PCRE demonstration program. No longer built automatcally. The point is that
642 # the users should build it themselves. So just distribute the source.
643 # noinst_PROGRAMS += pcredemo
644 # pcredemo_SOURCES = pcredemo.c
645 # pcredemo_LDADD = libpcre.la
647 EXTRA_DIST += pcredemo.c
650 ## Utility rules, documentation, etc.
652 # A compatibility line, the old build system worked with 'make test'
653 test: check ;
656 # A PCRE user submitted the following addition, saying that it "will allow
657 # anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
658 # nice DLL for Windows use". (It is used by the pcre.dll target.)
659 DLL_OBJS= pcre_byte_order.o pcre_compile.o pcre_config.o \
660         pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
661         pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
662         pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
663         pcre_study.o pcre_tables.o pcre_ucd.o \
664         pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
665         pcre_xclass.o
667 # A PCRE user submitted the following addition, saying that it "will allow
668 # anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
669 # nice DLL for Windows use".
670 pcre.dll: $(DLL_OBJS)
671         $(CC) -shared -o pcre.dll -Wl,"--strip-all" -Wl,"--export-all-symbols" $(DLL_OBJS)
674 # We have .pc files for pkg-config users.
675 pkgconfigdir = $(libdir)/pkgconfig
676 pkgconfig_DATA = libpcre.pc libpcreposix.pc
677 if WITH_PCRE16
678 pkgconfig_DATA += libpcre16.pc
679 endif
680 if WITH_PCRE32
681 pkgconfig_DATA += libpcre32.pc
682 endif
683 if WITH_PCRE_CPP
684 pkgconfig_DATA += libpcrecpp.pc
685 endif
687 # Note that pcrecpp.3 is not in this list, but is included separately below.
689 dist_man_MANS = \
690   doc/pcre-config.1 \
691   doc/pcre.3 \
692   doc/pcre16.3 \
693   doc/pcre32.3 \
694   doc/pcre_assign_jit_stack.3 \
695   doc/pcre_compile.3 \
696   doc/pcre_compile2.3 \
697   doc/pcre_config.3 \
698   doc/pcre_copy_named_substring.3 \
699   doc/pcre_copy_substring.3 \
700   doc/pcre_dfa_exec.3 \
701   doc/pcre_exec.3 \
702   doc/pcre_free_study.3 \
703   doc/pcre_free_substring.3 \
704   doc/pcre_free_substring_list.3 \
705   doc/pcre_fullinfo.3 \
706   doc/pcre_get_named_substring.3 \
707   doc/pcre_get_stringnumber.3 \
708   doc/pcre_get_stringtable_entries.3 \
709   doc/pcre_get_substring.3 \
710   doc/pcre_get_substring_list.3 \
711   doc/pcre_jit_exec.3 \
712   doc/pcre_jit_stack_alloc.3 \
713   doc/pcre_jit_stack_free.3 \
714   doc/pcre_maketables.3 \
715   doc/pcre_pattern_to_host_byte_order.3 \
716   doc/pcre_refcount.3 \
717   doc/pcre_study.3 \
718   doc/pcre_utf16_to_host_byte_order.3 \
719   doc/pcre_utf32_to_host_byte_order.3 \
720   doc/pcre_version.3 \
721   doc/pcreapi.3 \
722   doc/pcrebuild.3 \
723   doc/pcrecallout.3 \
724   doc/pcrecompat.3 \
725   doc/pcredemo.3 \
726   doc/pcregrep.1 \
727   doc/pcrejit.3 \
728   doc/pcrelimits.3 \
729   doc/pcrematching.3 \
730   doc/pcrepartial.3 \
731   doc/pcrepattern.3 \
732   doc/pcreperform.3 \
733   doc/pcreposix.3 \
734   doc/pcreprecompile.3 \
735   doc/pcresample.3 \
736   doc/pcrestack.3 \
737   doc/pcresyntax.3 \
738   doc/pcretest.1 \
739   doc/pcreunicode.3
741 # Arrange for the per-function man pages to have 16- and 32-bit names as well.
742 install-data-hook:
743         ln -sf pcre_assign_jit_stack.3           $(DESTDIR)$(man3dir)/pcre16_assign_jit_stack.3
744         ln -sf pcre_compile.3                    $(DESTDIR)$(man3dir)/pcre16_compile.3
745         ln -sf pcre_compile2.3                   $(DESTDIR)$(man3dir)/pcre16_compile2.3
746         ln -sf pcre_config.3                     $(DESTDIR)$(man3dir)/pcre16_config.3
747         ln -sf pcre_copy_named_substring.3       $(DESTDIR)$(man3dir)/pcre16_copy_named_substring.3
748         ln -sf pcre_copy_substring.3             $(DESTDIR)$(man3dir)/pcre16_copy_substring.3
749         ln -sf pcre_dfa_exec.3                   $(DESTDIR)$(man3dir)/pcre16_dfa_exec.3
750         ln -sf pcre_exec.3                       $(DESTDIR)$(man3dir)/pcre16_exec.3
751         ln -sf pcre_free_study.3                 $(DESTDIR)$(man3dir)/pcre16_free_study.3
752         ln -sf pcre_free_substring.3             $(DESTDIR)$(man3dir)/pcre16_free_substring.3
753         ln -sf pcre_free_substring_list.3        $(DESTDIR)$(man3dir)/pcre16_free_substring_list.3
754         ln -sf pcre_fullinfo.3                   $(DESTDIR)$(man3dir)/pcre16_fullinfo.3
755         ln -sf pcre_get_named_substring.3        $(DESTDIR)$(man3dir)/pcre16_get_named_substring.3
756         ln -sf pcre_get_stringnumber.3           $(DESTDIR)$(man3dir)/pcre16_get_stringnumber.3
757         ln -sf pcre_get_stringtable_entries.3    $(DESTDIR)$(man3dir)/pcre16_get_stringtable_entries.3
758         ln -sf pcre_get_substring.3              $(DESTDIR)$(man3dir)/pcre16_get_substring.3
759         ln -sf pcre_get_substring_list.3         $(DESTDIR)$(man3dir)/pcre16_get_substring_list.3
760         ln -sf pcre_jit_exec.3                   $(DESTDIR)$(man3dir)/pcre16_jit_exec.3
761         ln -sf pcre_jit_stack_alloc.3            $(DESTDIR)$(man3dir)/pcre16_jit_stack_alloc.3
762         ln -sf pcre_jit_stack_free.3             $(DESTDIR)$(man3dir)/pcre16_jit_stack_free.3
763         ln -sf pcre_maketables.3                 $(DESTDIR)$(man3dir)/pcre16_maketables.3
764         ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_pattern_to_host_byte_order.3
765         ln -sf pcre_refcount.3                   $(DESTDIR)$(man3dir)/pcre16_refcount.3
766         ln -sf pcre_study.3                      $(DESTDIR)$(man3dir)/pcre16_study.3
767         ln -sf pcre_utf16_to_host_byte_order.3   $(DESTDIR)$(man3dir)/pcre16_utf16_to_host_byte_order.3
768         ln -sf pcre_version.3                    $(DESTDIR)$(man3dir)/pcre16_version.3
769         ln -sf pcre_assign_jit_stack.3           $(DESTDIR)$(man3dir)/pcre32_assign_jit_stack.3
770         ln -sf pcre_compile.3                    $(DESTDIR)$(man3dir)/pcre32_compile.3
771         ln -sf pcre_compile2.3                   $(DESTDIR)$(man3dir)/pcre32_compile2.3
772         ln -sf pcre_config.3                     $(DESTDIR)$(man3dir)/pcre32_config.3
773         ln -sf pcre_copy_named_substring.3       $(DESTDIR)$(man3dir)/pcre32_copy_named_substring.3
774         ln -sf pcre_copy_substring.3             $(DESTDIR)$(man3dir)/pcre32_copy_substring.3
775         ln -sf pcre_dfa_exec.3                   $(DESTDIR)$(man3dir)/pcre32_dfa_exec.3
776         ln -sf pcre_exec.3                       $(DESTDIR)$(man3dir)/pcre32_exec.3
777         ln -sf pcre_free_study.3                 $(DESTDIR)$(man3dir)/pcre32_free_study.3
778         ln -sf pcre_free_substring.3             $(DESTDIR)$(man3dir)/pcre32_free_substring.3
779         ln -sf pcre_free_substring_list.3        $(DESTDIR)$(man3dir)/pcre32_free_substring_list.3
780         ln -sf pcre_fullinfo.3                   $(DESTDIR)$(man3dir)/pcre32_fullinfo.3
781         ln -sf pcre_get_named_substring.3        $(DESTDIR)$(man3dir)/pcre32_get_named_substring.3
782         ln -sf pcre_get_stringnumber.3           $(DESTDIR)$(man3dir)/pcre32_get_stringnumber.3
783         ln -sf pcre_get_stringtable_entries.3    $(DESTDIR)$(man3dir)/pcre32_get_stringtable_entries.3
784         ln -sf pcre_get_substring.3              $(DESTDIR)$(man3dir)/pcre32_get_substring.3
785         ln -sf pcre_get_substring_list.3         $(DESTDIR)$(man3dir)/pcre32_get_substring_list.3
786         ln -sf pcre_jit_exec.3                   $(DESTDIR)$(man3dir)/pcre32_jit_exec.3
787         ln -sf pcre_jit_stack_alloc.3            $(DESTDIR)$(man3dir)/pcre32_jit_stack_alloc.3
788         ln -sf pcre_jit_stack_free.3             $(DESTDIR)$(man3dir)/pcre32_jit_stack_free.3
789         ln -sf pcre_maketables.3                 $(DESTDIR)$(man3dir)/pcre32_maketables.3
790         ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre32_pattern_to_host_byte_order.3
791         ln -sf pcre_refcount.3                   $(DESTDIR)$(man3dir)/pcre32_refcount.3
792         ln -sf pcre_study.3                      $(DESTDIR)$(man3dir)/pcre32_study.3
793         ln -sf pcre_utf32_to_host_byte_order.3   $(DESTDIR)$(man3dir)/pcre32_utf32_to_host_byte_order.3
794         ln -sf pcre_version.3                    $(DESTDIR)$(man3dir)/pcre32_version.3
796 pcrecpp_man = doc/pcrecpp.3
797 EXTRA_DIST += $(pcrecpp_man)
799 if WITH_PCRE_CPP
800 man_MANS = $(pcrecpp_man)
801 endif
803 # gcov/lcov code coverage reporting
805 if WITH_GCOV
807 # Coverage reporting targets:
809 # coverage: Create a coverage report from 'make check'
810 # coverage-baseline: Capture baseline coverage information
811 # coverage-reset: This zeros the coverage counters only
812 # coverage-report: This creates the coverage report only
813 # coverage-clean-report: This removes the generated coverage report
814 #   without cleaning the coverage data itself
815 # coverage-clean-data: This removes the captured coverage data without
816 #   removing the coverage files created at compile time (*.gcno)
817 # coverage-clean: This cleans all coverage data including the generated
818 #   coverage report.
820 COVERAGE_TEST_NAME = $(PACKAGE)
821 COVERAGE_NAME = $(PACKAGE)-$(VERSION)
822 COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
823 COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
824 COVERAGE_LCOV_EXTRA_FLAGS =
825 COVERAGE_GENHTML_EXTRA_FLAGS =
827 coverage_quiet = $(coverage_quiet_$(V))
828 coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
829 coverage_quiet_0 = --quiet
831 coverage-check: all
832         -$(MAKE) $(AM_MAKEFLAGS) -k check
834 coverage-baseline:
835         $(LCOV) $(coverage_quiet) \
836                 --directory $(top_builddir) \
837                 --output-file "$(COVERAGE_OUTPUT_FILE)" \
838                 --capture \
839                 --initial
841 coverage-report:
842         $(LCOV) $(coverage_quiet) \
843                 --directory $(top_builddir) \
844                 --capture \
845                 --output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
846                 --test-name "$(COVERAGE_TEST_NAME)" \
847                 --no-checksum \
848                 --compat-libtool \
849                 $(COVERAGE_LCOV_EXTRA_FLAGS)
850         $(LCOV) $(coverage_quiet) \
851                 --directory $(top_builddir) \
852                 --output-file "$(COVERAGE_OUTPUT_FILE)" \
853                 --remove "$(COVERAGE_OUTPUT_FILE).tmp" \
854                 "/tmp/*" \
855                 "/usr/include/*" \
856                 "$(includedir)/*"
857         -@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
858         LANG=C $(GENHTML) $(coverage_quiet) \
859                 --prefix $(top_builddir) \
860                 --output-directory "$(COVERAGE_OUTPUT_DIR)" \
861                 --title "$(PACKAGE) $(VERSION) Code Coverage Report" \
862                 --show-details "$(COVERAGE_OUTPUT_FILE)" \
863                 --legend \
864                 $(COVERAGE_GENHTML_EXTRA_FLAGS)
865         @echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
867 coverage-reset:
868         -$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
870 coverage-clean-report:
871         -rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
872         -rm -rf "$(COVERAGE_OUTPUT_DIR)"
874 coverage-clean-data:
875         -find $(top_builddir) -name "*.gcda" -delete
877 coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
878         -find $(top_builddir) -name "*.gcno" -delete
880 coverage-distclean: coverage-clean
882 coverage: coverage-reset coverage-baseline coverage-check coverage-report
883 clean-local: coverage-clean
884 distclean-local: coverage-distclean
886 .PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
888 else
890 coverage:
891         @echo "Configuring with --enable-coverage required to generate code coverage report."
893 endif # WITH_GCOV
895 ## CMake support
897 EXTRA_DIST += \
898   cmake/COPYING-CMAKE-SCRIPTS \
899   cmake/FindPackageHandleStandardArgs.cmake \
900   cmake/FindReadline.cmake \
901   cmake/FindEditline.cmake \
902   CMakeLists.txt \
903   config-cmake.h.in
905 ## end Makefile.am