-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
47 lines (32 loc) · 909 Bytes
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
CFLAGS := -Wall -g -O2 -std=gnu99
SRCS := \
src/libsam3/libsam3.c \
src/libsam3a/libsam3a.c
TESTS := \
src/ext/tinytest.c \
test/test.c \
test/libsam3/test_b32.c
LIB_OBJS := ${SRCS:.c=.o}
TEST_OBJS := ${TESTS:.c=.o}
OBJS := ${LIB_OBJS} ${TEST_OBJS}
LIB := libsam3.a
all: build check
check: libsam3-tests
./libsam3-tests
build: ${LIB}
${LIB}: ${LIB_OBJS}
${AR} -sr ${LIB} ${LIB_OBJS}
libsam3-tests: ${TEST_OBJS} ${LIB}
${CC} $^ -o $@
clean:
rm -f libsam3-tests ${LIB} ${OBJS} examples/sam3/samtest
# TODO: this does not work yet because I don't know how to do it.
boost:
gcc -Werror -Wall -Wextra -Wno-unused-parameter -std=c++11 -g -lboost_system -lboost_thread -lpthread examples/boost/boost.cpp -o boost
%.o: %.c Makefile
${CC} ${CFLAGS} $(LDFLAGS) -c $< -o $@
fmt:
find . -name '*.c' -exec clang-format -i {} \;
find . -name '*.h' -exec clang-format -i {} \;
info:
@echo $(AR)