aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks/falsesharing/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmarks/falsesharing/Makefile')
-rw-r--r--src/benchmarks/falsesharing/Makefile29
1 files changed, 29 insertions, 0 deletions
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)