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/loop/Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/benchmarks/loop/Makefile (limited to 'src/benchmarks/loop/Makefile') diff --git a/src/benchmarks/loop/Makefile b/src/benchmarks/loop/Makefile new file mode 100644 index 0000000..89914b2 --- /dev/null +++ b/src/benchmarks/loop/Makefile @@ -0,0 +1,24 @@ +OBJDIR ?= obj + +CC ?= gcc + +WARNFLAGS ?= -Wall -Wextra +COMMONFLAGS ?= -fno-builtin -fPIC -DPIC -pthread +OPTFLAGS ?= -O3 -DNDEBUG + +CFLAGS ?= $(OPTFLAGS) $(WARNFLAGS) $(COMMONFLAGS) + +LDFLAGS ?= -pthread -static-libgcc + +.PHONY = all clean + +all: $(OBJDIR)/loop + +$(OBJDIR)/loop: loop.c | $(OBJDIR) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $< + +$(OBJDIR): + mkdir $@ + +clean: + rm -rf $(OBJDIR) -- cgit v1.2.3