1 # ################################################################
2 # Copyright (c) 2018-present, Yann Collet, Facebook, Inc.
5 # This source code is licensed under both the BSD-style license (found in the
6 # LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 # in the COPYING file in the root directory of this source tree).
8 # ################################################################
10 PROGDIR
= ..
/..
/programs
13 LIBZSTD
= $(LIBDIR
)/libzstd.a
15 CPPFLAGS
+= -I
$(LIBDIR
) -I
$(LIBDIR
)/common
-I
$(LIBDIR
)/dictBuilder
-I
$(PROGDIR
)
19 DEBUGFLAGS
= -Wall
-Wextra
-Wcast-qual
-Wcast-align
-Wshadow \
20 -Wstrict-aliasing
=1 -Wswitch-enum \
21 -Wstrict-prototypes
-Wundef
-Wpointer-arith \
22 -Wvla
-Wformat
=2 -Winit-self
-Wfloat-equal
-Wwrite-strings \
24 CFLAGS
+= $(DEBUGFLAGS
) $(MOREFLAGS
)
31 largeNbDicts
: util.o timefn.o benchfn.o datagen.o xxhash.o largeNbDicts.c
$(LIBZSTD
)
32 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
$(LDFLAGS
) -o
$@
36 $(MAKE
) -C
$(LIBDIR
) libzstd.a CFLAGS
="$(CFLAGS)"
38 benchfn.o
: $(PROGDIR
)/benchfn.c
39 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
-c
41 timefn.o
: $(PROGDIR
)/timefn.c
42 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
-c
44 datagen.o
: $(PROGDIR
)/datagen.c
45 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
-c
47 util.o
: $(PROGDIR
)/util.c
48 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
-c
51 xxhash.o
: $(LIBDIR
)/common
/xxhash.c
52 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
-c
57 $(MAKE
) -C
$(LIBDIR
) clean > /dev
/null