1 # ################################################################
2 # Copyright (c) Meta Platforms, Inc. and affiliates.
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 # You may select, at your option, one of the above-listed licenses.
9 # ################################################################
13 CURL_CFLAGS := $(shell curl-config --cflags)
14 CURL_LDFLAGS := $(shell curl-config --libs) -pthread
16 PROGDIR := ../../programs
18 ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common -Wno-deprecated-declarations
20 REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS)
21 REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS)
22 REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS)
26 xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h
27 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
29 util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h
30 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
32 data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h
33 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
35 config.o: config.c config.h levels.h
36 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
38 method.h: data.h config.h result.h
40 method.o: method.c method.h
41 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
43 result.o: result.c result.h
44 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
46 test.o: test.c data.h config.h method.h
47 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
51 $(MAKE) -C $(LIBDIR) libzstd.a-mt
52 cp $(LIBDIR)/libzstd.a .
54 test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a
55 $(CC) $^ $(REGRESSION_LDFLAGS) -o $@
59 $(MAKE) -C $(LIBDIR) clean