-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
93 lines (69 loc) · 2.3 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
CC = gcc
CXX = g++
LANGFLAG = -x c++
CPPFLAGS += -I slow5lib/include/
CFLAGS += -g -Wall -O2 -std=c99
LDFLAGS += $(LIBS) -lpthread -lz -rdynamic -lm
BUILD_DIR = build
ifeq ($(zstd),1)
LDFLAGS += -lzstd
endif
BINARY = sigtk
OBJ = $(BUILD_DIR)/main.o \
$(BUILD_DIR)/sigtk.o \
$(BUILD_DIR)/events.o \
$(BUILD_DIR)/model.o \
$(BUILD_DIR)/sref.o \
$(BUILD_DIR)/cmain.o \
$(BUILD_DIR)/cfunc.o \
$(BUILD_DIR)/misc.o \
$(BUILD_DIR)/jnn.o \
$(BUILD_DIR)/ss.o \
$(BUILD_DIR)/ent.o \
$(BUILD_DIR)/qts.o \
PREFIX = /usr/local
VERSION = `git describe --tags`
ifdef asan
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address -fno-omit-frame-pointer
endif
.PHONY: clean distclean test
$(BINARY): $(OBJ) slow5lib/lib/libslow5.a
$(CC) $(CFLAGS) $(OBJ) slow5lib/lib/libslow5.a $(LDFLAGS) -o $@
$(BUILD_DIR)/main.o: src/main.c src/misc.h src/error.h src/sigtk.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/sigtk.o: src/sigtk.c src/misc.h src/error.h src/sigtk.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/events.o: src/events.c src/misc.h src/ksort.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/model.o: src/model.c src/model.h src/misc.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/sref.o: src/sref.c src/ref.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/cmain.o: src/cmain.c src/misc.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/cfunc.o: src/cfunc.c src/misc.h src/stat.h src/jnn.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/misc.o: src/misc.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/jnn.o: src/jnn.c src/stat.h src/jnn.h
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/ss.o: src/ss.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/ent.o: src/ent.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
$(BUILD_DIR)/qts.o: src/qts.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -o $@
slow5lib/lib/libslow5.a:
$(MAKE) -C slow5lib zstd=$(zstd) no_simd=$(no_simd) zstd_local=$(zstd_local) lib/libslow5.a
clean:
rm -rf $(BINARY) $(BUILD_DIR)/*.o
make -C slow5lib clean
# Delete all gitignored files (but not directories)
distclean: clean
git clean -f -X
rm -rf $(BUILD_DIR)/* autom4te.cache
test: $(BINARY)
scripts/test.sh
valgrind: $(BINARY)
valgrind --leak-check=full ./sigtk