2
0

Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # ################################################################
  2. # Copyright (c) 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. # You may select, at your option, one of the above-listed licenses.
  9. # ################################################################
  10. CFLAGS ?= -O3
  11. CURL_CFLAGS := $(shell curl-config --cflags)
  12. CURL_LDFLAGS := $(shell curl-config --libs) -pthread
  13. PROGDIR := ../../programs
  14. LIBDIR := ../../lib
  15. ZSTD_CPPFLAGS := -I$(PROGDIR) -I$(LIBDIR) -I$(LIBDIR)/common -Wno-deprecated-declarations
  16. REGRESSION_CFLAGS = $(CFLAGS) $(CURL_CFLAGS)
  17. REGRESSION_CPPFLAGS = $(CPPFLAGS) $(ZSTD_CPPFLAGS)
  18. REGRESSION_LDFLAGS = $(LDFLAGS) $(CURL_LDFLAGS)
  19. all: test
  20. xxhash.o: $(LIBDIR)/common/xxhash.c $(LIBDIR)/common/xxhash.h
  21. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  22. util.o: $(PROGDIR)/util.c $(PROGDIR)/util.h
  23. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  24. data.o: data.c data.h $(PROGDIR)/util.h $(LIBDIR)/common/xxhash.h
  25. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  26. config.o: config.c config.h levels.h
  27. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  28. method.h: data.h config.h result.h
  29. method.o: method.c method.h
  30. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  31. result.o: result.c result.h
  32. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  33. test.o: test.c data.h config.h method.h
  34. $(CC) $(REGRESSION_CFLAGS) $(REGRESSION_CPPFLAGS) $< -c -o $@
  35. .PHONY: libzstd.a
  36. libzstd.a:
  37. $(MAKE) -C $(LIBDIR) libzstd.a-mt
  38. cp $(LIBDIR)/libzstd.a .
  39. test: test.o data.o config.o util.o method.o result.o xxhash.o libzstd.a
  40. $(CC) $^ $(REGRESSION_LDFLAGS) -o $@
  41. .PHONY: clean
  42. clean:
  43. $(MAKE) -C $(LIBDIR) clean
  44. $(RM) *.o *.a test