]>
Commit | Line | Data |
---|---|---|
9f95a23c | 1 | # ################################################################ |
f67539c2 | 2 | # Copyright (c) 2015-2020, Facebook, Inc. |
9f95a23c TL |
3 | # All rights reserved. |
4 | # | |
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). | |
f67539c2 | 8 | # You may select, at your option, one of the above-listed licenses. |
9f95a23c TL |
9 | # ################################################################ |
10 | ||
11 | CFLAGS ?= -O3 | |
12 | ||
13 | CURL_CFLAGS := $(shell curl-config --cflags) | |
14 | CURL_LDFLAGS := $(shell curl-config --libs) -pthread | |
15 | ||
16 | PROGDIR := ../../programs | |
17 | LIBDIR := ../../lib | |
18 | ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common | |
19 | ||
20 | REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS) | |
21 | REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS) | |
22 | REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS) | |
23 | ||
24 | all: test | |
25 | ||
26 | xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h | |
27 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
28 | ||
29 | util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h | |
30 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
31 | ||
32 | data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h | |
33 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
34 | ||
35 | config.o: config.c config.h levels.h | |
36 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
37 | ||
38 | method.h: data.h config.h result.h | |
39 | ||
40 | method.o: method.c method.h | |
41 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
42 | ||
43 | result.o: result.c result.h | |
44 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
45 | ||
46 | test.o: test.c data.h config.h method.h | |
47 | $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ | |
48 | ||
49 | libzstd.a: | |
50 | $(MAKE) -C $(LIBDIR) libzstd.a-mt | |
51 | cp $(LIBDIR)/libzstd.a . | |
52 | ||
53 | test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a | |
54 | $(CC) $^ $(REGRESSION_LDFLAGS) -o $@ | |
55 | ||
56 | .PHONY: clean | |
57 | clean: | |
58 | $(MAKE) -C $(LIBDIR) clean | |
59 | $(RM) *.o *.a test |