Home | History | Annotate | Download | only in dist2
      1 ## Process this file with automake to produce Makefile.in.
      2 
      3 AUTOMAKE_OPTIONS = subdir-objects
      4 ACLOCAL_AMFLAGS = -I m4
      5 AM_CPPFLAGS = -I$(builddir)/src -I$(srcdir)/src
      6 
      7 ## Specify the documentation files that are distributed.
      8 
      9 dist_doc_DATA = \
     10   AUTHORS \
     11   COPYING \
     12   ChangeLog \
     13   LICENCE \
     14   NEWS \
     15   README \
     16   doc/pcre2.txt \
     17   doc/pcre2-config.txt \
     18   doc/pcre2grep.txt \
     19   doc/pcre2test.txt
     20 
     21 dist_html_DATA = \
     22   doc/html/NON-AUTOTOOLS-BUILD.txt \
     23   doc/html/README.txt \
     24   doc/html/index.html \
     25   doc/html/pcre2-config.html \
     26   doc/html/pcre2.html \
     27   doc/html/pcre2_callout_enumerate.html \
     28   doc/html/pcre2_code_copy.html \
     29   doc/html/pcre2_code_free.html \
     30   doc/html/pcre2_compile.html \
     31   doc/html/pcre2_compile_context_copy.html \
     32   doc/html/pcre2_compile_context_create.html \
     33   doc/html/pcre2_compile_context_free.html \
     34   doc/html/pcre2_config.html \
     35   doc/html/pcre2_dfa_match.html \
     36   doc/html/pcre2_general_context_copy.html \
     37   doc/html/pcre2_general_context_create.html \
     38   doc/html/pcre2_general_context_free.html \
     39   doc/html/pcre2_get_error_message.html \
     40   doc/html/pcre2_get_mark.html \
     41   doc/html/pcre2_get_ovector_count.html \
     42   doc/html/pcre2_get_ovector_pointer.html \
     43   doc/html/pcre2_get_startchar.html \
     44   doc/html/pcre2_jit_compile.html \
     45   doc/html/pcre2_jit_free_unused_memory.html \
     46   doc/html/pcre2_jit_match.html \
     47   doc/html/pcre2_jit_stack_assign.html \
     48   doc/html/pcre2_jit_stack_create.html \
     49   doc/html/pcre2_jit_stack_free.html \
     50   doc/html/pcre2_maketables.html \
     51   doc/html/pcre2_match.html \
     52   doc/html/pcre2_match_context_copy.html \
     53   doc/html/pcre2_match_context_create.html \
     54   doc/html/pcre2_match_context_free.html \
     55   doc/html/pcre2_match_data_create.html \
     56   doc/html/pcre2_match_data_create_from_pattern.html \
     57   doc/html/pcre2_match_data_free.html \
     58   doc/html/pcre2_pattern_info.html \
     59   doc/html/pcre2_serialize_decode.html \
     60   doc/html/pcre2_serialize_encode.html \
     61   doc/html/pcre2_serialize_free.html \
     62   doc/html/pcre2_serialize_get_number_of_codes.html \
     63   doc/html/pcre2_set_bsr.html \
     64   doc/html/pcre2_set_callout.html \
     65   doc/html/pcre2_set_character_tables.html \
     66   doc/html/pcre2_set_compile_recursion_guard.html \
     67   doc/html/pcre2_set_match_limit.html \
     68   doc/html/pcre2_set_offset_limit.html \
     69   doc/html/pcre2_set_newline.html \
     70   doc/html/pcre2_set_parens_nest_limit.html \
     71   doc/html/pcre2_set_recursion_limit.html \
     72   doc/html/pcre2_set_recursion_memory_management.html \
     73   doc/html/pcre2_substitute.html \
     74   doc/html/pcre2_substring_copy_byname.html \
     75   doc/html/pcre2_substring_copy_bynumber.html \
     76   doc/html/pcre2_substring_free.html \
     77   doc/html/pcre2_substring_get_byname.html \
     78   doc/html/pcre2_substring_get_bynumber.html \
     79   doc/html/pcre2_substring_length_byname.html \
     80   doc/html/pcre2_substring_length_bynumber.html \
     81   doc/html/pcre2_substring_list_free.html \
     82   doc/html/pcre2_substring_list_get.html \
     83   doc/html/pcre2_substring_nametable_scan.html \
     84   doc/html/pcre2_substring_number_from_name.html \
     85   doc/html/pcre2api.html \
     86   doc/html/pcre2build.html \
     87   doc/html/pcre2callout.html \
     88   doc/html/pcre2compat.html \
     89   doc/html/pcre2demo.html \
     90   doc/html/pcre2grep.html \
     91   doc/html/pcre2jit.html \
     92   doc/html/pcre2limits.html \
     93   doc/html/pcre2matching.html \
     94   doc/html/pcre2partial.html \
     95   doc/html/pcre2pattern.html \
     96   doc/html/pcre2perform.html \
     97   doc/html/pcre2posix.html \
     98   doc/html/pcre2sample.html \
     99   doc/html/pcre2serialize.html \
    100   doc/html/pcre2stack.html \
    101   doc/html/pcre2syntax.html \
    102   doc/html/pcre2test.html \
    103   doc/html/pcre2unicode.html
    104 
    105 dist_man_MANS = \
    106   doc/pcre2-config.1 \
    107   doc/pcre2.3 \
    108   doc/pcre2_callout_enumerate.3 \
    109   doc/pcre2_code_copy.3 \
    110   doc/pcre2_code_free.3 \
    111   doc/pcre2_compile.3 \
    112   doc/pcre2_compile_context_copy.3 \
    113   doc/pcre2_compile_context_create.3 \
    114   doc/pcre2_compile_context_free.3 \
    115   doc/pcre2_config.3 \
    116   doc/pcre2_dfa_match.3 \
    117   doc/pcre2_general_context_copy.3 \
    118   doc/pcre2_general_context_create.3 \
    119   doc/pcre2_general_context_free.3 \
    120   doc/pcre2_get_error_message.3 \
    121   doc/pcre2_get_mark.3 \
    122   doc/pcre2_get_ovector_count.3 \
    123   doc/pcre2_get_ovector_pointer.3 \
    124   doc/pcre2_get_startchar.3 \
    125   doc/pcre2_jit_compile.3 \
    126   doc/pcre2_jit_free_unused_memory.3 \
    127   doc/pcre2_jit_match.3 \
    128   doc/pcre2_jit_stack_assign.3 \
    129   doc/pcre2_jit_stack_create.3 \
    130   doc/pcre2_jit_stack_free.3 \
    131   doc/pcre2_maketables.3 \
    132   doc/pcre2_match.3 \
    133   doc/pcre2_match_context_copy.3 \
    134   doc/pcre2_match_context_create.3 \
    135   doc/pcre2_match_context_free.3 \
    136   doc/pcre2_match_data_create.3 \
    137   doc/pcre2_match_data_create_from_pattern.3 \
    138   doc/pcre2_match_data_free.3 \
    139   doc/pcre2_pattern_info.3 \
    140   doc/pcre2_serialize_decode.3 \
    141   doc/pcre2_serialize_encode.3 \
    142   doc/pcre2_serialize_free.3 \
    143   doc/pcre2_serialize_get_number_of_codes.3 \
    144   doc/pcre2_set_bsr.3 \
    145   doc/pcre2_set_callout.3 \
    146   doc/pcre2_set_character_tables.3 \
    147   doc/pcre2_set_compile_recursion_guard.3 \
    148   doc/pcre2_set_match_limit.3 \
    149   doc/pcre2_set_offset_limit.3 \
    150   doc/pcre2_set_newline.3 \
    151   doc/pcre2_set_parens_nest_limit.3 \
    152   doc/pcre2_set_recursion_limit.3 \
    153   doc/pcre2_set_recursion_memory_management.3 \
    154   doc/pcre2_substitute.3 \
    155   doc/pcre2_substring_copy_byname.3 \
    156   doc/pcre2_substring_copy_bynumber.3 \
    157   doc/pcre2_substring_free.3 \
    158   doc/pcre2_substring_get_byname.3 \
    159   doc/pcre2_substring_get_bynumber.3 \
    160   doc/pcre2_substring_length_byname.3 \
    161   doc/pcre2_substring_length_bynumber.3 \
    162   doc/pcre2_substring_list_free.3 \
    163   doc/pcre2_substring_list_get.3 \
    164   doc/pcre2_substring_nametable_scan.3 \
    165   doc/pcre2_substring_number_from_name.3 \
    166   doc/pcre2api.3 \
    167   doc/pcre2build.3 \
    168   doc/pcre2callout.3 \
    169   doc/pcre2compat.3 \
    170   doc/pcre2demo.3 \
    171   doc/pcre2grep.1 \
    172   doc/pcre2jit.3 \
    173   doc/pcre2limits.3 \
    174   doc/pcre2matching.3 \
    175   doc/pcre2partial.3 \
    176   doc/pcre2pattern.3 \
    177   doc/pcre2perform.3 \
    178   doc/pcre2posix.3 \
    179   doc/pcre2sample.3 \
    180   doc/pcre2serialize.3 \
    181   doc/pcre2stack.3 \
    182   doc/pcre2syntax.3 \
    183   doc/pcre2test.1 \
    184   doc/pcre2unicode.3
    185 
    186 # The Libtool libraries to install.  We'll add to this later.
    187 
    188 lib_LTLIBRARIES =
    189 
    190 # Unit tests you want to run when people type 'make check'.
    191 # TESTS is for binary unit tests, check_SCRIPTS for script-based tests
    192 
    193 TESTS =
    194 check_SCRIPTS =
    195 dist_noinst_SCRIPTS =
    196 
    197 # Some of the binaries we make are to be installed, and others are
    198 # (non-user-visible) helper programs needed to build the libraries.
    199 
    200 bin_PROGRAMS =
    201 noinst_PROGRAMS =
    202 
    203 # Additional files to delete on 'make clean', 'make distclean',
    204 # and 'make maintainer-clean'.
    205 
    206 CLEANFILES =
    207 DISTCLEANFILES = src/config.h.in~ config.h
    208 MAINTAINERCLEANFILES =
    209 
    210 # Additional files to bundle with the distribution, over and above what
    211 # the Autotools include by default.
    212 
    213 EXTRA_DIST =
    214 
    215 # These files contain additional m4 macros that are used by autoconf.
    216 
    217 EXTRA_DIST += \
    218   m4/ax_pthread.m4 m4/pcre2_visibility.m4
    219 
    220 # These files contain maintenance information
    221 
    222 EXTRA_DIST += \
    223   NON-AUTOTOOLS-BUILD \
    224   HACKING
    225 
    226 # These files are used in the preparation of a release
    227 
    228 EXTRA_DIST += \
    229   PrepareRelease \
    230   CheckMan \
    231   CleanTxt \
    232   Detrail \
    233   132html \
    234   doc/index.html.src
    235 
    236 # These files are usable versions of pcre2.h and config.h that are distributed
    237 # for the benefit of people who are building PCRE2 manually, without the
    238 # Autotools support.
    239 
    240 EXTRA_DIST += \
    241   src/pcre2.h.generic \
    242   src/config.h.generic
    243 
    244 # The only difference between pcre2.h.in and pcre2.h is the setting of the PCRE
    245 # version number. Therefore, we can create the generic version just by copying.
    246 
    247 src/pcre2.h.generic: src/pcre2.h.in configure.ac
    248 	rm -f $@
    249 	cp -p src/pcre2.h $@
    250 
    251 # It is more complicated for config.h.generic. We need the version that results
    252 # from a default configuration so as to get all the default values for PCRE
    253 # configuration macros such as MATCH_LIMIT and NEWLINE. We can get this by
    254 # doing a configure in a temporary directory. However, some trickery is needed,
    255 # because the source directory may already be configured. If you just try
    256 # running configure in a new directory, it complains. For this reason, we move
    257 # config.status out of the way while doing the default configuration. The
    258 # resulting config.h is munged by perl to put #ifdefs round any #defines for
    259 # macros with values, and to #undef all boolean macros such as HAVE_xxx and
    260 # SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make
    261 # sure that PCRE2_EXP_DEFN is unset (in case it has visibility settings).
    262 
    263 src/config.h.generic: configure.ac
    264 	rm -rf $@ _generic
    265 	mkdir _generic
    266 	cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
    267 	cd _generic && $(abs_top_srcdir)/configure || :
    268 	cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
    269 	test -f _generic/src/config.h
    270 	perl -n \
    271 	  -e 'BEGIN{$$blank=0;}' \
    272 	  -e 'if(/PCRE2_EXP_DEFN/){print"/* #undef PCRE2_EXP_DEFN */\n";$$blank=0;next;}' \
    273 	  -e 'if(/to make a symbol visible/){next;}' \
    274 	  -e 'if(/__attribute__ \(\(visibility/){next;}' \
    275 	  -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
    276 	  -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
    277 	  -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
    278 	  -e 'if(/^\s*$$/){print unless $$blank; $$blank=1;} else{print;$$blank=0;}' \
    279 	  _generic/src/config.h >$@
    280 	rm -rf _generic
    281 
    282 MAINTAINERCLEANFILES += src/pcre2.h.generic src/config.h.generic
    283 
    284 # These are the header files we'll install. We do not distribute pcre2.h
    285 # because it is generated from pcre2.h.in.
    286 
    287 nodist_include_HEADERS = src/pcre2.h
    288 include_HEADERS = src/pcre2posix.h
    289 
    290 # This is the "config" script.
    291 
    292 bin_SCRIPTS = pcre2-config
    293 
    294 ## ---------------------------------------------------------------
    295 ## The dftables program is used to rebuild character tables before compiling
    296 ## PCRE2, if --enable-rebuild-chartables is specified. It is not a user-visible
    297 ## program. The default (when --enable-rebuild-chartables is not specified) is
    298 ## to copy a distributed set of tables that are defined for ASCII code. In this
    299 ## case, dftables is not needed.
    300 
    301 if WITH_REBUILD_CHARTABLES
    302 noinst_PROGRAMS += dftables
    303 dftables_SOURCES = src/dftables.c
    304 src/pcre2_chartables.c: dftables$(EXEEXT)
    305 	rm -f $@
    306 	./dftables$(EXEEXT) $@
    307 else
    308 src/pcre2_chartables.c: $(srcdir)/src/pcre2_chartables.c.dist
    309 	rm -f $@
    310 	$(LN_S) $(abs_srcdir)/src/pcre2_chartables.c.dist $(abs_builddir)/src/pcre2_chartables.c
    311 endif # WITH_REBUILD_CHARTABLES
    312 
    313 BUILT_SOURCES = src/pcre2_chartables.c
    314 NODIST_SOURCES = src/pcre2_chartables.c
    315 
    316 ## Define the list of common sources, then arrange to build whichever of the
    317 ## 8-, 16-, or 32-bit libraries are configured.
    318 
    319 COMMON_SOURCES = \
    320   src/pcre2_auto_possess.c \
    321   src/pcre2_compile.c \
    322   src/pcre2_config.c \
    323   src/pcre2_context.c \
    324   src/pcre2_dfa_match.c \
    325   src/pcre2_error.c \
    326   src/pcre2_find_bracket.c \
    327   src/pcre2_internal.h \
    328   src/pcre2_intmodedep.h \
    329   src/pcre2_jit_compile.c \
    330   src/pcre2_maketables.c \
    331   src/pcre2_match.c \
    332   src/pcre2_match_data.c \
    333   src/pcre2_newline.c \
    334   src/pcre2_ord2utf.c \
    335   src/pcre2_pattern_info.c \
    336   src/pcre2_serialize.c \
    337   src/pcre2_string_utils.c \
    338   src/pcre2_study.c \
    339   src/pcre2_substitute.c \
    340   src/pcre2_substring.c \
    341   src/pcre2_tables.c \
    342   src/pcre2_ucd.c \
    343   src/pcre2_ucp.h \
    344   src/pcre2_valid_utf.c \
    345   src/pcre2_xclass.c
    346 
    347 if WITH_PCRE2_8
    348 lib_LTLIBRARIES += libpcre2-8.la
    349 libpcre2_8_la_SOURCES = \
    350   $(COMMON_SOURCES)
    351 nodist_libpcre2_8_la_SOURCES = \
    352   $(NODIST_SOURCES)
    353 libpcre2_8_la_CFLAGS = \
    354   -DPCRE2_CODE_UNIT_WIDTH=8 \
    355   $(VISIBILITY_CFLAGS) \
    356   $(AM_CFLAGS)
    357 libpcre2_8_la_LIBADD =
    358 endif # WITH_PCRE2_8
    359 
    360 if WITH_PCRE2_16
    361 lib_LTLIBRARIES += libpcre2-16.la
    362 libpcre2_16_la_SOURCES = \
    363   $(COMMON_SOURCES)
    364 nodist_libpcre2_16_la_SOURCES = \
    365   $(NODIST_SOURCES)
    366 libpcre2_16_la_CFLAGS = \
    367   -DPCRE2_CODE_UNIT_WIDTH=16 \
    368   $(VISIBILITY_CFLAGS) \
    369   $(AM_CFLAGS)
    370 libpcre2_16_la_LIBADD =
    371 endif # WITH_PCRE2_16
    372 
    373 if WITH_PCRE2_32
    374 lib_LTLIBRARIES += libpcre2-32.la
    375 libpcre2_32_la_SOURCES = \
    376   $(COMMON_SOURCES)
    377 nodist_libpcre2_32_la_SOURCES = \
    378   $(NODIST_SOURCES)
    379 libpcre2_32_la_CFLAGS = \
    380   -DPCRE2_CODE_UNIT_WIDTH=32 \
    381   $(VISIBILITY_CFLAGS) \
    382   $(AM_CFLAGS)
    383 libpcre2_32_la_LIBADD =
    384 endif # WITH_PCRE2_32
    385 
    386 # The pcre2_chartables.c.dist file is the default version of
    387 # pcre2_chartables.c, used unless --enable-rebuild-chartables is specified.
    388 
    389 EXTRA_DIST += src/pcre2_chartables.c.dist
    390 CLEANFILES += src/pcre2_chartables.c
    391 
    392 # The JIT compiler lives in a separate directory, but its files are #included
    393 # when pcre2_jit_compile.c is processed, so they must be distributed.
    394 
    395 EXTRA_DIST += \
    396   src/sljit/sljitConfig.h \
    397   src/sljit/sljitConfigInternal.h \
    398   src/sljit/sljitExecAllocator.c \
    399   src/sljit/sljitLir.c \
    400   src/sljit/sljitLir.h \
    401   src/sljit/sljitNativeARM_32.c \
    402   src/sljit/sljitNativeARM_64.c \
    403   src/sljit/sljitNativeARM_T2_32.c \
    404   src/sljit/sljitNativeMIPS_32.c \
    405   src/sljit/sljitNativeMIPS_64.c \
    406   src/sljit/sljitNativeMIPS_common.c \
    407   src/sljit/sljitNativePPC_32.c \
    408   src/sljit/sljitNativePPC_64.c \
    409   src/sljit/sljitNativePPC_common.c \
    410   src/sljit/sljitNativeSPARC_32.c \
    411   src/sljit/sljitNativeSPARC_common.c \
    412   src/sljit/sljitNativeTILEGX-encoder.c \
    413   src/sljit/sljitNativeTILEGX_64.c \
    414   src/sljit/sljitNativeX86_32.c \
    415   src/sljit/sljitNativeX86_64.c \
    416   src/sljit/sljitNativeX86_common.c \
    417   src/sljit/sljitUtils.c
    418 
    419 # Some of the JIT sources are also in separate files that are #included.
    420 
    421 EXTRA_DIST += \
    422   src/pcre2_jit_match.c \
    423   src/pcre2_jit_misc.c
    424 
    425 if WITH_PCRE2_8
    426 libpcre2_8_la_LDFLAGS = $(EXTRA_LIBPCRE2_8_LDFLAGS)
    427 endif # WITH_PCRE2_8
    428 if WITH_PCRE2_16
    429 libpcre2_16_la_LDFLAGS = $(EXTRA_LIBPCRE2_16_LDFLAGS)
    430 endif # WITH_PCRE2_16
    431 if WITH_PCRE2_32
    432 libpcre2_32_la_LDFLAGS = $(EXTRA_LIBPCRE2_32_LDFLAGS)
    433 endif # WITH_PCRE2_32
    434 
    435 if WITH_VALGRIND
    436 if WITH_PCRE2_8
    437 libpcre2_8_la_CFLAGS += $(VALGRIND_CFLAGS)
    438 endif # WITH_PCRE2_8
    439 if WITH_PCRE2_16
    440 libpcre2_16_la_CFLAGS += $(VALGRIND_CFLAGS)
    441 endif # WITH_PCRE2_16
    442 if WITH_PCRE2_32
    443 libpcre2_32_la_CFLAGS += $(VALGRIND_CFLAGS)
    444 endif # WITH_PCRE2_32
    445 endif # WITH_VALGRIND
    446 
    447 if WITH_GCOV
    448 if WITH_PCRE2_8
    449 libpcre2_8_la_CFLAGS += $(GCOV_CFLAGS)
    450 endif # WITH_PCRE2_8
    451 if WITH_PCRE2_16
    452 libpcre2_16_la_CFLAGS += $(GCOV_CFLAGS)
    453 endif # WITH_PCRE2_16
    454 if WITH_PCRE2_32
    455 libpcre2_32_la_CFLAGS += $(GCOV_CFLAGS)
    456 endif # WITH_PCRE2_32
    457 endif # WITH_GCOV
    458 
    459 ## A version of the 8-bit library that has a POSIX API.
    460 
    461 if WITH_PCRE2_8
    462 lib_LTLIBRARIES += libpcre2-posix.la
    463 libpcre2_posix_la_SOURCES = src/pcre2posix.c
    464 libpcre2_posix_la_CFLAGS = \
    465   -DPCRE2_CODE_UNIT_WIDTH=8 \
    466   $(VISIBILITY_CFLAGS) $(AM_CFLAGS)
    467 libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS)
    468 libpcre2_posix_la_LIBADD = libpcre2-8.la
    469 if WITH_GCOV
    470 libpcre2_posix_la_CFLAGS += $(GCOV_CFLAGS)
    471 endif # WITH_GCOV
    472 endif # WITH_PCRE2_8
    473 
    474 ## Build pcre2grep if the 8-bit library is enabled
    475 
    476 if WITH_PCRE2_8
    477 bin_PROGRAMS += pcre2grep
    478 pcre2grep_SOURCES = src/pcre2grep.c
    479 pcre2grep_CFLAGS = $(AM_CFLAGS)
    480 pcre2grep_LDADD = $(LIBZ) $(LIBBZ2)
    481 pcre2grep_LDADD += libpcre2-8.la
    482 if WITH_GCOV
    483 pcre2grep_CFLAGS += $(GCOV_CFLAGS)
    484 pcre2grep_LDADD += $(GCOV_LIBS)
    485 endif # WITH_GCOV
    486 endif # WITH_PCRE2_8
    487 
    488 ## -------- Testing ----------
    489 
    490 ## If JIT support is enabled, arrange for the JIT test program to run.
    491 
    492 if WITH_JIT
    493 TESTS += pcre2_jit_test
    494 noinst_PROGRAMS += pcre2_jit_test
    495 pcre2_jit_test_SOURCES = src/pcre2_jit_test.c
    496 pcre2_jit_test_CFLAGS = $(AM_CFLAGS)
    497 pcre2_jit_test_LDADD =
    498 if WITH_PCRE2_8
    499 pcre2_jit_test_LDADD += libpcre2-8.la
    500 endif # WITH_PCRE2_8
    501 if WITH_PCRE2_16
    502 pcre2_jit_test_LDADD += libpcre2-16.la
    503 endif # WITH_PCRE2_16
    504 if WITH_PCRE2_32
    505 pcre2_jit_test_LDADD += libpcre2-32.la
    506 endif # WITH_PCRE2_32
    507 if WITH_GCOV
    508 pcre2_jit_test_CFLAGS += $(GCOV_CFLAGS)
    509 pcre2_jit_test_LDADD += $(GCOV_LIBS)
    510 endif # WITH_GCOV
    511 endif # WITH_JIT
    512 
    513 # Build the general pcre2test program. The file src/pcre2_printint.c is
    514 # #included by pcre2test as many times as needed, at different code unit
    515 # widths.
    516 
    517 bin_PROGRAMS += pcre2test
    518 EXTRA_DIST += src/pcre2_printint.c
    519 pcre2test_SOURCES = src/pcre2test.c
    520 pcre2test_CFLAGS = $(AM_CFLAGS)
    521 pcre2test_LDADD = $(LIBREADLINE)
    522 
    523 if WITH_PCRE2_8
    524 pcre2test_LDADD += libpcre2-8.la libpcre2-posix.la
    525 endif # WITH_PCRE2_8
    526 
    527 if WITH_PCRE2_16
    528 pcre2test_LDADD += libpcre2-16.la
    529 endif # WITH_PCRE2_16
    530 
    531 if WITH_PCRE2_32
    532 pcre2test_LDADD += libpcre2-32.la
    533 endif # WITH_PCRE2_32
    534 
    535 if WITH_VALGRIND
    536 pcre2test_CFLAGS += $(VALGRIND_CFLAGS)
    537 endif # WITH_VALGRIND
    538 
    539 if WITH_GCOV
    540 pcre2test_CFLAGS += $(GCOV_CFLAGS)
    541 pcre2test_LDADD += $(GCOV_LIBS)
    542 endif # WITH_GCOV
    543 
    544 ## The main library tests. Each test is a binary plus a script that runs that
    545 ## binary in various ways. We install these test binaries in case folks find it
    546 ## helpful.
    547 
    548 TESTS += RunTest
    549 dist_noinst_SCRIPTS += RunTest
    550 
    551 EXTRA_DIST += RunTest.bat
    552 
    553 ## When the 8-bit library is configured, pcre2grep will have been built.
    554 
    555 if WITH_PCRE2_8
    556 TESTS += RunGrepTest
    557 dist_noinst_SCRIPTS += RunGrepTest
    558 endif # WITH_PCRE2_8
    559 
    560 ## Distribute all the test data files
    561 
    562 EXTRA_DIST += \
    563   testdata/grepbinary \
    564   testdata/grepfilelist \
    565   testdata/grepinput \
    566   testdata/grepinput3 \
    567   testdata/grepinput8 \
    568   testdata/grepinputv \
    569   testdata/grepinputx \
    570   testdata/greplist \
    571   testdata/grepoutput \
    572   testdata/grepoutput8 \
    573   testdata/grepoutputC \
    574   testdata/grepoutputN \
    575   testdata/greppatN4 \
    576   testdata/testinput1 \
    577   testdata/testinput2 \
    578   testdata/testinput3 \
    579   testdata/testinput4 \
    580   testdata/testinput5 \
    581   testdata/testinput6 \
    582   testdata/testinput7 \
    583   testdata/testinput8 \
    584   testdata/testinput9 \
    585   testdata/testinput10 \
    586   testdata/testinput11 \
    587   testdata/testinput12 \
    588   testdata/testinput13 \
    589   testdata/testinput14 \
    590   testdata/testinput15 \
    591   testdata/testinput16 \
    592   testdata/testinput17 \
    593   testdata/testinput18 \
    594   testdata/testinput19 \
    595   testdata/testinput20 \
    596   testdata/testinput21 \
    597   testdata/testinput22 \
    598   testdata/testinput23 \
    599   testdata/testinputEBC \
    600   testdata/testoutput1 \
    601   testdata/testoutput2 \
    602   testdata/testoutput3 \
    603   testdata/testoutput3A \
    604   testdata/testoutput3B \
    605   testdata/testoutput4 \
    606   testdata/testoutput5 \
    607   testdata/testoutput6 \
    608   testdata/testoutput7 \
    609   testdata/testoutput8-16-2 \
    610   testdata/testoutput8-16-3 \
    611   testdata/testoutput8-16-3 \
    612   testdata/testoutput8-32-2 \
    613   testdata/testoutput8-32-3 \
    614   testdata/testoutput8-32-4 \
    615   testdata/testoutput8-8-2 \
    616   testdata/testoutput8-8-3 \
    617   testdata/testoutput8-8-4 \
    618   testdata/testoutput9 \
    619   testdata/testoutput10 \
    620   testdata/testoutput11-16 \
    621   testdata/testoutput11-32 \
    622   testdata/testoutput12-16 \
    623   testdata/testoutput12-32 \
    624   testdata/testoutput13 \
    625   testdata/testoutput14-16 \
    626   testdata/testoutput14-32 \
    627   testdata/testoutput14-8 \
    628   testdata/testoutput15 \
    629   testdata/testoutput16 \
    630   testdata/testoutput17 \
    631   testdata/testoutput18 \
    632   testdata/testoutput19 \
    633   testdata/testoutput20 \
    634   testdata/testoutput21 \
    635   testdata/testoutput22-16 \
    636   testdata/testoutput22-32 \
    637   testdata/testoutput22-8 \
    638   testdata/testoutput23 \
    639   testdata/testoutputEBC \
    640   testdata/valgrind-jit.supp \
    641   testdata/wintestinput3 \
    642   testdata/wintestoutput3 \
    643   perltest.sh
    644 
    645 # RunTest and RunGrepTest should clean up after themselves, but just in case
    646 # they don't, add their working files to CLEANFILES.
    647 
    648 CLEANFILES += \
    649         testSinput \
    650         test3input \
    651         test3output \
    652         test3outputA \
    653         test3outputB \
    654         testtry \
    655         teststdout \
    656 	teststderr \
    657         teststderrgrep \
    658         testtemp1grep \
    659         testtemp2grep \
    660         testtrygrep \
    661         testNinputgrep
    662 
    663 ## ------------ End of testing -------------
    664 
    665 
    666 # PCRE2 demonstration program. Not built automatcally. The point is that the
    667 # users should build it themselves. So just distribute the source.
    668 
    669 EXTRA_DIST += src/pcre2demo.c
    670 
    671 
    672 # We have .pc files for pkg-config users.
    673 
    674 pkgconfigdir = $(libdir)/pkgconfig
    675 pkgconfig_DATA =
    676 
    677 if WITH_PCRE2_8
    678 pkgconfig_DATA += libpcre2-8.pc libpcre2-posix.pc
    679 endif
    680 
    681 if WITH_PCRE2_16
    682 pkgconfig_DATA += libpcre2-16.pc
    683 endif
    684 
    685 if WITH_PCRE2_32
    686 pkgconfig_DATA += libpcre2-32.pc
    687 endif
    688 
    689 
    690 # gcov/lcov code coverage reporting
    691 #
    692 # Coverage reporting targets:
    693 #
    694 # coverage: Create a coverage report from 'make check'
    695 # coverage-baseline: Capture baseline coverage information
    696 # coverage-reset: This zeros the coverage counters only
    697 # coverage-report: This creates the coverage report only
    698 # coverage-clean-report: This removes the generated coverage report
    699 #   without cleaning the coverage data itself
    700 # coverage-clean-data: This removes the captured coverage data without
    701 #   removing the coverage files created at compile time (*.gcno)
    702 # coverage-clean: This cleans all coverage data including the generated
    703 #   coverage report.
    704 
    705 if WITH_GCOV
    706 COVERAGE_TEST_NAME = $(PACKAGE)
    707 COVERAGE_NAME = $(PACKAGE)-$(VERSION)
    708 COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
    709 COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
    710 COVERAGE_LCOV_EXTRA_FLAGS =
    711 COVERAGE_GENHTML_EXTRA_FLAGS =
    712 
    713 coverage_quiet = $(coverage_quiet_$(V))
    714 coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
    715 coverage_quiet_0 = --quiet
    716 
    717 coverage-check: all
    718 	-$(MAKE) $(AM_MAKEFLAGS) -k check
    719 
    720 coverage-baseline:
    721 	$(LCOV) $(coverage_quiet) \
    722 		--directory $(top_builddir) \
    723 		--output-file "$(COVERAGE_OUTPUT_FILE)" \
    724 		--capture \
    725 		--initial
    726 
    727 coverage-report:
    728 	$(LCOV) $(coverage_quiet) \
    729 		--directory $(top_builddir) \
    730 		--capture \
    731 		--output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
    732 		--test-name "$(COVERAGE_TEST_NAME)" \
    733 		--no-checksum \
    734 		--compat-libtool \
    735 		$(COVERAGE_LCOV_EXTRA_FLAGS)
    736 	$(LCOV) $(coverage_quiet) \
    737 		--directory $(top_builddir) \
    738 		--output-file "$(COVERAGE_OUTPUT_FILE)" \
    739 		--remove "$(COVERAGE_OUTPUT_FILE).tmp" \
    740 		"/tmp/*" \
    741 		"/usr/include/*" \
    742 		"$(includedir)/*"
    743 	-@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
    744 	LANG=C $(GENHTML) $(coverage_quiet) \
    745 		--prefix $(top_builddir) \
    746 		--output-directory "$(COVERAGE_OUTPUT_DIR)" \
    747 		--title "$(PACKAGE) $(VERSION) Code Coverage Report" \
    748 		--show-details "$(COVERAGE_OUTPUT_FILE)" \
    749 		--legend \
    750 		$(COVERAGE_GENHTML_EXTRA_FLAGS)
    751 	@echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
    752 
    753 coverage-reset:
    754 	-$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
    755 
    756 coverage-clean-report:
    757 	-rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
    758 	-rm -rf "$(COVERAGE_OUTPUT_DIR)"
    759 
    760 coverage-clean-data:
    761 	-find $(top_builddir) -name "*.gcda" -delete
    762 
    763 coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
    764 	-find $(top_builddir) -name "*.gcno" -delete
    765 
    766 coverage-distclean: coverage-clean
    767 
    768 coverage: coverage-reset coverage-baseline coverage-check coverage-report
    769 clean-local: coverage-clean
    770 distclean-local: coverage-distclean
    771 
    772 .PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
    773 
    774 # Without coverage support, still arrange for 'make distclean' to get rid of
    775 # any coverage files that may have been left from a different configuration.
    776 
    777 else
    778 
    779 coverage:
    780 	@echo "Configuring with --enable-coverage is required to generate code coverage report."
    781 
    782 DISTCLEANFILES += src/*.gcda src/*.gcno
    783 
    784 distclean-local:
    785 	rm -rf $(PACKAGE)-$(VERSION)-coverage*
    786 
    787 endif # WITH_GCOV
    788 
    789 ## CMake support
    790 
    791 EXTRA_DIST += \
    792   cmake/COPYING-CMAKE-SCRIPTS \
    793   cmake/FindPackageHandleStandardArgs.cmake \
    794   cmake/FindReadline.cmake \
    795   cmake/FindEditline.cmake \
    796   CMakeLists.txt \
    797   config-cmake.h.in
    798 
    799 ## end Makefile.am
    800