Dec 17, 2015
BIG: initial commit
|
|
|
13 |
RMPATH=rmpath('$(ROOTDIR)'); |
|
14 |
SAVEPATH=savepath();exit(0) |
|
15 |
|
|
16 |
INSTALL=$(ADDPATH);$(SAVEPATH) |
|
17 |
UNINSTALL=$(RMPATH);$(SAVEPATH) |
|
18 |
|
|
19 |
help: |
|
20 |
@echo "Usage: make <target>, where <target> is one of:" |
|
21 |
@echo "------------------------------------------------------------------" |
|
22 |
@echo " install to add MOcov to the Matlab and GNU Octave" |
|
23 |
@echo " search paths, using whichever is present" |
|
24 |
@echo " uninstall to remove MOcov from the Matlab and GNU" |
|
25 |
@echo " Octave search paths, using whichever is" |
|
26 |
@echo " present" |
Dec 17, 2015
BIG: initial commit
|
|
|
53 |
|
|
54 |
MATLAB_BIN=$(shell which $(MATLAB)) |
|
55 |
OCTAVE_BIN=$(shell which $(OCTAVE)) |
|
56 |
|
|
57 |
ifeq ($(MATLAB_BIN),) |
|
58 |
# for Apple OSX, try to locate Matlab elsewhere if not found |
|
59 |
MATLAB_BIN=$(shell ls /Applications/MATLAB_R20*/bin/${MATLAB} 2>/dev/null | tail -1) |
|
60 |
endif |
|
61 |
|
|
62 |
MATLAB_RUN=$(MATLAB_BIN) -nojvm -nodisplay -nosplash -r |
|
63 |
OCTAVE_RUN=$(OCTAVE_BIN) --no-gui --quiet --eval |
|
64 |
|
|
65 |
install-matlab: |
|
66 |
@if [ -n "$(MATLAB_BIN)" ]; then \ |
|
67 |
$(MATLAB_RUN) "$(INSTALL)"; \ |
|
68 |
else \ |
|
69 |
echo "matlab binary could not be found, skipping"; \ |
|
70 |
fi; |
|
71 |
|
|
72 |
install-octave: |
|
73 |
@if [ -n "$(OCTAVE_BIN)" ]; then \ |
|
74 |
$(OCTAVE_RUN) "$(INSTALL)"; \ |
|
75 |
else \ |
|
76 |
echo "octave binary could not be found, skipping"; \ |
|
77 |
fi; |
|
78 |
|
|
79 |
install: |
|
80 |
@if [ -z "$(MATLAB_BIN)$(OCTAVE_BIN)" ]; then \ |
|
81 |
@echo "Neither matlab binary nor octave binary could be found" \ |
|
82 |
exit 1; \ |
|
83 |
fi; |
|
84 |
$(MAKE) install-matlab |
|
85 |
$(MAKE) install-octave |
|
86 |
|
|
87 |
|
|
88 |
uninstall-matlab: |
|
89 |
@if [ -n "$(MATLAB_BIN)" ]; then \ |
|
90 |
$(MATLAB_RUN) "$(UNINSTALL)"; \ |
|
91 |
else \ |
|
92 |
echo "matlab binary could not be found, skipping"; \ |
|
93 |
fi; |
|
94 |
|
|
95 |
uninstall-octave: |
|
96 |
@if [ -n "$(OCTAVE_BIN)" ]; then \ |
|
97 |
$(OCTAVE_RUN) "$(UNINSTALL)"; \ |
|
98 |
else \ |
|
99 |
echo "octave binary could not be found, skipping"; \ |
|
100 |
fi; |
|
101 |
|
|
102 |
uninstall: |
|
103 |
@if [ -z "$(MATLAB_BIN)$(OCTAVE_BIN)" ]; then \ |
|
104 |
@echo "Neither matlab binary nor octave binary could be found" \ |
|
105 |
exit 1; \ |
|
106 |
fi; |
|
107 |
$(MAKE) uninstall-matlab |
|
108 |
$(MAKE) uninstall-octave |
|
109 |
|
|
110 |
|