blob: ac3034c9b7bf6b4c6c3212adce30a8eef1f8b5bb [file] [log] [blame]
Yann Collet4856a002015-01-24 01:58:16 +01001# ################################################################
Yann Collet599c69d2016-08-30 13:33:20 -07002# Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
Yann Collet4856a002015-01-24 01:58:16 +01003# All rights reserved.
Yann Collet118bfc42016-05-30 18:50:28 +02004#
Yann Collet599c69d2016-08-30 13:33:20 -07005# 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 Collet4856a002015-01-24 01:58:16 +01008# ################################################################
9
Yann Collet4c9a4c12016-09-19 14:58:14 +020010PRGDIR = programs
11ZSTDDIR = lib
12BUILDIR = build
inikepe9dfdf62016-05-27 11:56:15 +020013ZWRAPDIR = zlibWrapper
inikepa1c81152016-08-18 13:35:36 +020014TESTDIR = tests
Yann Collet4856a002015-01-24 01:58:16 +010015
Yann Collet88fcd292015-11-25 14:42:45 +010016# Define nul output
Yann Collet88fcd292015-11-25 14:42:45 +010017VOID = /dev/null
Przemyslaw Skibinski3a415592016-11-03 12:59:20 +010018
19ifneq (,$(filter Windows%,$(OS)))
20EXT =.exe
21else
22EXT =
Yann Collet88fcd292015-11-25 14:42:45 +010023endif
24
Yann Colletf3f13212016-11-02 17:02:45 -070025.PHONY: default
Yann Collet8b1d0042017-03-05 21:17:32 -080026default: lib-release zstd-release
Yann Collet213089c2015-06-18 07:43:16 -080027
Yann Colletf3f13212016-11-02 17:02:45 -070028.PHONY: all
Yann Collet77575772017-02-22 01:10:43 -080029all: | allmost examples manual
Yann Colleta86a09e2016-12-22 11:31:39 +010030
31.PHONY: allmost
Yann Collet7cedbd12016-12-22 12:43:00 +010032allmost:
33 $(MAKE) -C $(ZSTDDIR) all
34 $(MAKE) -C $(PRGDIR) all
35 $(MAKE) -C $(TESTDIR) all
36 $(MAKE) -C $(ZWRAPDIR) all
37
Sean Purcell3437bf22017-03-01 16:10:26 -080038#skip zwrapper, can't build that on alternate architectures without the proper zlib installed
39.PHONY: allarch
40allarch:
41 $(MAKE) -C $(ZSTDDIR) all
42 $(MAKE) -C $(PRGDIR) all
43 $(MAKE) -C $(TESTDIR) all
44
Yann Collet7cedbd12016-12-22 12:43:00 +010045.PHONY: all32
46all32:
47 $(MAKE) -C $(PRGDIR) zstd32
48 $(MAKE) -C $(TESTDIR) all32
Yann Collet4856a002015-01-24 01:58:16 +010049
Yann Colletf3f13212016-11-02 17:02:45 -070050.PHONY: lib
51lib:
Yann Collet8b1d0042017-03-05 21:17:32 -080052 @$(MAKE) -C $(ZSTDDIR) $@
53
54.PHONY: lib-release
55lib-release:
Yann Collete19111c2016-10-12 11:09:36 -070056 @$(MAKE) -C $(ZSTDDIR)
57
Yann Colletd41380e2016-11-07 14:55:12 -080058.PHONY: zstd
Yann Collet32faf6c2016-07-22 04:45:06 +020059zstd:
Yann Colletd41380e2016-11-07 14:55:12 -080060 @$(MAKE) -C $(PRGDIR) $@
Przemyslaw Skibinski3a415592016-11-03 12:59:20 +010061 cp $(PRGDIR)/zstd$(EXT) .
Yann Collet4856a002015-01-24 01:58:16 +010062
Yann Colletc2a46322017-02-02 20:54:14 -080063.PHONY: zstd-release
64zstd-release:
65 @$(MAKE) -C $(PRGDIR)
66 cp $(PRGDIR)/zstd$(EXT) .
67
Yann Collet563ef8a2017-01-18 12:12:10 -080068.PHONY: zstdmt
69zstdmt:
70 @$(MAKE) -C $(PRGDIR) $@
71 cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT)
72
Yann Colletf3f13212016-11-02 17:02:45 -070073.PHONY: zlibwrapper
inikepe9dfdf62016-05-27 11:56:15 +020074zlibwrapper:
inikep68cd4762016-09-23 12:42:21 +020075 $(MAKE) -C $(ZWRAPDIR) test
inikepe9dfdf62016-05-27 11:56:15 +020076
Yann Collet27526c72017-03-01 17:02:49 -080077.PHONY: shortest
78shortest:
79 $(MAKE) -C $(TESTDIR) $@
80
Yann Colletf3f13212016-11-02 17:02:45 -070081.PHONY: test
Yann Collet6f9c0562016-05-01 10:26:30 +020082test:
inikepa1c81152016-08-18 13:35:36 +020083 $(MAKE) -C $(TESTDIR) $@
Yann Collet6f9c0562016-05-01 10:26:30 +020084
Yann Collet77575772017-02-22 01:10:43 -080085.PHONY: examples
86examples:
87 CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all
88
89.PHONY: manual
90manual:
91 $(MAKE) -C contrib/gen_html $@
92
Yann Collet6851db42017-03-30 12:42:44 -070093.PHONY: cleanTabs
94cleanTabs:
95 cd contrib; ./cleanTabs
96
Yann Colletf3f13212016-11-02 17:02:45 -070097.PHONY: clean
Yann Collet4856a002015-01-24 01:58:16 +010098clean:
Yann Collet88fcd292015-11-25 14:42:45 +010099 @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID)
100 @$(MAKE) -C $(PRGDIR) $@ > $(VOID)
inikepa1c81152016-08-18 13:35:36 +0200101 @$(MAKE) -C $(TESTDIR) $@ > $(VOID)
inikepe9dfdf62016-05-27 11:56:15 +0200102 @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID)
Yann Collet1f57c2e2016-12-21 16:20:11 +0100103 @$(MAKE) -C examples/ $@ > $(VOID)
Yann Collet88ba6472017-02-22 10:52:36 -0800104 @$(MAKE) -C contrib/gen_html $@ > $(VOID)
Yann Collet900f39e2017-01-20 16:36:29 -0800105 @$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
Yann Collet4856a002015-01-24 01:58:16 +0100106 @echo Cleaning completed
107
Yann Collete405c7a2016-10-12 15:29:22 -0700108#------------------------------------------------------------------------------
109# make install is validated only for Linux, OSX, Hurd and some BSD targets
110#------------------------------------------------------------------------------
cyan49738bcbf422017-06-04 23:52:00 -0700111ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT))
Yann Colletb402f1e2017-04-18 14:34:24 -0700112
inikep13f42d92016-06-01 14:44:31 +0200113HOST_OS = POSIX
Milan Ševčíkf49f7602017-04-19 19:25:53 +0200114CMAKE_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 Colletf3f13212016-11-02 17:02:45 -0700115
Yann Colletb402f1e2017-04-18 14:34:24 -0700116.PHONY: list
117list:
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 Colletafb0aca2017-06-29 18:19:09 -0700120.PHONY: install clangtest gpptest armtest usan asan uasan
Yann Collet4856a002015-01-24 01:58:16 +0100121install:
Yann Collete19111c2016-10-12 11:09:36 -0700122 @$(MAKE) -C $(ZSTDDIR) $@
123 @$(MAKE) -C $(PRGDIR) $@
Yann Collet4856a002015-01-24 01:58:16 +0100124
Yann Colletafb0aca2017-06-29 18:19:09 -0700125.PHONY: uninstall
Yann Collet4856a002015-01-24 01:58:16 +0100126uninstall:
Yann Collete19111c2016-10-12 11:09:36 -0700127 @$(MAKE) -C $(ZSTDDIR) $@
128 @$(MAKE) -C $(PRGDIR) $@
Yann Collet4856a002015-01-24 01:58:16 +0100129
Yann Colletafb0aca2017-06-29 18:19:09 -0700130.PHONY: travis-install
Yann Collet4856a002015-01-24 01:58:16 +0100131travis-install:
Yann Colletc620b482015-12-01 01:56:02 +0100132 $(MAKE) install PREFIX=~/install_test_dir
Yann Collet4856a002015-01-24 01:58:16 +0100133
Yann Colletafb0aca2017-06-29 18:19:09 -0700134.PHONY: gppbuild
Sean Purcell3437bf22017-03-01 16:10:26 -0800135gppbuild: clean
136 g++ -v
Yann Collet5eb749e2017-01-11 18:21:25 +0100137 CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
Yann Collet3e5b73b2016-01-10 20:46:20 +0100138
Yann Colletafb0aca2017-06-29 18:19:09 -0700139.PHONY: gcc5build
Sean Purcell3437bf22017-03-01 16:10:26 -0800140gcc5build: clean
141 gcc-5 -v
142 CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror"
143
Yann Colletafb0aca2017-06-29 18:19:09 -0700144.PHONY: gcc6build
Sean Purcell3437bf22017-03-01 16:10:26 -0800145gcc6build: clean
146 gcc-6 -v
147 CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror"
148
Yann Colletafb0aca2017-06-29 18:19:09 -0700149.PHONY: clangbuild
Sean Purcell3437bf22017-03-01 16:10:26 -0800150clangbuild: clean
151 clang -v
152 CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
153
154m32build: clean
155 gcc -v
156 $(MAKE) all32
157
158armbuild: clean
159 CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch
160
161aarch64build: clean
162 CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch
163
164ppcbuild: clean
165 CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch
166
167ppc64build: clean
168 CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch
169
Sean Purcelldaec40d2017-03-07 12:08:15 -0800170armfuzz: clean
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700171 CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
Sean Purcelldaec40d2017-03-07 12:08:15 -0800172
173aarch64fuzz: clean
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700174 CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
Sean Purcelldaec40d2017-03-07 12:08:15 -0800175
176ppcfuzz: clean
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700177 CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
Sean Purcelldaec40d2017-03-07 12:08:15 -0800178
179ppc64fuzz: clean
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700180 CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest
Sean Purcelldaec40d2017-03-07 12:08:15 -0800181
Sean Purcell3437bf22017-03-01 16:10:26 -0800182gpptest: clean
183 CC=g++ $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
184
inikepc9bb1022016-06-21 18:04:13 +0200185gcc5test: clean
186 gcc-5 -v
187 $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror"
188
189gcc6test: clean
190 gcc-6 -v
191 $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror"
192
Yann Collet213089c2015-06-18 07:43:16 -0800193clangtest: clean
Yann Colletf4ce8912015-08-11 14:18:45 +0100194 clang -v
Sean Purcell3437bf22017-03-01 16:10:26 -0800195 $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation"
Yann Collet213089c2015-06-18 07:43:16 -0800196
Yann Collet7083b8a2015-07-06 23:58:59 -0800197armtest: clean
inikep2d5eb2b2016-08-18 13:53:26 +0200198 $(MAKE) -C $(TESTDIR) datagen # use native, faster
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700199 $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
Przemyslaw Skibinskie579ab52016-11-14 12:57:05 +0100200
201aarch64test:
202 $(MAKE) -C $(TESTDIR) datagen # use native, faster
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700203 $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests
Yann Collet521b0102016-02-08 01:27:59 +0100204
Yann Collet521b0102016-02-08 01:27:59 +0100205ppctest: clean
inikep2d5eb2b2016-08-18 13:53:26 +0200206 $(MAKE) -C $(TESTDIR) datagen # use native, faster
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700207 $(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 Collet521b0102016-02-08 01:27:59 +0100208
inikep1981d5a2016-05-30 10:18:56 +0200209ppc64test: clean
inikep2d5eb2b2016-08-18 13:53:26 +0200210 $(MAKE) -C $(TESTDIR) datagen # use native, faster
Sean Purcell0b0b10e2017-03-20 11:32:24 -0700211 $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests
inikep1981d5a2016-05-30 10:18:56 +0200212
Przemyslaw Skibinskid41c0482017-02-22 11:07:28 +0100213arm-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 Purcellcaf0ee82017-03-09 17:28:08 -0800219# 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 Collet83fae972015-10-23 15:21:53 +0100223usan: clean
Sean Purcellcaf0ee82017-03-09 17:28:08 -0800224 $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined"
Yann Collet213089c2015-06-18 07:43:16 -0800225
Yann Collet83fae972015-10-23 15:21:53 +0100226asan: clean
227 $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address"
228
Sean Purcellcaf0ee82017-03-09 17:28:08 -0800229asan-%: clean
230 LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $*
231
Yann Colletd9967432016-05-18 14:16:49 +0200232msan: clean
Nick Terrellc2edb782017-06-26 18:57:04 -0700233 $(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 Colletd9967432016-05-18 14:16:49 +0200234
Sean Purcelldaec40d2017-03-07 12:08:15 -0800235msan-%: clean
Yann Colletafb0aca2017-06-29 18:19:09 -0700236 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 Purcelldaec40d2017-03-07 12:08:15 -0800237
Yann Collet6c3e2e72015-12-11 10:44:07 +0100238asan32: clean
inikep2d5eb2b2016-08-18 13:53:26 +0200239 $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address"
Yann Collet6c3e2e72015-12-11 10:44:07 +0100240
Yann Collet83fae972015-10-23 15:21:53 +0100241uasan: clean
Sean Purcellcaf0ee82017-03-09 17:28:08 -0800242 $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined"
Yann Collet83fae972015-10-23 15:21:53 +0100243
Przemyslaw Skibinski8a51c692017-02-21 22:48:04 +0100244uasan-%: clean
Yann Colletafb0aca2017-06-29 18:19:09 -0700245 LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $*
Przemyslaw Skibinski8a51c692017-02-21 22:48:04 +0100246
Sean Purcelldaec40d2017-03-07 12:08:15 -0800247tsan-%: clean
Yann Colletbfc2f002017-06-21 17:57:14 -0700248 LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests
249
Przemyslaw Skibinski21911ad2017-02-22 08:54:56 +0100250apt-install:
251 sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES)
252
253apt-add-repo:
254 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
255 sudo apt-get update -y -qq
256
257ppcinstall:
258 APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install
259
260arminstall:
Sean Purcelldaec40d2017-03-07 12:08:15 -0800261 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 Skibinski21911ad2017-02-22 08:54:56 +0100262
Yann Collet27526c72017-03-01 17:02:49 -0800263valgrindinstall:
Przemyslaw Skibinski21911ad2017-02-22 08:54:56 +0100264 APT_PACKAGES="valgrind" $(MAKE) apt-install
265
266libc6install:
267 APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install
268
269gcc6install: apt-add-repo
270 APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install
271
272gpp6install: apt-add-repo
273 APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install
274
Sean Purcelldaec40d2017-03-07 12:08:15 -0800275clang38install:
276 APT_PACKAGES="clang-3.8" $(MAKE) apt-install
277
Yann Collet4856a002015-01-24 01:58:16 +0100278endif
inikep13f42d92016-06-01 14:44:31 +0200279
280
281ifneq (,$(filter MSYS%,$(shell uname)))
282HOST_OS = MSYS
Milan Ševčík0d09c772017-03-20 15:57:08 +0100283CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON
inikep13f42d92016-06-01 14:44:31 +0200284endif
285
286
287#------------------------------------------------------------------------
288#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets
289#------------------------------------------------------------------------
290ifneq (,$(filter $(HOST_OS),MSYS POSIX))
Sean Purcell3437bf22017-03-01 16:10:26 -0800291cmakebuild:
inikep13f42d92016-06-01 14:44:31 +0200292 cmake --version
Yann Collet0704df32016-09-19 16:55:35 +0200293 $(RM) -r $(BUILDIR)/cmake/build
294 mkdir $(BUILDIR)/cmake/build
Milan Ševčíka8c0c2a2017-03-16 22:59:11 +0100295 cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall
inikep13f42d92016-06-01 14:44:31 +0200296
Sean Purcell3437bf22017-03-01 16:10:26 -0800297c90build: clean
298 gcc -v
Yann Collet88ba6472017-02-22 10:52:36 -0800299 CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long`
inikep13f42d92016-06-01 14:44:31 +0200300
Sean Purcell3437bf22017-03-01 16:10:26 -0800301gnu90build: clean
302 gcc -v
Yann Collet88ba6472017-02-22 10:52:36 -0800303 CFLAGS="-std=gnu90" $(MAKE) allmost
inikep13f42d92016-06-01 14:44:31 +0200304
Sean Purcell3437bf22017-03-01 16:10:26 -0800305c99build: clean
306 gcc -v
Yann Colleta86a09e2016-12-22 11:31:39 +0100307 CFLAGS="-std=c99" $(MAKE) allmost
inikep13f42d92016-06-01 14:44:31 +0200308
Sean Purcell3437bf22017-03-01 16:10:26 -0800309gnu99build: clean
310 gcc -v
Yann Collet88ba6472017-02-22 10:52:36 -0800311 CFLAGS="-std=gnu99" $(MAKE) allmost
inikep13f42d92016-06-01 14:44:31 +0200312
Sean Purcell3437bf22017-03-01 16:10:26 -0800313c11build: clean
314 gcc -v
Yann Colleta86a09e2016-12-22 11:31:39 +0100315 CFLAGS="-std=c11" $(MAKE) allmost
inikep13f42d92016-06-01 14:44:31 +0200316
Sean Purcell3437bf22017-03-01 16:10:26 -0800317bmix64build: clean
318 gcc -v
inikep2d5eb2b2016-08-18 13:53:26 +0200319 CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test
inikep13f42d92016-06-01 14:44:31 +0200320
Sean Purcell3437bf22017-03-01 16:10:26 -0800321bmix32build: clean
322 gcc -v
inikep2d5eb2b2016-08-18 13:53:26 +0200323 CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test
inikep13f42d92016-06-01 14:44:31 +0200324
Sean Purcell3437bf22017-03-01 16:10:26 -0800325bmi32build: clean
326 gcc -v
inikep2d5eb2b2016-08-18 13:53:26 +0200327 CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test
Yann Colletc35cd5b2016-06-30 15:40:28 +0200328
329staticAnalyze: clean
Sean Purcell3437bf22017-03-01 16:10:26 -0800330 gcc -v
Yann Collet677ed262016-07-10 14:23:30 +0200331 CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all
inikep13f42d92016-06-01 14:44:31 +0200332endif