Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 1 | # ################################################################ |
Yann Collet | 599c69d | 2016-08-30 13:33:20 -0700 | [diff] [blame] | 2 | # Copyright (c) 2016-present, Yann Collet, Facebook, Inc. |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 3 | # All rights reserved. |
Yann Collet | 118bfc4 | 2016-05-30 18:50:28 +0200 | [diff] [blame] | 4 | # |
Yann Collet | 599c69d | 2016-08-30 13:33:20 -0700 | [diff] [blame] | 5 | # This source code is licensed under the BSD-style license found in the |
| 6 | # LICENSE file in the root directory of this source tree. An additional grant |
| 7 | # of patent rights can be found in the PATENTS file in the same directory. |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 8 | # ################################################################ |
| 9 | |
Yann Collet | 4c9a4c1 | 2016-09-19 14:58:14 +0200 | [diff] [blame] | 10 | PRGDIR = programs |
| 11 | ZSTDDIR = lib |
| 12 | BUILDIR = build |
inikep | e9dfdf6 | 2016-05-27 11:56:15 +0200 | [diff] [blame] | 13 | ZWRAPDIR = zlibWrapper |
inikep | a1c8115 | 2016-08-18 13:35:36 +0200 | [diff] [blame] | 14 | TESTDIR = tests |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 15 | |
Yann Collet | 88fcd29 | 2015-11-25 14:42:45 +0100 | [diff] [blame] | 16 | # Define nul output |
Yann Collet | 88fcd29 | 2015-11-25 14:42:45 +0100 | [diff] [blame] | 17 | VOID = /dev/null |
Przemyslaw Skibinski | 3a41559 | 2016-11-03 12:59:20 +0100 | [diff] [blame] | 18 | |
| 19 | ifneq (,$(filter Windows%,$(OS))) |
| 20 | EXT =.exe |
| 21 | else |
| 22 | EXT = |
Yann Collet | 88fcd29 | 2015-11-25 14:42:45 +0100 | [diff] [blame] | 23 | endif |
| 24 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 25 | .PHONY: default |
Yann Collet | 8b1d004 | 2017-03-05 21:17:32 -0800 | [diff] [blame] | 26 | default: lib-release zstd-release |
Yann Collet | 213089c | 2015-06-18 07:43:16 -0800 | [diff] [blame] | 27 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 28 | .PHONY: all |
Yann Collet | 7757577 | 2017-02-22 01:10:43 -0800 | [diff] [blame] | 29 | all: | allmost examples manual |
Yann Collet | a86a09e | 2016-12-22 11:31:39 +0100 | [diff] [blame] | 30 | |
| 31 | .PHONY: allmost |
Yann Collet | 7cedbd1 | 2016-12-22 12:43:00 +0100 | [diff] [blame] | 32 | allmost: |
| 33 | $(MAKE) -C $(ZSTDDIR) all |
| 34 | $(MAKE) -C $(PRGDIR) all |
| 35 | $(MAKE) -C $(TESTDIR) all |
| 36 | $(MAKE) -C $(ZWRAPDIR) all |
| 37 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 38 | #skip zwrapper, can't build that on alternate architectures without the proper zlib installed |
| 39 | .PHONY: allarch |
| 40 | allarch: |
| 41 | $(MAKE) -C $(ZSTDDIR) all |
| 42 | $(MAKE) -C $(PRGDIR) all |
| 43 | $(MAKE) -C $(TESTDIR) all |
| 44 | |
Yann Collet | 7cedbd1 | 2016-12-22 12:43:00 +0100 | [diff] [blame] | 45 | .PHONY: all32 |
| 46 | all32: |
| 47 | $(MAKE) -C $(PRGDIR) zstd32 |
| 48 | $(MAKE) -C $(TESTDIR) all32 |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 49 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 50 | .PHONY: lib |
| 51 | lib: |
Yann Collet | 8b1d004 | 2017-03-05 21:17:32 -0800 | [diff] [blame] | 52 | @$(MAKE) -C $(ZSTDDIR) $@ |
| 53 | |
| 54 | .PHONY: lib-release |
| 55 | lib-release: |
Yann Collet | e19111c | 2016-10-12 11:09:36 -0700 | [diff] [blame] | 56 | @$(MAKE) -C $(ZSTDDIR) |
| 57 | |
Yann Collet | d41380e | 2016-11-07 14:55:12 -0800 | [diff] [blame] | 58 | .PHONY: zstd |
Yann Collet | 32faf6c | 2016-07-22 04:45:06 +0200 | [diff] [blame] | 59 | zstd: |
Yann Collet | d41380e | 2016-11-07 14:55:12 -0800 | [diff] [blame] | 60 | @$(MAKE) -C $(PRGDIR) $@ |
Przemyslaw Skibinski | 3a41559 | 2016-11-03 12:59:20 +0100 | [diff] [blame] | 61 | cp $(PRGDIR)/zstd$(EXT) . |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 62 | |
Yann Collet | c2a4632 | 2017-02-02 20:54:14 -0800 | [diff] [blame] | 63 | .PHONY: zstd-release |
| 64 | zstd-release: |
| 65 | @$(MAKE) -C $(PRGDIR) |
| 66 | cp $(PRGDIR)/zstd$(EXT) . |
| 67 | |
Yann Collet | 563ef8a | 2017-01-18 12:12:10 -0800 | [diff] [blame] | 68 | .PHONY: zstdmt |
| 69 | zstdmt: |
| 70 | @$(MAKE) -C $(PRGDIR) $@ |
| 71 | cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) |
| 72 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 73 | .PHONY: zlibwrapper |
inikep | e9dfdf6 | 2016-05-27 11:56:15 +0200 | [diff] [blame] | 74 | zlibwrapper: |
inikep | 68cd476 | 2016-09-23 12:42:21 +0200 | [diff] [blame] | 75 | $(MAKE) -C $(ZWRAPDIR) test |
inikep | e9dfdf6 | 2016-05-27 11:56:15 +0200 | [diff] [blame] | 76 | |
Yann Collet | 27526c7 | 2017-03-01 17:02:49 -0800 | [diff] [blame] | 77 | .PHONY: shortest |
| 78 | shortest: |
| 79 | $(MAKE) -C $(TESTDIR) $@ |
| 80 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 81 | .PHONY: test |
Yann Collet | 6f9c056 | 2016-05-01 10:26:30 +0200 | [diff] [blame] | 82 | test: |
inikep | a1c8115 | 2016-08-18 13:35:36 +0200 | [diff] [blame] | 83 | $(MAKE) -C $(TESTDIR) $@ |
Yann Collet | 6f9c056 | 2016-05-01 10:26:30 +0200 | [diff] [blame] | 84 | |
Yann Collet | 7757577 | 2017-02-22 01:10:43 -0800 | [diff] [blame] | 85 | .PHONY: examples |
| 86 | examples: |
| 87 | CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all |
| 88 | |
| 89 | .PHONY: manual |
| 90 | manual: |
| 91 | $(MAKE) -C contrib/gen_html $@ |
| 92 | |
Yann Collet | 6851db4 | 2017-03-30 12:42:44 -0700 | [diff] [blame] | 93 | .PHONY: cleanTabs |
| 94 | cleanTabs: |
| 95 | cd contrib; ./cleanTabs |
| 96 | |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 97 | .PHONY: clean |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 98 | clean: |
Yann Collet | 88fcd29 | 2015-11-25 14:42:45 +0100 | [diff] [blame] | 99 | @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) |
| 100 | @$(MAKE) -C $(PRGDIR) $@ > $(VOID) |
inikep | a1c8115 | 2016-08-18 13:35:36 +0200 | [diff] [blame] | 101 | @$(MAKE) -C $(TESTDIR) $@ > $(VOID) |
inikep | e9dfdf6 | 2016-05-27 11:56:15 +0200 | [diff] [blame] | 102 | @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) |
Yann Collet | 1f57c2e | 2016-12-21 16:20:11 +0100 | [diff] [blame] | 103 | @$(MAKE) -C examples/ $@ > $(VOID) |
Yann Collet | 88ba647 | 2017-02-22 10:52:36 -0800 | [diff] [blame] | 104 | @$(MAKE) -C contrib/gen_html $@ > $(VOID) |
Yann Collet | 900f39e | 2017-01-20 16:36:29 -0800 | [diff] [blame] | 105 | @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 106 | @echo Cleaning completed |
| 107 | |
Yann Collet | e405c7a | 2016-10-12 15:29:22 -0700 | [diff] [blame] | 108 | #------------------------------------------------------------------------------ |
| 109 | # make install is validated only for Linux, OSX, Hurd and some BSD targets |
| 110 | #------------------------------------------------------------------------------ |
cyan4973 | 8bcbf42 | 2017-06-04 23:52:00 -0700 | [diff] [blame] | 111 | ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) |
Yann Collet | b402f1e | 2017-04-18 14:34:24 -0700 | [diff] [blame] | 112 | |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 113 | HOST_OS = POSIX |
Milan Ševčík | f49f760 | 2017-04-19 19:25:53 +0200 | [diff] [blame] | 114 | CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON |
Yann Collet | f3f1321 | 2016-11-02 17:02:45 -0700 | [diff] [blame] | 115 | |
Yann Collet | b402f1e | 2017-04-18 14:34:24 -0700 | [diff] [blame] | 116 | .PHONY: list |
| 117 | list: |
| 118 | @$(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 |
| 119 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 120 | .PHONY: install clangtest gpptest armtest usan asan uasan |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 121 | install: |
Yann Collet | e19111c | 2016-10-12 11:09:36 -0700 | [diff] [blame] | 122 | @$(MAKE) -C $(ZSTDDIR) $@ |
| 123 | @$(MAKE) -C $(PRGDIR) $@ |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 124 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 125 | .PHONY: uninstall |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 126 | uninstall: |
Yann Collet | e19111c | 2016-10-12 11:09:36 -0700 | [diff] [blame] | 127 | @$(MAKE) -C $(ZSTDDIR) $@ |
| 128 | @$(MAKE) -C $(PRGDIR) $@ |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 129 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 130 | .PHONY: travis-install |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 131 | travis-install: |
Yann Collet | c620b48 | 2015-12-01 01:56:02 +0100 | [diff] [blame] | 132 | $(MAKE) install PREFIX=~/install_test_dir |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 133 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 134 | .PHONY: gppbuild |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 135 | gppbuild: clean |
| 136 | g++ -v |
Yann Collet | 5eb749e | 2017-01-11 18:21:25 +0100 | [diff] [blame] | 137 | CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" |
Yann Collet | 3e5b73b | 2016-01-10 20:46:20 +0100 | [diff] [blame] | 138 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 139 | .PHONY: gcc5build |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 140 | gcc5build: clean |
| 141 | gcc-5 -v |
| 142 | CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" |
| 143 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 144 | .PHONY: gcc6build |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 145 | gcc6build: clean |
| 146 | gcc-6 -v |
| 147 | CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" |
| 148 | |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 149 | .PHONY: clangbuild |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 150 | clangbuild: clean |
| 151 | clang -v |
| 152 | CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" |
| 153 | |
| 154 | m32build: clean |
| 155 | gcc -v |
| 156 | $(MAKE) all32 |
| 157 | |
| 158 | armbuild: clean |
| 159 | CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch |
| 160 | |
| 161 | aarch64build: clean |
| 162 | CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch |
| 163 | |
| 164 | ppcbuild: clean |
| 165 | CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch |
| 166 | |
| 167 | ppc64build: clean |
| 168 | CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch |
| 169 | |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 170 | armfuzz: clean |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 171 | CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 172 | |
| 173 | aarch64fuzz: clean |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 174 | CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 175 | |
| 176 | ppcfuzz: clean |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 177 | CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 178 | |
| 179 | ppc64fuzz: clean |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 180 | CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 181 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 182 | gpptest: clean |
| 183 | CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" |
| 184 | |
inikep | c9bb102 | 2016-06-21 18:04:13 +0200 | [diff] [blame] | 185 | gcc5test: clean |
| 186 | gcc-5 -v |
| 187 | $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" |
| 188 | |
| 189 | gcc6test: clean |
| 190 | gcc-6 -v |
| 191 | $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" |
| 192 | |
Yann Collet | 213089c | 2015-06-18 07:43:16 -0800 | [diff] [blame] | 193 | clangtest: clean |
Yann Collet | f4ce891 | 2015-08-11 14:18:45 +0100 | [diff] [blame] | 194 | clang -v |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 195 | $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" |
Yann Collet | 213089c | 2015-06-18 07:43:16 -0800 | [diff] [blame] | 196 | |
Yann Collet | 7083b8a | 2015-07-06 23:58:59 -0800 | [diff] [blame] | 197 | armtest: clean |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 198 | $(MAKE) -C $(TESTDIR) datagen # use native, faster |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 199 | $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests |
Przemyslaw Skibinski | e579ab5 | 2016-11-14 12:57:05 +0100 | [diff] [blame] | 200 | |
| 201 | aarch64test: |
| 202 | $(MAKE) -C $(TESTDIR) datagen # use native, faster |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 203 | $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests |
Yann Collet | 521b010 | 2016-02-08 01:27:59 +0100 | [diff] [blame] | 204 | |
Yann Collet | 521b010 | 2016-02-08 01:27:59 +0100 | [diff] [blame] | 205 | ppctest: clean |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 206 | $(MAKE) -C $(TESTDIR) datagen # use native, faster |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 207 | $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests |
Yann Collet | 521b010 | 2016-02-08 01:27:59 +0100 | [diff] [blame] | 208 | |
inikep | 1981d5a | 2016-05-30 10:18:56 +0200 | [diff] [blame] | 209 | ppc64test: clean |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 210 | $(MAKE) -C $(TESTDIR) datagen # use native, faster |
Sean Purcell | 0b0b10e | 2017-03-20 11:32:24 -0700 | [diff] [blame] | 211 | $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests |
inikep | 1981d5a | 2016-05-30 10:18:56 +0200 | [diff] [blame] | 212 | |
Przemyslaw Skibinski | d41c048 | 2017-02-22 11:07:28 +0100 | [diff] [blame] | 213 | arm-ppc-compilation: |
| 214 | $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" |
| 215 | $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" |
| 216 | $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" |
| 217 | $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" |
| 218 | |
Sean Purcell | caf0ee8 | 2017-03-09 17:28:08 -0800 | [diff] [blame] | 219 | # run UBsan with -fsanitize-recover=signed-integer-overflow |
| 220 | # due to a bug in UBsan when doing pointer subtraction |
| 221 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 |
| 222 | |
Yann Collet | 83fae97 | 2015-10-23 15:21:53 +0100 | [diff] [blame] | 223 | usan: clean |
Sean Purcell | caf0ee8 | 2017-03-09 17:28:08 -0800 | [diff] [blame] | 224 | $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined" |
Yann Collet | 213089c | 2015-06-18 07:43:16 -0800 | [diff] [blame] | 225 | |
Yann Collet | 83fae97 | 2015-10-23 15:21:53 +0100 | [diff] [blame] | 226 | asan: clean |
| 227 | $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address" |
| 228 | |
Sean Purcell | caf0ee8 | 2017-03-09 17:28:08 -0800 | [diff] [blame] | 229 | asan-%: clean |
| 230 | LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* |
| 231 | |
Yann Collet | d996743 | 2016-05-18 14:16:49 +0200 | [diff] [blame] | 232 | msan: clean |
Nick Terrell | c2edb78 | 2017-06-26 18:57:04 -0700 | [diff] [blame] | 233 | $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason |
Yann Collet | d996743 | 2016-05-18 14:16:49 +0200 | [diff] [blame] | 234 | |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 235 | msan-%: clean |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 236 | LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 237 | |
Yann Collet | 6c3e2e7 | 2015-12-11 10:44:07 +0100 | [diff] [blame] | 238 | asan32: clean |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 239 | $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" |
Yann Collet | 6c3e2e7 | 2015-12-11 10:44:07 +0100 | [diff] [blame] | 240 | |
Yann Collet | 83fae97 | 2015-10-23 15:21:53 +0100 | [diff] [blame] | 241 | uasan: clean |
Sean Purcell | caf0ee8 | 2017-03-09 17:28:08 -0800 | [diff] [blame] | 242 | $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" |
Yann Collet | 83fae97 | 2015-10-23 15:21:53 +0100 | [diff] [blame] | 243 | |
Przemyslaw Skibinski | 8a51c69 | 2017-02-21 22:48:04 +0100 | [diff] [blame] | 244 | uasan-%: clean |
Yann Collet | afb0aca | 2017-06-29 18:19:09 -0700 | [diff] [blame^] | 245 | LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* |
Przemyslaw Skibinski | 8a51c69 | 2017-02-21 22:48:04 +0100 | [diff] [blame] | 246 | |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 247 | tsan-%: clean |
Yann Collet | bfc2f00 | 2017-06-21 17:57:14 -0700 | [diff] [blame] | 248 | LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests |
| 249 | |
Przemyslaw Skibinski | 21911ad | 2017-02-22 08:54:56 +0100 | [diff] [blame] | 250 | apt-install: |
| 251 | sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) |
| 252 | |
| 253 | apt-add-repo: |
| 254 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test |
| 255 | sudo apt-get update -y -qq |
| 256 | |
| 257 | ppcinstall: |
| 258 | APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install |
| 259 | |
| 260 | arminstall: |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 261 | APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install |
Przemyslaw Skibinski | 21911ad | 2017-02-22 08:54:56 +0100 | [diff] [blame] | 262 | |
Yann Collet | 27526c7 | 2017-03-01 17:02:49 -0800 | [diff] [blame] | 263 | valgrindinstall: |
Przemyslaw Skibinski | 21911ad | 2017-02-22 08:54:56 +0100 | [diff] [blame] | 264 | APT_PACKAGES="valgrind" $(MAKE) apt-install |
| 265 | |
| 266 | libc6install: |
| 267 | APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install |
| 268 | |
| 269 | gcc6install: apt-add-repo |
| 270 | APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install |
| 271 | |
| 272 | gpp6install: apt-add-repo |
| 273 | APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install |
| 274 | |
Sean Purcell | daec40d | 2017-03-07 12:08:15 -0800 | [diff] [blame] | 275 | clang38install: |
| 276 | APT_PACKAGES="clang-3.8" $(MAKE) apt-install |
| 277 | |
Yann Collet | 4856a00 | 2015-01-24 01:58:16 +0100 | [diff] [blame] | 278 | endif |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 279 | |
| 280 | |
| 281 | ifneq (,$(filter MSYS%,$(shell uname))) |
| 282 | HOST_OS = MSYS |
Milan Ševčík | 0d09c77 | 2017-03-20 15:57:08 +0100 | [diff] [blame] | 283 | CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 284 | endif |
| 285 | |
| 286 | |
| 287 | #------------------------------------------------------------------------ |
| 288 | #make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets |
| 289 | #------------------------------------------------------------------------ |
| 290 | ifneq (,$(filter $(HOST_OS),MSYS POSIX)) |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 291 | cmakebuild: |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 292 | cmake --version |
Yann Collet | 0704df3 | 2016-09-19 16:55:35 +0200 | [diff] [blame] | 293 | $(RM) -r $(BUILDIR)/cmake/build |
| 294 | mkdir $(BUILDIR)/cmake/build |
Milan Ševčík | a8c0c2a | 2017-03-16 22:59:11 +0100 | [diff] [blame] | 295 | cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 296 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 297 | c90build: clean |
| 298 | gcc -v |
Yann Collet | 88ba647 | 2017-02-22 10:52:36 -0800 | [diff] [blame] | 299 | CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 300 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 301 | gnu90build: clean |
| 302 | gcc -v |
Yann Collet | 88ba647 | 2017-02-22 10:52:36 -0800 | [diff] [blame] | 303 | CFLAGS="-std=gnu90" $(MAKE) allmost |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 304 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 305 | c99build: clean |
| 306 | gcc -v |
Yann Collet | a86a09e | 2016-12-22 11:31:39 +0100 | [diff] [blame] | 307 | CFLAGS="-std=c99" $(MAKE) allmost |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 308 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 309 | gnu99build: clean |
| 310 | gcc -v |
Yann Collet | 88ba647 | 2017-02-22 10:52:36 -0800 | [diff] [blame] | 311 | CFLAGS="-std=gnu99" $(MAKE) allmost |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 312 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 313 | c11build: clean |
| 314 | gcc -v |
Yann Collet | a86a09e | 2016-12-22 11:31:39 +0100 | [diff] [blame] | 315 | CFLAGS="-std=c11" $(MAKE) allmost |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 316 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 317 | bmix64build: clean |
| 318 | gcc -v |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 319 | CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 320 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 321 | bmix32build: clean |
| 322 | gcc -v |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 323 | CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 324 | |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 325 | bmi32build: clean |
| 326 | gcc -v |
inikep | 2d5eb2b | 2016-08-18 13:53:26 +0200 | [diff] [blame] | 327 | CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test |
Yann Collet | c35cd5b | 2016-06-30 15:40:28 +0200 | [diff] [blame] | 328 | |
| 329 | staticAnalyze: clean |
Sean Purcell | 3437bf2 | 2017-03-01 16:10:26 -0800 | [diff] [blame] | 330 | gcc -v |
Yann Collet | 677ed26 | 2016-07-10 14:23:30 +0200 | [diff] [blame] | 331 | CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all |
inikep | 13f42d9 | 2016-06-01 14:44:31 +0200 | [diff] [blame] | 332 | endif |