forked from stegro/hdf5oct
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
54 lines (39 loc) · 1.37 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
CXX=h5c++
src= h5read.cc
headers=h5read.h
octs=$(src:.cc=.oct)
objs=$(src:.cc=.o)
H5FLAGS=$(shell octave --eval 'exit(__octave_config_info__ ("build_features").HDF5 != 1)' &> /dev/null && echo "-DHAVE_HDF5") \
$(shell octave --eval 'exit(__octave_config_info__ ("build_features").HDF5_18 != 1)' &> /dev/null && echo "-DHAVE_HDF5_18")
MKOCTFILE=CXX="$(CXX)" CXXFLAGS="-ansi -std=c++11" mkoctfile -v $(H5FLAGS)
VERSION=0.5.0
PACKAGEFILE=hdf5oct-$(VERSION).tar.gz
.PHONY: test clean install uninstall package
all: $(octs) package
%.oct: $(objs)
echo $(MKOCTFILE) -o $@ $(objs)
$(MKOCTFILE) -o $@ $(objs)
%.o: %.cc $(headers)
$(MKOCTFILE) -c $<
clean:
rm -f *.o *.oct package/inst/* test/test*.h5 $(PACKAGEFILE)
install: $(PACKAGEFILE)
@echo "-- Install Octave Package ------------"
octave --silent --no-gui --eval "pkg install $(PACKAGEFILE)"
uninstall:
@echo "-- Uninstall Octave Package ----------"
octave --silent --no-gui --eval "pkg uninstall hdf5oct"
package: $(PACKAGEFILE)
cp-octave:
cp h5read.{cc,h} $(HOME)/build/octave/libinterp/dldfcn/
$(PACKAGEFILE): $(octs)
@echo "-- Create Octave Package Archive ------------"
mkdir -p package/inst
cp *.oct package/inst
tar -czf $(PACKAGEFILE) package/
# TESTING ###########
# a target to test the octave functions
test:
@echo "-- Perform Tests --------------"
rm -f test/test*.h5
cd test && octave --silent --no-gui h5test.m