/
Makefile.osx
94 lines (69 loc) · 2.08 KB
/
Makefile.osx
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
# Entries to modify as needed
INSTALLDIR := /usr/local/bin
# For ATLAS BLAS
LIBS := -lf77blas -llapack -latlas -lm -lgsl -lgslcblas -lgfortran
# For Intel MKL BLAS
# LIBS := -lmkl_gf_lp64 -lmkl_sequential -lmkl_lapack -lmkl_core \
# -lm -lgsl -lgslcblas
CC := gcc-4.7
INCLUDES := -I/opt/local/include/gsl -I/opt/local/include
LIBDIRS := -L/opt/local/lib -L/opt/local/lib/gcc47/
CFLAGS := -O3 -Wall
# Do not modify below this line
BUILDDIR := build
SRCDIR := src
TESTDIR := test
RM := rm -rf
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS := $(wildcard $(SRCDIR)/*.c)
OBJS := $(C_SRCS:$(SRCDIR)/%.c=$(BUILDDIR)/%.o)
C_DEPS := $(C_SRCS:$(SRCDIR)/%.c=$(BUILDDIR)/%.d)
BINARY := rowavedt
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
mkdir -p $(BUILDDIR)
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
$(CC) $(INCLUDES) -std=gnu99 \
$(CFLAGS) -c -fmessage-length=0 -MMD -MP \
-MF "$(@:%.o=%.d)" -MT "$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
USER_OBJS :=
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
# All Target
all: rowavedt
# Tool invocations
rowavedt: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
$(CC) -o "$(BINARY)" $(OBJS) $(USER_OBJS) $(LIBDIRS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
install: rowavedt
@echo "Installing to $(INSTALLDIR)"
cp $(BINARY) $(INSTALLDIR)
# Basic test
.PHONY : test
test: rowavedt
mkdir -p test/
Rscript scripts/mk_wavelet_basis.R -c 128 > test/basis.dat
./rowavedt test/basis.dat 2048 128 \
data/y.dat `wc -l data/y.dat` \
> test/output.txt
./rowavedt test/basis.dat 2048 128 \
data/yMissing.dat `wc -l data/yMissing.dat` \
>> test/output.txt
Rscript scripts/screen_time_series.R --alpha=0.0001 test/output.txt \
test/detections.txt test/detection_stats.txt
Rscript scripts/compute_features.R --detections=test/detections.txt \
test/output.txt test/basis.dat \
> test/features.txt
# Other Targets
.PHONY : clean
clean:
-$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) rowavedt
-@echo ' '