git subrepo pull (merge) --force deps/libchdr
[pcsx_rearmed.git] / deps / libchdr / deps / zstd-1.5.5 / tests / regression / Makefile
CommitLineData
648db22b 1# ################################################################
2# Copyright (c) Meta Platforms, Inc. and affiliates.
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# You may select, at your option, one of the above-listed licenses.
9# ################################################################
10
11CFLAGS ?= -O3
12
13CURL_CFLAGS := $(shell curl-config --cflags)
14CURL_LDFLAGS := $(shell curl-config --libs) -pthread
15
16PROGDIR := ../../programs
17LIBDIR := ../../lib
18ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common -Wno-deprecated-declarations
19
20REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS)
21REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS)
22REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS)
23
24all: test
25
26xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h
27 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
28
29util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h
30 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
31
32data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h
33 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
34
35config.o: config.c config.h levels.h
36 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
37
38method.h: data.h config.h result.h
39
40method.o: method.c method.h
41 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
42
43result.o: result.c result.h
44 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
45
46test.o: test.c data.h config.h method.h
47 $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
48
49.PHONY: libzstd.a
50libzstd.a:
51 $(MAKE) -C $(LIBDIR) libzstd.a-mt
52 cp $(LIBDIR)/libzstd.a .
53
54test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a
55 $(CC) $^ $(REGRESSION_LDFLAGS) -o $@
56
57.PHONY: clean
58clean:
59 $(MAKE) -C $(LIBDIR) clean
60 $(RM) *.o *.a test