1 # ################################################################
3 # Copyright (C) Yann Collet 2011-2015
7 # Redistribution and use in source and binary forms, with or without modification,
8 # are permitted provided that the following conditions are met:
10 # * Redistributions of source code must retain the above copyright notice, this
11 # list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright notice, this
14 # list of conditions and the following disclaimer in the documentation and/or
15 # other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 # You can contact the author at :
29 # - LZ4 source repository : https://github.com/Cyan4973/lz4
30 # - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c
31 # ################################################################
35 export RELEASE
=r
$(VERSION
)
40 LIBDIR ?
= $(PREFIX
)/lib
41 INCLUDEDIR
=$(PREFIX
)/include
47 ifneq (,$(filter Windows
%,$(OS
)))
54 .PHONY
: default
all lib lz4programs
clean test versionsTest examples
61 @
$(MAKE
) -C
$(LZ4DIR
) all
67 @
$(MAKE
) -C
$(PRGDIR
) $@
> $(VOID
)
68 @
$(MAKE
) -C
$(LZ4DIR
) $@
> $(VOID
)
69 @
$(MAKE
) -C examples
$@
> $(VOID
)
70 @
$(MAKE
) -C versionsTest
$@
> $(VOID
)
71 @echo Cleaning completed
74 #------------------------------------------------------------------------
75 #make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
76 ifneq (,$(filter $(shell uname
),Linux Darwin GNU
/kFreeBSD GNU
))
79 @
$(MAKE
) -C
$(LZ4DIR
) $@
80 @
$(MAKE
) -C
$(PRGDIR
) $@
83 @
$(MAKE
) -C
$(LZ4DIR
) $@
84 @
$(MAKE
) -C
$(PRGDIR
) $@
90 $(MAKE
) -C
$(PRGDIR
) test
93 @cd cmake_unofficial
; cmake CMakeLists.txt
; $(MAKE
)
96 $(MAKE
) all CC
=g
++ CFLAGS
="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror"
99 CFLAGS
="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE
) all CC
=clang
102 CFLAGS
="-O3 -g -fsanitize=undefined" $(MAKE
) test CC
=clang FUZZER_TIME
="-T1mn" NB_LOOPS
=-i1
105 CFLAGS
=-g scan-build
--status-bugs
-v
$(MAKE
) all
108 CFLAGS
="-O3 -Werror" $(MAKE
) -C
$(LZ4DIR
) all CC
=arm-linux-gnueabi-gcc
109 CFLAGS
="-O3 -Werror" $(MAKE
) -C
$(PRGDIR
) bins CC
=arm-linux-gnueabi-gcc
112 $(MAKE
) -C versionsTest
116 $(MAKE
) -C
$(PRGDIR
) lz4
117 $(MAKE
) -C examples
test