1 1.1 christos # ################################################################ 2 1.1 christos # Copyright (c) Meta Platforms, Inc. and affiliates. 3 1.1 christos # All rights reserved. 4 1.1 christos # 5 1.1 christos # This source code is licensed under both the BSD-style license (found in the 6 1.1 christos # LICENSE file in the root directory of this source tree) and the GPLv2 (found 7 1.1 christos # in the COPYING file in the root directory of this source tree). 8 1.1 christos # You may select, at your option, one of the above-listed licenses. 9 1.1 christos # ################################################################ 10 1.1 christos 11 1.1 christos CFLAGS ?= -O3 12 1.1 christos 13 1.1 christos CURL_CFLAGS := $(shell curl-config --cflags) 14 1.1 christos CURL_LDFLAGS := $(shell curl-config --libs) -pthread 15 1.1 christos 16 1.1 christos PROGDIR := ../../programs 17 1.1 christos LIBDIR := ../../lib 18 1.1 christos ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common -Wno-deprecated-declarations 19 1.1 christos 20 1.1 christos REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS) 21 1.1 christos REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS) 22 1.1 christos REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS) 23 1.1 christos 24 1.1 christos all: test 25 1.1 christos 26 1.1 christos xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h 27 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 28 1.1 christos 29 1.1 christos util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h 30 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 31 1.1 christos 32 1.1 christos data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h 33 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 34 1.1 christos 35 1.1 christos config.o: config.c config.h levels.h 36 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 37 1.1 christos 38 1.1 christos method.h: data.h config.h result.h 39 1.1 christos 40 1.1 christos method.o: method.c method.h 41 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 42 1.1 christos 43 1.1 christos result.o: result.c result.h 44 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 45 1.1 christos 46 1.1 christos test.o: test.c data.h config.h method.h 47 1.1 christos $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@ 48 1.1 christos 49 1.1 christos .PHONY: libzstd.a 50 1.1 christos libzstd.a: 51 1.1 christos $(MAKE) -C $(LIBDIR) libzstd.a-mt 52 1.1 christos cp $(LIBDIR)/libzstd.a . 53 1.1 christos 54 1.1 christos test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a 55 1.1 christos $(CC) $^ $(REGRESSION_LDFLAGS) -o $@ 56 1.1 christos 57 1.1 christos .PHONY: clean 58 1.1 christos clean: 59 1.1 christos $(MAKE) -C $(LIBDIR) clean 60 1.1 christos $(RM) *.o *.a test 61