-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
74 lines (59 loc) · 1.63 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
OS:=$(shell uname -s)
DEPS=./deps
ARCH:= $(shell uname -p)
HDF5_VERSION := $(shell curl http://www.hdfgroup.org/ftp/HDF5/current/src/ | grep '<title>.*</title>' | awk '{print $$2}')
HDF5_FLAGS=
CC:=
DRV_CC_TEMPLATE:=
DRV_LINK_TEMPLATE:=
EXE_LINK_TEMPLATE:=
EXE_CC_TEMPLATE:=
LDFLAGS:=
ifeq ($(OS),Darwin)
LIBRARY=$(DEPS)/hdf5/lib/libhdf5.dylib
else
LIBRARY=$(DEPS)/hdf5/lib/libhdf5.so
endif
ifeq ($(ARCH), armv7l)
ERLCFLAGS := "-g -Wall -fPIC -I/usr/lib/erlang/lib/erl_interface-3.7.3/include -I/usr/lib/erlang/erts-5.8.3/include -DH5_NO_DEPRECATED_SYMBOLS"
H5CCBASE := $(shell h5cc --version| head -1| awk '{print $$1}')
H5CC := $(shell which h5cc)
else
ERLCFLAGS := "-g -Wall -fPIC -I/usr/lib/erlang/lib/erl_interface-3.7.9/include -I/usr/lib/erlang/erts-5.9.3.1/include"
H5CCBASE :=
H5CC:=deps/hdf5/bin/h5cc
endif
TEST_SUPPORT = \
test/etap.beam
%.beam: %.erl
erlc -o test/ $<
all:$(LIBRARY)
CC=$(H5CC) CFLAGS=$(ERLCFLAGS) ./rebar compile
hdf5: $(LIBRARY)
$(DEPS)/hdf5:
ifneq ($(H5CCBASE), gcc)
@mkdir -p $(DEPS)/hdf5; cd $(DEPS) ; \
curl http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-$(HDF5_VERSION).tar.gz | tar xzf -
else
@mkdir -p $(DEPS)/hdf5; cd $(DEPS) ;
endif
$(LIBRARY): $(DEPS)/hdf5
ifneq ($(H5CCBASE), gcc)
@cd $(DEPS)/hdf5-$(HDF5_VERSION) && CFLAGS=-O1 ./configure --prefix $(CURDIR)/$(DEPS)/hdf5 \
$(HDF5_FLAGS) && make && make install
endif
# check: $(TEST_SUPPORT)
# prove test/*.t
etags:
find . | grep ".*\.\(h\|hxx\|c\)" | xargs etags -f TAGS
clean:
./rebar clean
rm -rf test/*.beam
distclean:
rm -rf $(DEPS)
rm -rf priv
test: all
mkdir -p .eunit
cp -r priv .eunit/.
./rebar skip_deps=true eunit
./rebar ct