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 # ################################################################ 9 1.1 christos 10 1.1 christos PROGDIR = ../../programs 11 1.1 christos LIBDIR = ../../lib 12 1.1 christos 13 1.1 christos LIBZSTD = $(LIBDIR)/libzstd.a 14 1.1 christos 15 1.1 christos CPPFLAGS+= -I$(LIBDIR) -I$(LIBDIR)/common -I$(LIBDIR)/dictBuilder -I$(PROGDIR) 16 1.1 christos 17 1.1 christos CFLAGS ?= -O3 -g 18 1.1 christos CFLAGS += -std=gnu99 19 1.1 christos DEBUGFLAGS= -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ 20 1.1 christos -Wstrict-aliasing=1 -Wswitch-enum \ 21 1.1 christos -Wstrict-prototypes -Wundef -Wpointer-arith \ 22 1.1 christos -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \ 23 1.1 christos -Wredundant-decls 24 1.1 christos CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS) 25 1.1 christos 26 1.1 christos 27 1.1 christos default: seqBench 28 1.1 christos 29 1.1 christos all : seqBench 30 1.1 christos 31 1.1 christos seqBench: util.o timefn.o benchfn.o datagen.o xxhash.o seqBench.c $(LIBZSTD) 32 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ 33 1.1 christos 34 1.1 christos .PHONY: $(LIBZSTD) 35 1.1 christos $(LIBZSTD): 36 1.1 christos $(MAKE) -C $(LIBDIR) libzstd.a CFLAGS="$(CFLAGS)" 37 1.1 christos 38 1.1 christos benchfn.o: $(PROGDIR)/benchfn.c 39 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c 40 1.1 christos 41 1.1 christos timefn.o: $(PROGDIR)/timefn.c 42 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c 43 1.1 christos 44 1.1 christos datagen.o: $(PROGDIR)/datagen.c 45 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c 46 1.1 christos 47 1.1 christos util.o: $(PROGDIR)/util.c 48 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c 49 1.1 christos 50 1.1 christos 51 1.1 christos xxhash.o : $(LIBDIR)/common/xxhash.c 52 1.1 christos $(CC) $(CPPFLAGS) $(CFLAGS) $^ -c 53 1.1 christos 54 1.1 christos 55 1.1 christos clean: 56 1.1 christos $(RM) *.o 57 1.1 christos $(MAKE) -C $(LIBDIR) clean > /dev/null 58 1.1 christos $(RM) seqBench 59