summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 20 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 0aa1b9d..86613fd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,8 @@
# ################################################################
# LZ4 - Makefile
-# Copyright (C) Yann Collet 2011-2016
+# Copyright (C) Yann Collet 2011-present
# All rights reserved.
#
-# This Makefile is validated for Linux, macOS, *BSD, Hurd, Solaris, MSYS2 targets
-#
# BSD license
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@@ -58,6 +56,7 @@ all: allmost manuals
allmost: lib lz4 examples
.PHONY: lib lib-release liblz4.a
+lib: liblz4.a
lib lib-release liblz4.a:
@$(MAKE) -C $(LZ4DIR) $@
@@ -69,8 +68,8 @@ lz4 lz4-release :
@cp $(PRGDIR)/lz4$(EXT) .
.PHONY: examples
-examples: lib lz4
- $(MAKE) -C $(EXDIR) test
+examples: liblz4.a
+ $(MAKE) -C $(EXDIR) all
.PHONY: manuals
manuals:
@@ -122,9 +121,14 @@ ifneq (,$(filter $(HOST_OS),MSYS POSIX))
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
+.PHONY: check
+check:
+ $(MAKE) -C $(TESTDIR) test-lz4-essentials
+
.PHONY: test
test:
$(MAKE) -C $(TESTDIR) $@
+ $(MAKE) -C $(EXDIR) $@
clangtest: clean
clang -v
@@ -139,10 +143,10 @@ clangtest-native: clean
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang
usan: clean
- CC=clang CFLAGS="-O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T1mn" NB_LOOPS=-i1
+ CC=clang CFLAGS="-O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
usan32: clean
- CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T1mn" NB_LOOPS=-i1
+ CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
staticAnalyze: clean
CFLAGS=-g scan-build --status-bugs -v $(MAKE) all
@@ -159,20 +163,17 @@ platformTest: clean
versionsTest: clean
$(MAKE) -C $(TESTDIR) $@
-gpptest: clean
- g++ -v
- CC=g++ $(MAKE) -C $(LZ4DIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
- CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
- CC=g++ $(MAKE) -C $(TESTDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
-
-gpptest32: clean
- g++ -v
- CC=g++ $(MAKE) -C $(LZ4DIR) all CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
- CC=g++ $(MAKE) -C $(PRGDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
- CC=g++ $(MAKE) -C $(TESTDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
+gpptest gpptest32: CC = "$(CXX) -Wno-deprecated"
+gpptest gpptest32: CFLAGS = -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror
+gpptest32: CFLAGS += -m32
+gpptest gpptest32: 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)"
c_standards: clean
- # note : lz4 is not C90 compatible, because it requires long long support
+ CFLAGS="-std=c90 -Werror" $(MAKE) clean allmost
CFLAGS="-std=gnu90 -Werror" $(MAKE) clean allmost
CFLAGS="-std=c99 -Werror" $(MAKE) clean allmost
CFLAGS="-std=gnu99 -Werror" $(MAKE) clean allmost