]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tests/regression/Makefile
import zstd 1.3.8
[FreeBSD/FreeBSD.git] / tests / regression / Makefile
1 # ################################################################
2 # Copyright (c) 2015-present, Facebook, Inc.
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).
8 # ################################################################
9
10 CFLAGS ?= -O3
11
12 CURL_CFLAGS := $(shell curl-config --cflags)
13 CURL_LDFLAGS := $(shell curl-config --libs) -pthread
14
15 PROGDIR := ../../programs
16 LIBDIR := ../../lib
17 ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common
18
19 REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS)
20 REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS)
21 REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS)
22
23 all: test
24
25 xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h
26         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
27
28 util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h
29         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
30
31 data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h
32         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
33
34 config.o: config.c config.h levels.h
35         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
36
37 method.h: data.h config.h result.h
38
39 method.o: method.c method.h
40         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
41
42 result.o: result.c result.h
43         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
44
45 test.o: test.c data.h config.h method.h
46         $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
47
48 libzstd.a:
49         $(MAKE) -C $(LIBDIR) libzstd.a-mt
50         cp $(LIBDIR)/libzstd.a .
51
52 test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a
53         $(CC) $^ $(REGRESSION_LDFLAGS) -o $@
54
55 .PHONY: clean
56 clean:
57         $(MAKE) -C $(LIBDIR) clean
58         $(RM) *.o *.a test