diff options
author | JPeterMugaas <jpmugaas@suddenlink.net> | 2019-04-22 17:48:59 (GMT) |
---|---|---|
committer | JPeterMugaas <jpmugaas@suddenlink.net> | 2019-04-22 17:48:59 (GMT) |
commit | 773b66547f84792fd4143e605ca27f31c2989945 (patch) | |
tree | 269e98dc06b47c6741eb7e98b92abb0bd391f406 /Makefile | |
parent | 131896ab9d4fc9b8c606616327ed223d5d86472b (diff) | |
download | lz4-773b66547f84792fd4143e605ca27f31c2989945.zip lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.gz lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.bz2 |
Initial commits from diff I submitted earlier
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 53 |
1 files changed, 48 insertions, 5 deletions
@@ -36,15 +36,50 @@ TESTDIR = tests EXDIR = examples -# Define nul output -ifneq (,$(filter Windows%,$(OS))) +# Define *.exe as extension for targetting Windows systems +TARGET_OS ?= $(shell uname) +ifeq ($(TARGET_OS),) + TARGET_OS ?= $(OS) +endif + +ifneq (,$(filter Windows%,$(TARGET_OS))) +LIBLZ4 = liblz4-$(LIBVER_MAJOR) +EXT = .exe +else +EXT = .exe +ifneq (,$(filter MINGW%,$(TARGET_OS))) +EXT = .exe +else +ifneq (,$(filter MSYS%,$(TARGET_OS))) +EXT = .exe +else +ifneq (,$(filter CYGWIN%,$(TARGET_OS))) EXT = .exe -VOID = nul else EXT = -VOID = /dev/null +endif +endif +endif endif +#determine if dev/nul based on host environment +ifneq (,$(filter MINGW%,$(shell uname))) +VOID := /dev/null +else +ifneq (,$(filter MSYS%,$(shell uname))) +VOID := /dev/null +else +ifneq (,$(filter CYGWIN%,$(shell uname))) +VOID := /dev/null +else +ifneq (,$(filter Windows%,$(OS))) +VOID := nul +else +VOID := /dev/null +endif +endif +endif +endif .PHONY: default default: lib-release lz4-release @@ -93,7 +128,7 @@ clean: #----------------------------------------------------------------------------- # make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets #----------------------------------------------------------------------------- -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW32_NT-6.1 MINGW64_NT-6.1 MINGW32_NT-10.0 MINGW64_NT-10.0)) +ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW32% MINGW64% CYGWIN% MSYS%,$(shell uname))) HOST_OS = POSIX .PHONY: install uninstall @@ -181,6 +216,14 @@ gpptest gpptest32: clean CC=$(CC) $(MAKE) -C $(PRGDIR) all CFLAGS="$(CFLAGS)" CC=$(CC) $(MAKE) -C $(TESTDIR) all CFLAGS="$(CFLAGS)" +cxx17build : CC = "$(CXX) -Wno-deprecated" +cxx17build : CFLAGS = -std=c++17 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror -pedantic +cxx17build : clean + $(CXX) -v + CC=$(CC) $(MAKE) -C $(LZ4DIR) all CFLAGS="$(CFLAGS)" + CC=$(CC) $(MAKE) -C $(PRGDIR) all CFLAGS="$(CFLAGS)" + CC=$(CC) $(MAKE) -C $(TESTDIR) all CFLAGS="$(CFLAGS)" + ctocpptest: LIBCC="$(CC)" ctocpptest: TESTCC="$(CXX)" ctocpptest: CFLAGS="" |