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

Diff of /code/trunk/Makefile.am

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

revision 1151 by chpe, Sun Oct 21 16:53:46 2012 UTC revision 1181 by chpe, Sat Oct 27 18:04:36 2012 UTC
# Line 132  EXTRA_DIST += \ Line 132  EXTRA_DIST += \
132    pcre.h.generic \    pcre.h.generic \
133    config.h.generic    config.h.generic
134    
135  pcre.h.generic: configure.ac  # The only difference between pcre.h.in and pcre.h is the setting of the PCRE
136    # version number. Therefore, we can create the generic version just by copying.
137    pcre.h.generic: pcre.h.in configure.ac
138          rm -f $@          rm -f $@
139          cp -p pcre.h $@          cp -p pcre.h $@
140    
141  MAINTAINERCLEANFILES += pcre.h.generic  # It is more complicated for config.h.generic. We need the version that results
142    # from a default configuration. We can get this by doing a configure in a
143    # temporary directory. It has to be entirely done using files in that
144    # directory, because the source directory may already be configured. If you
145    # just try running configure in a new directory, it complains that the source
146    # directory is already configured.
147    config.h.generic: configure.ac
148            rm -rf $@ _generic
149            mkdir _generic
150            cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
151            cd _generic && $(abs_top_srcdir)/configure || :
152            cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
153            test -f _generic/config.h
154            perl -pe 'if(/^#define\s(?!PACKAGE)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$_="";}' _generic/config.h >$@
155            rm -rf _generic
156    
157    MAINTAINERCLEANFILES += pcre.h.generic config.h.generic
158    
159  # These are the header files we'll install. We do not distribute pcre.h because  # These are the header files we'll install. We do not distribute pcre.h because
160  # it is generated from pcre.h.in.  # it is generated from pcre.h.in.
# Line 344  libpcre32_la_CFLAGS += $(VALGRIND_CFLAGS Line 362  libpcre32_la_CFLAGS += $(VALGRIND_CFLAGS
362  endif # WITH_PCRE32  endif # WITH_PCRE32
363  endif # WITH_VALGRIND  endif # WITH_VALGRIND
364    
365    if WITH_GCOV
366    if WITH_PCRE8
367    libpcre_la_CFLAGS += $(GCOV_CFLAGS)
368    endif # WITH_PCRE8
369    if WITH_PCRE16
370    libpcre16_la_CFLAGS += $(GCOV_CFLAGS)
371    endif # WITH_PCRE16
372    if WITH_PCRE32
373    libpcre32_la_CFLAGS += $(GCOV_CFLAGS)
374    endif # WITH_PCRE32
375    endif # WITH_GCOV
376    
377  CLEANFILES += pcre_chartables.c  CLEANFILES += pcre_chartables.c
378    
379  ## If JIT support is enabled, arrange for the JIT test program to run.  ## If JIT support is enabled, arrange for the JIT test program to run.
# Line 351  if WITH_JIT Line 381  if WITH_JIT
381  TESTS += pcre_jit_test  TESTS += pcre_jit_test
382  noinst_PROGRAMS += pcre_jit_test  noinst_PROGRAMS += pcre_jit_test
383  pcre_jit_test_SOURCES = pcre_jit_test.c  pcre_jit_test_SOURCES = pcre_jit_test.c
384    pcre_jit_test_CFLAGS = $(AM_CFLAGS)
385  pcre_jit_test_LDADD =  pcre_jit_test_LDADD =
386  if WITH_PCRE8  if WITH_PCRE8
387  pcre_jit_test_LDADD += libpcre.la  pcre_jit_test_LDADD += libpcre.la
# Line 361  endif # WITH_PCRE16 Line 392  endif # WITH_PCRE16
392  if WITH_PCRE32  if WITH_PCRE32
393  pcre_jit_test_LDADD += libpcre32.la  pcre_jit_test_LDADD += libpcre32.la
394  endif # WITH_PCRE32  endif # WITH_PCRE32
395    if WITH_GCOV
396    pcre_jit_test_CFLAGS += $(GCOV_CFLAGS)
397    pcre_jit_test_LDADD += $(GCOV_LIBS)
398    endif # WITH_GCOV
399  endif # WITH_JIT  endif # WITH_JIT
400    
401  ## A version of the main pcre library that has a posix re API.  ## A version of the main pcre library that has a posix re API.
402  if WITH_PCRE8  if WITH_PCRE8
403    
404  lib_LTLIBRARIES += libpcreposix.la  lib_LTLIBRARIES += libpcreposix.la
405  libpcreposix_la_SOURCES = \  libpcreposix_la_SOURCES = \
406    pcreposix.c    pcreposix.c
407    libpcreposix_la_CFLAGS = $(AM_CFLAGS)
408  libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)  libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
409  libpcreposix_la_LIBADD = libpcre.la  libpcreposix_la_LIBADD = libpcre.la
410    
411    if WITH_GCOV
412    libpcreposix_la_CFLAGS += $(GCOV_CFLAGS)
413    endif # WITH_GCOV
414    
415  endif # WITH_PCRE8  endif # WITH_PCRE8
416    
417  ## There's a C++ library as well.  ## There's a C++ library as well.
# Line 381  libpcrecpp_la_SOURCES = \ Line 423  libpcrecpp_la_SOURCES = \
423    pcrecpp.cc \    pcrecpp.cc \
424    pcre_scanner.cc \    pcre_scanner.cc \
425    pcre_stringpiece.cc    pcre_stringpiece.cc
426    libpcrecpp_la_CXXFLAGS = $(AM_CXXFLAGS)
427  libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)  libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS)
428  libpcrecpp_la_LIBADD = libpcre.la  libpcrecpp_la_LIBADD = libpcre.la
429    
430  TESTS += pcrecpp_unittest  TESTS += pcrecpp_unittest
431  noinst_PROGRAMS += pcrecpp_unittest  noinst_PROGRAMS += pcrecpp_unittest
432  pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc  pcrecpp_unittest_SOURCES = pcrecpp_unittest.cc
433    pcrecpp_unittest_CXXFLAGS = $(AM_CXXFLAGS)
434  pcrecpp_unittest_LDADD = libpcrecpp.la  pcrecpp_unittest_LDADD = libpcrecpp.la
435    
436  TESTS += pcre_scanner_unittest  TESTS += pcre_scanner_unittest
437  noinst_PROGRAMS += pcre_scanner_unittest  noinst_PROGRAMS += pcre_scanner_unittest
438  pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc  pcre_scanner_unittest_SOURCES = pcre_scanner_unittest.cc
439    pcre_scanner_unittest_CXXFLAGS = $(AM_CXXFLAGS)
440  pcre_scanner_unittest_LDADD = libpcrecpp.la  pcre_scanner_unittest_LDADD = libpcrecpp.la
441    
442  TESTS += pcre_stringpiece_unittest  TESTS += pcre_stringpiece_unittest
443  noinst_PROGRAMS += pcre_stringpiece_unittest  noinst_PROGRAMS += pcre_stringpiece_unittest
444  pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc  pcre_stringpiece_unittest_SOURCES = pcre_stringpiece_unittest.cc
445    pcre_stringpiece_unittest_CXXFLAGS = $(AM_CXXFLAGS)
446  pcre_stringpiece_unittest_LDADD = libpcrecpp.la  pcre_stringpiece_unittest_LDADD = libpcrecpp.la
447    
448    if WITH_GCOV
449    libpcrecpp_la_CXXFLAGS += $(GCOV_CXXFLAGS)
450    pcrecpp_unittest_LDADD += $(GCOV_LIBS)
451    pcre_scanner_unittest_LDADD += $(GCOV_LIBS)
452    pcre_stringpiece_unittest_LDADD += $(GCOV_LIBS)
453    endif # WITH_GCOV
454    
455  endif # WITH_PCRE_CPP  endif # WITH_PCRE_CPP
456    
457  ## The main unit tests  ## The main unit tests
# Line 428  endif # WITH_PCRE32 Line 481  endif # WITH_PCRE32
481  if WITH_VALGRIND  if WITH_VALGRIND
482  pcretest_CFLAGS += $(VALGRIND_CFLAGS)  pcretest_CFLAGS += $(VALGRIND_CFLAGS)
483  endif # WITH_VALGRIND  endif # WITH_VALGRIND
484    if WITH_GCOV
485    pcretest_CFLAGS += $(GCOV_CFLAGS)
486    pcretest_LDADD += $(GCOV_LIBS)
487    endif # WITH_GCOV
488    
489  if WITH_PCRE8  if WITH_PCRE8
490  TESTS += RunGrepTest  TESTS += RunGrepTest
491  dist_noinst_SCRIPTS += RunGrepTest  dist_noinst_SCRIPTS += RunGrepTest
492  bin_PROGRAMS += pcregrep  bin_PROGRAMS += pcregrep
493  pcregrep_SOURCES = pcregrep.c  pcregrep_SOURCES = pcregrep.c
494    pcregrep_CFLAGS = $(AM_CFLAGS)
495  pcregrep_LDADD = $(LIBZ) $(LIBBZ2)  pcregrep_LDADD = $(LIBZ) $(LIBBZ2)
496  pcregrep_LDADD += libpcre.la libpcreposix.la  pcregrep_LDADD += libpcre.la libpcreposix.la
497    if WITH_GCOV
498    pcregrep_CFLAGS += $(GCOV_CFLAGS)
499    pcregrep_LDADD += $(GCOV_LIBS)
500    endif # WITH_GCOV
501  endif # WITH_PCRE8  endif # WITH_PCRE8
502    
503  EXTRA_DIST += \  EXTRA_DIST += \
# Line 484  EXTRA_DIST += \ Line 546  EXTRA_DIST += \
546    testdata/testinput20 \    testdata/testinput20 \
547    testdata/testinput21 \    testdata/testinput21 \
548    testdata/testinput22 \    testdata/testinput22 \
549      testdata/testinput23 \
550      testdata/testinput24 \
551      testdata/testinput25 \
552      testdata/testinput26 \
553    testdata/testinputEBC \    testdata/testinputEBC \
554    testdata/testoutput1 \    testdata/testoutput1 \
555    testdata/testoutput2 \    testdata/testoutput2 \
# Line 495  EXTRA_DIST += \ Line 561  EXTRA_DIST += \
561    testdata/testoutput8 \    testdata/testoutput8 \
562    testdata/testoutput9 \    testdata/testoutput9 \
563    testdata/testoutput10 \    testdata/testoutput10 \
   testdata/testoutput11-16 \  
564    testdata/testoutput11-8 \    testdata/testoutput11-8 \
565      testdata/testoutput11-16 \
566      testdata/testoutput11-32 \
567    testdata/testoutput12 \    testdata/testoutput12 \
568    testdata/testoutput13 \    testdata/testoutput13 \
569    testdata/testoutput14 \    testdata/testoutput14 \
570    testdata/testoutput15 \    testdata/testoutput15 \
571    testdata/testoutput16 \    testdata/testoutput16 \
572    testdata/testoutput17 \    testdata/testoutput17 \
573    testdata/testoutput18 \    testdata/testoutput18-16 \
574      testdata/testoutput18-32 \
575    testdata/testoutput19 \    testdata/testoutput19 \
576    testdata/testoutput20 \    testdata/testoutput20 \
577    testdata/testoutput21 \    testdata/testoutput21-16 \
578    testdata/testoutput22 \    testdata/testoutput21-32 \
579      testdata/testoutput22-16 \
580      testdata/testoutput22-32 \
581      testdata/testoutput23 \
582      testdata/testoutput24 \
583      testdata/testoutput25 \
584      testdata/testoutput26 \
585    testdata/testoutputEBC \    testdata/testoutputEBC \
586    testdata/wintestinput3 \    testdata/wintestinput3 \
587    testdata/wintestoutput3 \    testdata/wintestoutput3 \
# Line 677  if WITH_PCRE_CPP Line 751  if WITH_PCRE_CPP
751  man_MANS = $(pcrecpp_man)  man_MANS = $(pcrecpp_man)
752  endif  endif
753    
754    # gcov/lcov code coverage reporting
755    
756    if WITH_GCOV
757    
758    # Coverage reporting targets:
759    #
760    # coverage: Create a coverage report from 'make check'
761    # coverage-baseline: Capture baseline coverage information
762    # coverage-reset: This zeros the coverage counters only
763    # coverage-report: This creates the coverage report only
764    # coverage-clean-report: This removes the generated coverage report
765    #   without cleaning the coverage data itself
766    # coverage-clean-data: This removes the captured coverage data without
767    #   removing the coverage files created at compile time (*.gcno)
768    # coverage-clean: This cleans all coverage data including the generated
769    #   coverage report.
770    
771    COVERAGE_TEST_NAME = $(PACKAGE)
772    COVERAGE_NAME = $(PACKAGE)-$(VERSION)
773    COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
774    COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
775    COVERAGE_LCOV_EXTRA_FLAGS =
776    COVERAGE_GENHTML_EXTRA_FLAGS =
777    
778    coverage_quiet = $(coverage_quiet_$(V))
779    coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
780    coverage_quiet_0 = --quiet
781    
782    coverage-check: all
783            -$(MAKE) $(AM_MAKEFLAGS) -k check
784    
785    coverage-baseline:
786            $(LCOV) $(coverage_quiet) \
787                    --directory $(top_builddir) \
788                    --output-file "$(COVERAGE_OUTPUT_FILE)" \
789                    --capture \
790                    --initial
791    
792    coverage-report:
793            $(LCOV) $(coverage_quiet) \
794                    --directory $(top_builddir) \
795                    --capture \
796                    --output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
797                    --test-name "$(COVERAGE_TEST_NAME)" \
798                    --no-checksum \
799                    --compat-libtool \
800                    $(COVERAGE_LCOV_EXTRA_FLAGS)
801            $(LCOV) $(coverage_quiet) \
802                    --directory $(top_builddir) \
803                    --output-file "$(COVERAGE_OUTPUT_FILE)" \
804                    --remove "$(COVERAGE_OUTPUT_FILE).tmp" \
805                    "/tmp/*" \
806                    "/usr/include/*" \
807                    "$(includedir)/*"
808            -@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
809            LANG=C $(GENHTML) $(coverage_quiet) \
810                    --prefix $(top_builddir) \
811                    --output-directory "$(COVERAGE_OUTPUT_DIR)" \
812                    --title "$(PACKAGE) $(VERSION) Code Coverage Report" \
813                    --show-details "$(COVERAGE_OUTPUT_FILE)" \
814                    --legend \
815                    $(COVERAGE_GENHTML_EXTRA_FLAGS)
816            @echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
817    
818    coverage-reset:
819            -$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
820    
821    coverage-clean-report:
822            -rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
823            -rm -rf "$(COVERAGE_OUTPUT_DIR)"
824    
825    coverage-clean-data:
826            -find $(top_builddir) -name "*.gcda" -delete
827    
828    coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
829            -find $(top_builddir) -name "*.gcno" -delete
830    
831    coverage-distclean: coverage-clean
832    
833    coverage: coverage-reset coverage-baseline coverage-check coverage-report
834    clean-local: coverage-clean
835    distclean-local: coverage-distclean
836    
837    .PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
838    
839    else
840    
841    coverage:
842            @echo "Configuring with --enable-coverage required to generate code coverage report."
843    
844    endif # WITH_GCOV
845    
846  ## CMake support  ## CMake support
847    
848  EXTRA_DIST += \  EXTRA_DIST += \

Legend:
Removed from v.1151  
changed lines
  Added in v.1181

  ViewVC Help
Powered by ViewVC 1.1.5