-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 860 Bytes
/
Makefile
File metadata and controls
35 lines (24 loc) · 860 Bytes
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
26
27
28
29
30
31
32
33
34
35
CC=gcc
CPPFLAGS=
CFLAGS=-ansi -Wall -Wextra -Wpedantic -Wshadow -ggdb3
LDLIBS=
#-------------------------------------------------------------------------------
.PHONY: all benchmark test clean
all: libpool-example.out
benchmark: benchmark.out
./benchmark.sh
test: libpool-test.out libpool-test-mt.out
./libpool-test.out
./libpool-test-mt.out
clean:
rm -rf obj/*
rm -f libpool-example.out libpool-test.out libpool-test-mt.out benchmark.out
#-------------------------------------------------------------------------------
obj/%.c.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.out: obj/examples/%.c.o obj/src/libpool.c.o
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDLIBS)
libpool-test-mt.out: examples/libpool-test-mt.c src/libpool.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBPOOL_THREAD_SAFE -o $@ $^ -lpthread