-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
119 lines (94 loc) · 2.81 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
include Makefile.inc
ifeq ($(ARCH),WINDOWS)
TARGETS = luna destrat behead
else
ifdef WASM
TARGETS=luna libluna destrat
else
TARGETS = luna libluna destrat behead fixrows
endif
endif
SRCS = globals.cpp eval.cpp cmddefs.cpp \
$(wildcard edf/*.cpp) \
$(wildcard edfz/*.cpp) \
$(wildcard defs/*.cpp) \
$(wildcard tinyxml/*.cpp) \
$(wildcard helper/*.cpp) \
$(wildcard timeline/*.cpp) \
$(wildcard annot/*.cpp) \
$(wildcard dsp/*.cpp) \
$(wildcard miscmath/*.cpp) \
$(wildcard artifacts/*.cpp) \
$(wildcard spectral/*.cpp) \
$(wildcard spectral/mtm/*.cpp) \
$(wildcard spindles/*.cpp) \
$(wildcard dynamics/*.cpp) \
$(wildcard intervals/*.cpp) \
$(wildcard resp/*.cpp) \
$(wildcard fftw/*.cpp) \
$(wildcard cwt/*.cpp) \
$(wildcard stats/*.cpp) \
$(wildcard staging/*.cpp) \
$(wildcard suds/*.cpp) \
$(wildcard db/*.cpp) \
$(wildcard ica/*.cpp) \
$(wildcard clocs/*.cpp) \
$(wildcard pdc/*.cpp) \
$(wildcard sstore/*.cpp) \
$(wildcard dsp/libsamplerate/*.cpp) \
$(wildcard pops/*.cpp) \
$(wildcard assoc/*.cpp) \
$(wildcard lgbm/*.cpp) \
$(wildcard web/*.cpp) \
$(wildcard models/*.cpp) \
$(wildcard lunapi/*.cpp)
CSRCS = $(wildcard db/*.c) \
$(wildcard stats/*.c) \
$(wildcard dsp/*.c) \
$(wildcard zlib-1.3/*.c) \
$(wildcard dsp/libsamplerate/*.c)
OBJS = $(SRCS:.cpp=.o) $(CSRCS:.c=.o)
DEPS := $(OBJS:.o=.d)
#
# targets
#
all: $(TARGETS)
luna: main.o $(OBJS)
$(CXX) -o $@ $^ $(DEP_LIB) $(LDFLAGS)
libluna: libluna.a $(SHARED_LIB)
# header dependencies
-include $(DEPS)
# shared library (libluna)
ifeq ($(ARCH),MAC)
$(SHARED_LIB) : $(OBJS)
$(LD) -dynamiclib $(DEP_LIB) $(LDFLAGS) -o $(SHARED_LIB) $(OBJS)
else ifeq ($(ARCH),LINUX)
$(SHARED_LIB) : $(OBJS)
$(LD) -shared $(DEP_LIB) $(LDFLAGS) -o $(SHARED_LIB) $(OBJS)
endif
# objects
libluna.a : $(OBJS)
$(AR) $(ARFLAGS) $@ $?
$(RANLIB) $@
static: main.o $(OBJS) $(FFTW)/lib/libfftw3.a
$(CXX) -static -static-libgcc -static-libstdc++ -o luna-static $^
destrat: utils/reader.o libluna.a
$(CXX) -o $@ $^ -L. $(LDFLAGS)
regional: utils/region-annotate.o
$(CXX) -o $@ $^
tocol: utils/tocol.o
$(CXX) -o $@ $^ $(LDFLAGS)
fixrows: utils/fixrows.o
$(CXX) -o $@ $^ $(LDFLAGS)
cgi-mapper: utils/cgi-mapper.o libluna.a
$(CXX) -o $@ $^ $(LDFLAGS)
behead: utils/behead.o
$(CXX) -o $@ $^ $(LDFLAGS)
dmerge: utils/merge.o utils/merge-helpers.o
$(CXX) -o $@ $^
simassoc: utils/simassoc.o libluna.a
$(CXX) -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:
-$(RM) $(TARGETS) libluna.dylib libluna.so libluna.a main.o $(OBJS) $(DEPS) $(addsuffix ~,$(SRCS) $(CSRCS))
-$(RM) utils/*.o utils/*.d utils/*~