1 # ################################################################
2 # Copyright (c) 2015-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 # ################################################################
12 CURL_CFLAGS := $(shell curl-config --cflags)
13 CURL_LDFLAGS := $(shell curl-config --libs) -pthread
15 PROGDIR := ../../programs
17 ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common
19 REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS)
20 REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS)
21 REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS)
25 xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h
26 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
28 util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h
29 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
31 data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h
32 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
34 config.o: config.c config.h levels.h
35 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
37 method.h: data.h config.h result.h
39 method.o: method.c method.h
40 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
42 result.o: result.c result.h
43 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
45 test.o: test.c data.h config.h method.h
46 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
49 $(MAKE) -C $(LIBDIR) libzstd.a-mt
50 cp $(LIBDIR)/libzstd.a .
52 test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a
53 $(CC) $^ $(REGRESSION_LDFLAGS) -o $@
57 $(MAKE) -C $(LIBDIR) clean