forked from toastpp/toastpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
184 lines (149 loc) · 4.97 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
include Makefile.incl
SUBDIRS = $(TSRC)
GUIDIR = $(TOASTDIR)/gui
NUMERICSDIR = $(TOASTDIR)/numerics
TOASTRELDIR = toast
# ========================================================
# Making
all::numerics toast
toast::
@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
for i in $(SUBDIRS) ;\
do \
(cd $$i ; echo "making" all "in $$i..."; \
$(MAKE) $(MFLAGS) all); \
done
matlab2::
cd src; \
$(MAKE) matlab2;
python::
cd src; \
$(MAKE) python;
gui::
cd $(GUIDIR); \
echo "making" all "in $(GUIDIR)"; \
$(MAKE) $(MFLAGS) all;
numerics::
cd $(NUMERICSDIR); \
echo "making" all "in $(NUMERICSDIR)"; \
$(MAKE) $(MFLAGS) all;
doc::
cd src; \
$(MAKE) doc
test::
@cd test; $(MAKE)
# ========================================================
# Cleaning
clean::matlab_clean toast_clean numerics_clean
toast_clean::
@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
for i in $(SUBDIRS);\
do \
(cd $$i ; echo "making" clean "in $$i..."; \
$(MAKE) $(MFLAGS) clean); \
done
$(RM) *~ script/*~ toastrc.d/*~
numerics_clean::
cd $(NUMERICSDIR); \
$(MAKE) $(MFLAGS) clean
matlab_clean:
cd $(TOASTVER)/mex; \
$(MAKE) clean
matlab2_clean:
cd $(TOASTVER)/mex2; \
$(MAKE) clean
doc_clean::
cd src; \
$(MAKE) doc_clean
gui_clean::
cd $(GUIDIR); \
$(MAKE) $(MFLAGS) gui_clean
# ========================================================
# Dist-cleaning
distclean::matlab_distclean toast_distclean numerics_distclean
$(RM) -f Makefile.incl config.status config.cache config.log
$(RM) -f *~ script/*~ toastrc.d/*~
toast_distclean::
for i in $(SUBDIRS); \
do \
(cd $$i ; echo "making" distclean "in $$i..."; \
$(MAKE) $(MFLAGS) distclean); \
done
numerics_distclean::
cd $(NUMERICSDIR); \
$(MAKE) $(MFLAGS) distclean
matlab_distclean:
$(RM) -rf $(TOASTVER)/mex
$(RM) -f $(TOASTVER)mexopts.incl
gui_distclean::
cd $(GUIDIR); \
$(MAKE) $(MFLAGS) gui_distclean
# ========================================================
# ???
uninstall::
for i in $(SUBDIRS); \
do \
(cd $$i ; echo "making" uninstall "in $$i..."; \
$(MAKE) $(MFLAGS) uninstall); \
done
web_distribution_shared::
rm -f lib
ln -s lib_shared lib
rm -f bin
ln -s bin_shared bin
tar czvf toast_shared.tar.gz bin/* docs/* scales/* script/* toastrc.d/* lib/* --exclude "lib/*.a"
web_distribution_static::
rm -f lib
ln -s lib_static lib
rm -f bin
ln -s bin_static bin
tar czvf toast_static.tar.gz bin/* docs/* scales/* script/* toastrc.d/*
distro_src::
cd ..; \
ln -T -s trunk $(TOASTRELDIR); \
zip -9 -r toast_src.zip $(TOASTRELDIR)/doc -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 -r toast_src.zip $(TOASTRELDIR)/include -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 -r toast_src.zip $(TOASTRELDIR)/numerics -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 -r toast_src.zip $(TOASTRELDIR)/script -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 -r toast_src.zip $(TOASTRELDIR)/src -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 -r toast_src.zip $(TOASTRELDIR)/win32 -x@$(TOASTRELDIR)/exclude.lst ; \
zip -9 toast_src.zip $(TOASTRELDIR)/configure $(TOASTRELDIR)/gpl.txt $(TOASTRELDIR)/license.html $(TOASTRELDIR)/Makefile $(TOASTRELDIR)/mtoast_install.m $(TOASTRELDIR)/readme.txt; \
find -H $(TOASTRELDIR) -maxdepth 1 -name "*.in" -print | zip toast_src.zip -@ ; \
find -H $(TOASTRELDIR) -maxdepth 1 -name "*.h" -print | zip toast_src.zip -@ ; \
find -H $(TOASTRELDIR) -maxdepth 1 -name "*.readme" -print | zip toast_src.zip -@ ; \
mv toast_src.zip $(TOASTRELDIR)
# ========================================================
# Distribution packages
distro_common::
cd ..; \
ln -T -s trunk $(TOASTRELDIR); \
zip -9 -r toast_common.zip $(TOASTRELDIR)/script -x@$(TOASTRELDIR)/exclude.lst -x \*/.svn/\* ; \
zip -9 -r toast_common.zip $(TOASTRELDIR)/test -x@$(TOASTRELDIR)/exclude.lst -x \*/.svn/\* ; \
zip -9 -r toast_common.zip $(TOASTRELDIR)/examples -x@$(TOASTRELDIR)/exclude.lst -x \*/.svn/\* ; \
zip -9 -r toast_common.zip $(TOASTRELDIR)/doc -x@$(TOASTRELDIR)/exclude.lst -x \*/.svn/\* ; \
zip -9 toast_common.zip $(TOASTRELDIR)/mtoast_install.m ; \
zip -9 toast_common.zip $(TOASTRELDIR)/mtoast2_install.m ; \
zip -9 toast_common.zip $(TOASTRELDIR)/README.md ; \
zip -9 toast_common.zip $(TOASTRELDIR)/COPYING ; \
zip -9 toast_common.zip $(TOASTRELDIR)/INSTALL ; \
mv toast_common.zip $(TOASTRELDIR)
distro_bin_win64::
zip -9 -r toast_bin_win64.zip \
win/x64/Release/bin \
win/x64/Release/mex2 -x@exclude.lst
@echo "Windows binary distro created in toast_bin_win64.zip"
distro_bin_linux::
zip -9 -r toast_bin_$(ARCHDIR).zip \
$(ARCHDIR)/bin \
$(ARCHDIR)/lib \
$(ARCHDIR)/mex2 \
toastenv.csh toastenv.sh
@echo "Linux binary distro created in toast_bin_$(ARCHDIR).zip"
distro_bin_darwin::
ln -s $(PWD) ../$(TOASTRELDIR); \
cd ..; \
zip -9 -r toast_bin_darwin64.zip $(TOASTRELDIR)/$(ARCHDIR)/bin \
$(TOASTRELDIR)/$(ARCHDIR)/lib \
$(TOASTRELDIR)/$(ARCHDIR)/mex2 -x "*.DS_Store" ; \
mv toast_bin_darwin64.zip $(TOASTRELDIR)/toast_bin_$(ARCHDIR).zip
@echo "Darwin distro tarball created in $(TOASTRELDIR)/toast_bin_$(ARCHDIR).zip"