From 130765de719a3ddc475284e13749d09ff371a8e1 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 1 Feb 2019 16:35:20 +0100 Subject: rework build system #1 each benchmark has its own Makefile which must put it's binaries into OBJDIR which is added to the PATH during execution. --- src/benchmarks/falsesharing/Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/benchmarks/falsesharing/Makefile (limited to 'src/benchmarks/falsesharing/Makefile') diff --git a/src/benchmarks/falsesharing/Makefile b/src/benchmarks/falsesharing/Makefile new file mode 100644 index 0000000..7dec230 --- /dev/null +++ b/src/benchmarks/falsesharing/Makefile @@ -0,0 +1,29 @@ +OBJDIR ?= obj + +CXX ?= g++ + +WARNFLAGS ?= -Wall -Wextra +COMMONFLAGS ?= -fno-builtin -fPIC -DPIC -pthread +OPTFLAGS ?= -O3 -DNDEBUG + +CXXFLAGS ?= $(OPTFLAGS) $(WARNFLAGS) $(COMMONFLAGS) + +LDXXFLAGS ?= -pthread -static-libgcc -static-libstdc++ + +HEADER = cpuinfo.h fred.h timer.h + +.PHONY = all clean + +all: $(OBJDIR)/cache-thrash $(OBJDIR)/cache-scratch + +$(OBJDIR)/cache-thrash: cache-thrash.cc $(HEADER) | $(OBJDIR) + $(CXX) $(LDXXFLAGS) $(CXXFLAGS) -o $@ $< + +$(OBJDIR)/cache-scratch: cache-scratch.cc $(HEADER) | $(OBJDIR) + $(CXX) $(LDXXFLAGS) $(CXXFLAGS) -o $@ $< + +$(OBJDIR): + mkdir $@ + +clean: + rm -rf $(OBJDIR) -- cgit v1.2.3