Imported Upstream version 2.6.2
[platform/upstream/expat.git] / Makefile.am
index 5ed9ac4..9c2259d 100644 (file)
@@ -6,7 +6,10 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
+# Copyright (c) 2018      KangLin <kl222@126.com>
+# Copyright (c) 2022      Johnny Jazeix <jazeix@gmail.com>
+# Copyright (c) 2023      Sony Corporation / Snild Dolkow <snild@sony.com>
 # Licensed under the MIT license:
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 
 AUTOMAKE_OPTIONS = \
     dist-bzip2 \
+    dist-lzip \
+    dist-xz \
     foreign \
-    no-dist-gzip \
     subdir-objects
 
 ACLOCAL_AMFLAGS = -I m4
 LIBTOOLFLAGS = --verbose
 
-SUBDIRS = lib examples tests  # lib goes first to build first
+SUBDIRS = lib # lib goes first to build first
+if WITH_EXAMPLES
+SUBDIRS += examples
+endif
+if WITH_TESTS
+SUBDIRS += tests  
+endif
 if WITH_XMLWF
 SUBDIRS += xmlwf doc
 endif
@@ -46,42 +56,36 @@ pkgconfig_DATA = expat.pc
 pkgconfigdir = $(libdir)/pkgconfig
 
 
+dist_cmake_DATA = \
+    cmake/autotools/expat.cmake
+
+nodist_cmake_DATA = \
+    cmake/autotools/expat-config-version.cmake \
+    cmake/autotools/expat-noconfig.cmake \
+    cmake/expat-config.cmake
+
+cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
+
+
 _EXTRA_DIST_CMAKE = \
+    cmake/autotools/expat-noconfig__linux.cmake.in \
+    cmake/autotools/expat-noconfig__macos.cmake.in \
+    cmake/autotools/expat-noconfig__windows.cmake.in \
+    cmake/autotools/expat-package-init.cmake \
+    cmake/mingw-toolchain.cmake \
+    \
     CMakeLists.txt \
     CMake.README \
     ConfigureChecks.cmake \
+    expat.pc.cmake \
     expat_config.h.cmake
 
 _EXTRA_DIST_WINDOWS = \
-    examples/elements.vcxproj \
-    examples/elements.vcxproj.filters \
-    examples/outline.vcxproj \
-    examples/outline.vcxproj.filters \
-    \
-    lib/expat_static.vcxproj \
-    lib/expat_static.vcxproj.filters \
-    lib/expat.vcxproj \
-    lib/expat.vcxproj.filters \
-    lib/expatw_static.vcxproj \
-    lib/expatw_static.vcxproj.filters \
-    lib/expatw.vcxproj \
-    lib/expatw.vcxproj.filters \
-    \
-    tests/benchmark/benchmark.sln \
-    tests/benchmark/benchmark.vcxproj \
-    \
-    tests/runtests.sln \
-    tests/runtests.vcxproj \
-    tests/runtests.vcxproj.filters \
-    \
+    win32/build_expat_iss.bat \
     win32/expat.iss \
     win32/MANIFEST.txt \
     win32/README.txt \
-    \
-    xmlwf/xmlwf.vcxproj \
-    xmlwf/xmlwf.vcxproj.filters \
-    \
-    expat.sln
+    win32/version.rc.cmake
 
 EXTRA_DIST = \
     $(_EXTRA_DIST_CMAKE) \
@@ -89,10 +93,18 @@ EXTRA_DIST = \
     \
     conftools/expat.m4 \
     conftools/get-version.sh \
-    conftools/PrintPath \
     \
+    fuzz/xml_parsebuffer_fuzzer.c \
+    fuzz/xml_parse_fuzzer.c \
+    \
+    xmlwf/xmlwf_helpgen.py \
+    xmlwf/xmlwf_helpgen.sh \
+    \
+    buildconf.sh \
     Changes \
     README.md \
+    \
+    fix-xmltest-log.sh \
     test-driver-wrapper.sh
 
 
@@ -120,8 +132,14 @@ buildlib:
 run-benchmark:
        $(MAKE) -C tests/benchmark
        ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
-
-tests/xmlts.zip:
+       ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3
+       ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3
+       ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3
+       ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3
+       ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3
+
+.PHONY: download-xmlts-zip
+download-xmlts-zip:
        if test "$(XMLTS_ZIP)" = ""; then \
                wget --output-document=tests/xmlts.zip \
                        https://www.w3.org/XML/Test/xmlts20080827.zip; \
@@ -129,16 +147,26 @@ tests/xmlts.zip:
                cp $(XMLTS_ZIP) tests/xmlts.zip; \
        fi
 
-tests/xmlconf: tests/xmlts.zip
+tests/xmlts.zip:
+       $(MAKE) download-xmlts-zip
+
+.PHONY: extract-xmlts-zip
+extract-xmlts-zip: tests/xmlts.zip
+       [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip  # vpath workaround
        cd tests && unzip -q xmlts.zip
 
+tests/xmlconf: tests/xmlts.zip
+       $(MAKE) extract-xmlts-zip
+
 .PHONY: run-xmltest
 run-xmltest: tests/xmlconf
 if WITH_XMLWF
+       [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip  # vpath workaround
+       $(MAKE) -C lib
        $(MAKE) -C xmlwf
-       tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log
-       dos2unix tests/xmltest.log
-       diff -u tests/xmltest.log.expected tests/xmltest.log
+       $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
+       $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
+       diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
 else
        @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
        @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
@@ -147,7 +175,7 @@ endif
 
 .PHONY: qa
 qa:
-       ./qa.sh address
-       ./qa.sh memory
-       ./qa.sh undefined
-       ./qa.sh coverage
+       QA_COMPILER=clang QA_SANITIZER=address   ./qa.sh
+       QA_COMPILER=clang QA_SANITIZER=memory    ./qa.sh
+       QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
+       QA_COMPILER=gcc   QA_PROCESSOR=gcov      ./qa.sh