-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile
79 lines (66 loc) · 2.26 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
#Makefile for wfdb-application-toolbox
#
# Written by Ikaro Silva, 2013
#
#For now simple make file for packaging and deploying application.
#Requires that the Java classes be compiled into runnable JARs.
#
#To compile the Toolbox for deployment run:
#make package
BUILDFILE := ./jarbuild.xml
ANT = ant
#Always check that this matches with Ant's script (jarbuild.xml),
#with the loading function wfdbloadlib.m , and with Contents.m
#There is really no reason by the *.jar and *.zip should need to have the same
#version numbers, as they are really modular...But for now we keep them at the same
#versioning level in order to avoid (or increase?) confusion.
VERSION=0-10-0
APP_NAME=wfdb-app-toolbox-$(VERSION).zip
JAR7_NAME=wfdb-app-JVM7-$(VERSION).jar
javasrc=$(shell find src -name \*.java)
all: jar7 nativelibs
jar7: mcode/$(JAR7_NAME)
mcode/$(JAR7_NAME): $(javasrc) $(BUILDFILE)
$(ANT) -f $(BUILDFILE) jar7
nativelibs: jar7
cd mcode/nativelibs && $(MAKE) install
set -e; if grep -q '^WFDB_CUSTOMLIB=0' mcode/wfdbloadlib.m; then \
sed -e 's/^WFDB_CUSTOMLIB=0/WFDB_CUSTOMLIB=1/' \
< mcode/wfdbloadlib.m > mcode/wfdbloadlib.m.tmp; \
mv -f mcode/wfdbloadlib.m.tmp mcode/wfdbloadlib.m; \
fi
clean:
cd mcode/nativelibs && $(MAKE) clean
rm -rf bin
rm -f mcode/*.jar
#Target for HTML doc generation from M-files
doc:
./gen-doc.sh
package: jar7 doc unit-test.zip
rm -f $(APP_NAME)
set -e; if grep -q '^WFDB_CUSTOMLIB=1' mcode/wfdbloadlib.m; then \
sed -e 's/^WFDB_CUSTOMLIB=1/WFDB_CUSTOMLIB=0/' \
< mcode/wfdbloadlib.m > mcode/wfdbloadlib.m.tmp; \
mv -f mcode/wfdbloadlib.m.tmp mcode/wfdbloadlib.m; \
fi
zip -X -r $(APP_NAME) mcode [email protected]
unit-test.zip:
zip -X -r $@ UnitTests [email protected]
check:
set -e; unset DISPLAY; mcodedir=`pwd`/mcode; \
cd UnitTests && octave -q --eval \
"pkg load signal; \
addpath('$$mcodedir'); \
confirm_recursive_rmdir(0); \
BatchTest; exit(total_failed > 0)"
check-%:
set -e; unset DISPLAY; mcodedir=`pwd`/mcode; \
cd UnitTests && octave -q --eval \
"pkg load signal; \
addpath('$$mcodedir'); \
confirm_recursive_rmdir(0); \
[tests,pass,perf]=test_$*(1); \
exit(pass < tests)"
jartest: mcode/$(JAR7_NAME) unit-test.zip
cd mcode; \
java -cp $(JAR7_NAME) org.physionet.wfdb.Wfdbexec rdsamp -r mitdb/100 -t s5