summaryrefslogtreecommitdiff
path: root/Makefile
blob: d2c4b7d243df0a2a3e2e0646e529462e72d462d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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