From d57d3e4b4d5a95970ee204e2bc31776809ca8c6f Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Thu, 10 Nov 2016 14:43:51 +0100 Subject: better MSYS/MinGW support --- .travis.yml | 10 +++++----- Makefile | 47 +++++++++++++++++++++++++++++++---------------- tests/Makefile | 1 + 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index cff9290..3a314c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,11 +9,11 @@ matrix: # Container-based 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes) - os: linux sudo: false - env: Ubu=12.04cont Cmd='make -C tests test-lz4 test-frametest test-fuzzer' COMPILER=cc + env: Ubu=12.04cont Cmd='make -C tests test-lz4 test-lz4c test-fasttest test-fullbench' COMPILER=cc - os: linux sudo: false - env: Ubu=12.04cont Cmd='make -C tests test-lz4c test-fasttest test-fullbench' COMPILER=cc + env: Ubu=12.04cont Cmd='make -C tests test-frametest test-fuzzer' COMPILER=cc - os: linux sudo: false @@ -21,22 +21,22 @@ matrix: # 14.04 LTS Server Edition 64 bit - - env: Ubu=14.04 Cmd='make -C tests test-lz4c32 test-frametest32 test-fuzzer32' COMPILER=cc + - env: Ubu=14.04 Cmd='make -C tests test-lz4c32 test-fullbench32 versionsTest' COMPILER=cc dist: trusty sudo: required addons: apt: packages: + - python3 - libc6-dev-i386 - gcc-multilib - - env: Ubu=14.04 Cmd='make -C tests test-fullbench32 versionsTest' COMPILER=cc + - env: Ubu=14.04 Cmd='make -C tests test-frametest32 test-fuzzer32' COMPILER=cc dist: trusty sudo: required addons: apt: packages: - - python3 - libc6-dev-i386 - gcc-multilib diff --git a/Makefile b/Makefile index 76b0aaa..1fd6ec3 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,7 @@ clean: #make install is validated only for Linux, OSX, kFreeBSD, Hurd and #FreeBSD targets ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD)) +HOST_OS = POSIX install: @$(MAKE) -C $(LZ4DIR) $@ @@ -90,22 +91,6 @@ travis-install: test: $(MAKE) -C $(TESTDIR) test -cmake: - @cd contrib/cmake_unofficial; cmake CMakeLists.txt; $(MAKE) - -gpptest: clean - $(MAKE) all CC=g++ CFLAGS="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" - -c_standards: clean - $(MAKE) all MOREFLAGS="-std=gnu90 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=c99 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=gnu99 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=c11 -Werror" - $(MAKE) clean - clangtest: clean clang -v CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) all CC=clang @@ -133,3 +118,33 @@ examples: $(MAKE) -C examples test endif + + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" +endif + + +#------------------------------------------------------------------------ +#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) + +cmake: + @cd contrib/cmake_unofficial; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE) + +gpptest: clean + $(MAKE) all CC=g++ CFLAGS="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +c_standards: clean + $(MAKE) all MOREFLAGS="-std=gnu90 -Werror" + $(MAKE) clean + $(MAKE) all MOREFLAGS="-std=c99 -Werror" + $(MAKE) clean + $(MAKE) all MOREFLAGS="-std=gnu99 -Werror" + $(MAKE) clean + $(MAKE) all MOREFLAGS="-std=c11 -Werror" + $(MAKE) clean + +endif diff --git a/tests/Makefile b/tests/Makefile index 3c62173..2b88f73 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -115,6 +115,7 @@ datagen : $(PRGDIR)/datagen.c datagencli.c clean: @$(MAKE) -C $(LZ4DIR) $@ > $(VOID) @$(RM) core *.o *.test tmp* \ + fullbench-dll$(EXT) fullbench-lib$(EXT) \ fullbench$(EXT) fullbench32$(EXT) \ fuzzer$(EXT) fuzzer32$(EXT) \ frametest$(EXT) frametest32$(EXT) \ -- cgit v0.12