1 # ################################################################
2 # Copyright (c) 2017-present, 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 # This Makefile presumes libzstd is built, using `make` in / or /lib/
12 ZSTDLIB_PATH
= ..
/..
/..
/lib
13 ZSTDLIB_NAME
= libzstd.a
14 ZSTDLIB
= $(ZSTDLIB_PATH
)/$(ZSTDLIB_NAME
)
16 CPPFLAGS
+= -I..
/ -I..
/..
/..
/lib
-I..
/..
/..
/lib
/common
21 SEEKABLE_OBJS
= ..
/zstdseek_compress.c ..
/zstdseek_decompress.c
$(ZSTDLIB
)
23 .PHONY
: default
all clean test
27 all: seekable_compression seekable_decompression parallel_processing
30 make
-C
$(ZSTDLIB_PATH
) $(ZSTDLIB_NAME
)
32 seekable_compression
: seekable_compression.c
$(SEEKABLE_OBJS
)
33 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
$(LDFLAGS
) -o
$@
35 seekable_decompression
: seekable_decompression.c
$(SEEKABLE_OBJS
)
36 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
$(LDFLAGS
) -o
$@
38 parallel_processing
: parallel_processing.c
$(SEEKABLE_OBJS
)
39 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
$(LDFLAGS
) -o
$@
-pthread
41 parallel_compression
: parallel_compression.c
$(SEEKABLE_OBJS
)
42 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $^
$(LDFLAGS
) -o
$@
-pthread
45 @
rm -f core
*.o tmp
* result
* *.zst \
46 seekable_compression seekable_decompression \
47 parallel_processing parallel_compression
48 @echo Cleaning completed