summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2018-12-04 12:10:35 +0100
committerAnton Khirnov <anton@khirnov.net>2018-12-04 12:10:35 +0100
commit153529400c2267c796bfc720ec7e8bfcddd98f43 (patch)
treead71806ba98d82cc86d8241410bf1f43f63074d6 /Makefile
Initial commit.HEADmaster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d2c4b7d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+CFLAGS = -std=c11 -D_XOPEN_SOURCE=700 -fPIC -g -O3 -Wall -fsanitize=thread
+LIBS=-lm
+LDFLAGS = -Wl,--version-script=libthreadpool.v -shared -pthread $(LIBS) -fsanitize=thread
+CC = cc
+
+TARGET = libthreadpool.so
+
+OBJECTS = \
+ threadpool.o \
+ worker.o \
+
+all: $(TARGET)
+
+$(TARGET): $(OBJECTS)
+ $(CC) ${LDFLAGS} -o $@ $(OBJECTS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -MMD -MF $(@:.o=.d) -MT $@ -c -o $@ $<
+
+clean:
+ -rm -f $(OBJECTS) $(TARGET)
+
+-include $(OBJECTS:.o=.d)
+
+.PHONY: clean