ext/xlsxwriter/libxlsxwriter/Makefile in xlsxwriter-0.2.1.pre.2 vs ext/xlsxwriter/libxlsxwriter/Makefile in xlsxwriter-0.2.2

- old
+ new

@@ -1,21 +1,23 @@ ############################################################################### # # Makefile for libxlsxwriter library. # -# Copyright 2014-2019, John McNamara, jmcnamara@cpan.org +# Copyright 2014-2020, John McNamara, jmcnamara@cpan.org # # Keep the output quiet by default. Q=@ ifdef V Q= endif -INSTALL_DIR ?= /usr/local +DESTDIR ?= +PREFIX ?= /usr/local PYTEST ?= py.test +PYTESTFILES ?= test .PHONY: docs tags examples # Build the libs. all : @@ -23,10 +25,13 @@ $(Q)$(MAKE) -C third_party/minizip endif ifndef USE_STANDARD_TMPFILE $(Q)$(MAKE) -C third_party/tmpfileplus endif +ifndef USE_NO_MD5 + $(Q)$(MAKE) -C third_party/md5 +endif $(Q)$(MAKE) -C src # Build the example programs. examples : $(Q)$(MAKE) -C examples @@ -39,43 +44,62 @@ $(Q)$(MAKE) clean -C examples $(Q)rm -rf docs/html $(Q)rm -rf test/functional/__pycache__ $(Q)rm -f test/functional/*.pyc $(Q)rm -f lib/* -ifndef USE_STANDARD_TMPFILE +ifndef USE_SYSTEM_MINIZIP $(Q)$(MAKE) clean -C third_party/minizip endif ifndef USE_STANDARD_TMPFILE $(Q)$(MAKE) clean -C third_party/tmpfileplus endif +ifndef USE_NO_MD5 + $(Q)$(MAKE) clean -C third_party/md5 +endif # Run the unit tests. -test : all test_functional test_unit +test : all test_unit test_functional # Test for C++ const correctness on APIs. test_const : all $(Q)$(MAKE) clean -C test/functional/src $(Q)! $(MAKE) -C test/functional/src CFLAGS=-Wwrite-strings 2>&1 | grep -A 1 "note:" # Run the functional tests. test_functional : all $(Q)$(MAKE) -C test/functional/src - $(Q)$(PYTEST) test/functional -v + $(Q)$(PYTEST) test/functional -v -k $(PYTESTFILES) # Run all tests. test_unit : @echo "Compiling unit tests ..." ifndef USE_SYSTEM_MINIZIP $(Q)$(MAKE) -C third_party/minizip endif ifndef USE_STANDARD_TMPFILE $(Q)$(MAKE) -C third_party/tmpfileplus endif +ifndef USE_NO_MD5 + $(Q)$(MAKE) -C third_party/md5 +endif $(Q)$(MAKE) -C src test_lib $(Q)$(MAKE) -C test/unit test +# Test Cmake. This test should really be done with Cmake in the cmake dir but +# this is a workaround for now. +test_cmake : +ifneq ($(findstring m32,$(CFLAGS)),m32) + $(Q)$(MAKE) -C src clean + $(Q)cd cmake; cmake .. -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON; make clean; make; cp libxlsxwriter.a ../src/ + $(Q)cmake/xlsxwriter_unit + $(Q)$(MAKE) -C test/functional/src + $(Q)$(PYTEST) test/functional -v -k $(PYTESTFILES) +else + @echo "Skipping Cmake tests on 32 bit target." +endif + # Test the functional test exes with valgrind (in 64bit mode only). test_valgrind : all ifndef NO_VALGRIND $(Q)$(MAKE) -C test/functional/src test_valgrind $(Q)$(MAKE) -C examples test_valgrind @@ -96,21 +120,24 @@ # Build the doxygen docs. doc: docs docs: $(Q)$(MAKE) -C docs +docs_doxygen_only: + $(Q)$(MAKE) -C docs docs_doxygen_only + # Simple minded install. install: all - $(Q)mkdir -p $(INSTALL_DIR)/include - $(Q)cp -R include/* $(INSTALL_DIR)/include - $(Q)mkdir -p $(INSTALL_DIR)/lib - $(Q)cp lib/* $(INSTALL_DIR)/lib + $(Q)mkdir -p $(DESTDIR)$(PREFIX)/include + $(Q)cp -R include/* $(DESTDIR)$(PREFIX)/include + $(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib + $(Q)cp lib/* $(DESTDIR)$(PREFIX)/lib # Simpler minded uninstall. uninstall: - $(Q)rm -rf $(INSTALL_DIR)/include/xlsxwriter* - $(Q)rm $(INSTALL_DIR)/lib/libxlsxwriter.* + $(Q)rm -rf $(DESTDIR)$(PREFIX)/include/xlsxwriter* + $(Q)rm $(DESTDIR)$(PREFIX)/lib/libxlsxwriter.* # Strip the lib files. strip: $(Q)strip lib/* @@ -120,15 +147,18 @@ $(Q)$(MAKE) -C third_party/minizip endif ifndef USE_STANDARD_TMPFILE $(Q)$(MAKE) -C third_party/tmpfileplus endif +ifndef USE_NO_MD5 + $(Q)$(MAKE) -C third_party/md5 +endif $(Q)$(MAKE) -C src clean $(Q)rm -f lib/* $(Q)rm -rf cov-int $(Q)rm -f libxlsxwriter-coverity.tgz - $(Q)../../cov-analysis-linux64-8.7.0/bin/cov-build --dir cov-int make -C src libxlsxwriter.a + $(Q)../../cov-analysis-linux64-2019.03/bin/cov-build --dir cov-int make -C src libxlsxwriter.a $(Q)tar -czf libxlsxwriter-coverity.tgz cov-int $(Q)$(MAKE) -C src clean $(Q)rm -f lib/* # Run a scan-build static analysis. @@ -137,10 +167,13 @@ $(Q)$(MAKE) -C third_party/minizip endif ifndef USE_STANDARD_TMPFILE $(Q)$(MAKE) -C third_party/tmpfileplus endif +ifndef USE_NO_MD5 + $(Q)$(MAKE) -C third_party/md5 +endif $(Q)$(MAKE) -C src clean $(Q)rm -f lib/* $(Q)scan-build make -C src libxlsxwriter.a $(Q)$(MAKE) -C src clean $(Q)rm -f lib/* @@ -150,9 +183,10 @@ $(Q)for f in include/xlsxwriter/*.h; do aspell --lang=en_US --check $$f; done $(Q)for f in src/*.c; do aspell --lang=en_US --check $$f; done $(Q)for f in examples/*.c; do aspell --lang=en_US --check $$f; done $(Q)aspell --lang=en_US --check Changes.txt $(Q)aspell --lang=en_US --check Readme.md + $(Q)aspell --lang=en_US --check docs/src/examples.txt releasecheck: $(Q)dev/release/release_check.sh release: releasecheck