aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-02-01 16:35:20 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-02-01 16:35:20 +0100
commit130765de719a3ddc475284e13749d09ff371a8e1 (patch)
treec45ea8d47e53481022d641336ec2abd5cb588111 /src/Makefile
parent8221b8fb0e9ee491590932cd228f17b48155c0f7 (diff)
downloadallocbench-130765de719a3ddc475284e13749d09ff371a8e1.tar.gz
allocbench-130765de719a3ddc475284e13749d09ff371a8e1.zip
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.
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..6b7b704
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,27 @@
+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)/print_status_on_exit.so $(OBJDIR)/chattymalloc.so
+
+$(OBJDIR)/print_status_on_exit.so: print_status_on_exit.c | $(OBJDIR)
+ $(CC) $(LDFLAGS) -shared $(CFLAGS) -o $@ $<
+
+$(OBJDIR)/chattymalloc.so: chattymalloc.c | $(OBJDIR)
+ $(CC) $(LDFLAGS) -shared $(CFLAGS) -o $@ $<
+
+$(OBJDIR):
+ mkdir $@
+
+clean:
+ rm -rf $(OBJDIR)