-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
291 lines (251 loc) · 8.3 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#this is a forward reference to the target all below
all: all
#SHELL=/bin/bash
include Makefile.config
DIST_DIR = $(NAME)-$(VERSION)
DIST_TARBALL = $(DIST_DIR).tar.gz
#VERBOSE := -classic-display
OBFLAGS := $(VERBOSE) -j 10 -no-links -cflags -warn-error,FPSXY
APPFLAGS := $(VERBOSE) -j 10
#OBFLAGS := $(OBFLAGS) -tag debug
#OBFLAGS := $(OBFLAGS) -tag profile
#OBFLAGS := $(OBFLAGS) -classic-display
addnotrpm:
@if [ ! -s doseparseNoRpm ]; then $(LN) doseparse doseparseNoRpm ; fi
@cd doseparse ; \
if [ ! -s doseparseNoRpm.mlpack ]; then \
$(LN) doseparse.mlpack doseparseNoRpm.mlpack ; \
fi ; \
cd -
myocamlbuild.ml: myocamlbuild.ml.pp
cppo $(CPPOFLAGS) $< -o $@
all: libs apps man
apps: addnotrpm myocamlbuild.ml itarget $(BYTELIBS) $(OPTLIBS)
$(OCAMLBUILD) $(APPFLAGS) applications/apps.otarget
libs: addnotrpm myocamlbuild.ml itarget $(BYTELIBS) $(OPTLIBS) $(CMXSLIBS) $(ALIBS)
cleandoselib:
rm -Rf $(DOSELIBS)
itarget:
@rm -f applications/apps.itarget
@for i in $(TARGETS); do echo $$i >> applications/apps.itarget; done
@$(shell \
for lib in $(LIBNAMES); do \
libname=`basename "$$lib"` ;\
dirname=`dirname "$$lib"` ;\
rm -f $$dirname/$$libname.itarget ;\
for ext in $(SUFFIX); do \
echo "$$libname.$$ext" >> $$dirname/$$libname.itarget; \
done;\
done)
$(DOSELIBS)/cudf.%:
$(OCAMLBUILD) $(OBFLAGS) cudf/cudf.$*
@mkdir -p $(DOSELIBS)
@cp _build/cudf/*.cmi $(DOSELIBS)
@rm _build/cudf/*.cmi
@for i in _build/cudf/cudf.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/common.%: common/*.ml common/*.mli
$(OCAMLBUILD) $(OBFLAGS) common/common.otarget
@mkdir -p $(DOSELIBS)
@for i in _build/common/common.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/versioning.%: versioning/*.ml versioning/*.mli
$(OCAMLBUILD) $(OBFLAGS) versioning/versioning.otarget
@mkdir -p $(DOSELIBS)
@for i in _build/versioning/versioning.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/algo.%: algo/*.ml algo/*.mli $(DOSELIBS)/common.%
$(OCAMLBUILD) $(OBFLAGS) algo/algo.otarget
@for i in _build/algo/algo.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/debian.%: deb/*.ml deb/*.mli $(DOSELIBS)/pef.%
$(OCAMLBUILD) $(OBFLAGS) deb/debian.otarget
@for i in _build/deb/debian.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/opam.%: opam/*.ml opam/*.mli $(DOSELIBS)/pef.%
$(OCAMLBUILD) $(OBFLAGS) opam/opam.otarget
@for i in _build/opam/opam.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/npm.%: npm/*.ml npm/*.mli $(DOSELIBS)/versioning.% $(DOSELIBS)/pef.%
$(OCAMLBUILD) $(OBFLAGS) npm/npm.otarget
@for i in _build/npm/npm.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/rpm.%: rpm/*.ml $(DOSELIBS)/algo.%
$(OCAMLBUILD) $(OBFLAGS) rpm/rpm.otarget
@for i in _build/rpm/rpm.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/pef.%: pef/*.ml pef/*.mli
$(OCAMLBUILD) $(OBFLAGS) pef/pef.otarget
@for i in _build/pef/pef.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/csw.%: opencsw/*.ml $(DOSELIBS)/versioning.%
$(OCAMLBUILD) $(OBFLAGS) opencsw/csw.otarget
@for i in _build/opencsw/csw.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/doseparse.%: $(DOSELIBS)/pef.% $(DOSELIBS)/debian.%
$(OCAMLBUILD) $(OBFLAGS) doseparse/doseparse.otarget
@for i in _build/doseparse/doseparse.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx $(DOSELIBS)/*.ml ; \
fi ; \
done
$(DOSELIBS)/doseparseNoRpm.%: $(DOSELIBS)/pef.% $(DOSELIBS)/debian.%
$(OCAMLBUILD) $(OBFLAGS) doseparseNoRpm/doseparseNoRpm.otarget
@for i in _build/doseparseNoRpm/doseparseNoRpm.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ;\
rm $$i ;\
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ;\
fi ; \
done
clean:
$(OCAMLBUILD) -clean
@$(shell \
for lib in $(LIBNAMES); do \
libname=`basename "$$lib"` ;\
dirname=`dirname "$$lib"` ;\
rm -f $$dirname/$$libname.itarget ;\
done)
rm -f myocamlbuild.ml
rm -f applications/apps.itarget
rm -f doseparseNoRpm doseparse/doseparseNoRpm.mlpack
cd doc && $(MAKE) clean
distclean: clean
rm -Rf Makefile.config aclocal.m4 config.log config.status autom4te.cache/
rm -f algo/algo.mlpack
rm -f common/versionInfo.ml
rm -f db/db.mlpack
rm -f _tags META applications/dose-tests.list dose3.odocl
test: apps
ifeq (libs,$(word 2,$(MAKECMDGOALS)))
$(MAKE) testlib
else
ifdef group
applications/dose-tests.py --rungroup $(group) applications/dose-tests.list
else
ifdef unit
applications/dose-tests.py --runtest $(unit) applications/dose-tests.list
else
$(MAKE) testlib
applications/dose-tests.py applications/dose-tests.list
endif
endif
endif
testlib:
echo $(TESTS)
@for i in $(TESTS); do\
echo "#######START TESTING $$i" ;\
$(OCAMLBUILD) $(APPFLAGS) $$i/tests.$(OCAMLEXT) || exit 1;\
./tests.$(OCAMLEXT) || exit 1;\
done
# stuff not not put in a distribution tarball
DIST_EXCLUDE = cudf tests $(wildcard */tests) experimental doc/webpages
INSTALL_STUFF_ = META
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cma _build/doselibs/*.cmi)
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.cmxa _build/doselibs/*.cmxs)
INSTALL_STUFF_ += $(wildcard _build/doselibs/*.a)
#INSTALL_STUFF_ += $(wildcard _build/*/*.mli)
INSTALL_STUFF_ += $(wildcard _build/rpm/*.so)
exclude_cudf = $(wildcard _build/doselibs/*cudf* _build/cudf/*)
INSTALL_STUFF = $(filter-out $(exclude_cudf), $(INSTALL_STUFF_))
installlib: META installcudf
@test -d $(LIBDIR) || mkdir -p $(LIBDIR)
@test -d $(LIBDIR)/stublibs || mkdir -p $(LIBDIR)/stublibs
@$(INSTALL) -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF)
@echo "Install dose librairies to $(LIBDIR)"
install: installlib
@cd _build/applications ; \
install -d $(BINDIR) ; \
for f in $$(ls *.$(OCAMLEXT)) ; do \
install $(INSTALLOPTS) $$f $(BINDIR)/$${f%.$(OCAMLEXT)}$(EXE) ; \
done
@$(LN) $(BINDIR)/distcheck $(BINDIR)/debcheck$(EXE)
@$(LN) $(BINDIR)/distcheck $(BINDIR)/rpmcheck$(EXE)
@$(LN) $(BINDIR)/distcheck $(BINDIR)/eclipsecheck$(EXE)
@echo "Install dose binaries to $(BINDIR)"
uninstalllib:
@$(OCAMLFIND) remove -destdir $(LIBDIR) $(NAME)
@echo "Uninstall dose librairies from $(LIBDIR)"
uninstall: uninstalllib uninstallcudf
@for f in $$(ls *.$(OCAMLEXT)) ; do \
rm -f $(BINDIR)/$${f%.$(OCAMLEXT)}$(EXE) ; \
done
@rm -f $(BINDIR)/debcheck$(EXE) $(BINDIR)/rpmcheck$(EXE) $(BINDIR)/eclipsecheck$(EXE)
@echo "Uninstall dose binaries from $(BINDIR)"
dist: ./$(DIST_TARBALL)
./$(DIST_TARBALL):
@if [ -d ./$(DIST_DIR)/ ] ; then rm -rf ./$(DIST_DIR)/ ; fi
@if [ -d ./$(DIST_TARBALL) ] ; then rm -f ./$(DIST_TARBALL) ; fi
@mkdir ./$(DIST_DIR)/ ; git archive --format=tar HEAD | tar -x -C ./$(DIST_DIR)/
@for f in $(DIST_EXCLUDE) ; do rm -rf ./$(DIST_DIR)/$$f; done
@tar czf ./$(DIST_TARBALL) ./$(DIST_DIR)
@rm -rf ./$(DIST_DIR)
@echo "Distribution tarball: ./$(DIST_TARBALL)"
changelog:
dch -c CHANGES --package $(NAME) -v $(VERSION)
credits:
@git log --pretty=format:'%aN %aE' | LC_ALL=C sort -u | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}';
doc: all
$(OCAMLBUILD) -package unix scripts/pack.$(OCAMLEXT)
scripts/doc.sh $(OCAMLEXT)
dot -Grotate=0 -Tsvg -o dose3.docdir/index.svg dose3.docdir/index.dot
(cd doc && $(MAKE) all)
man:
cd doc/manpages && $(MAKE)
upload: doc
(cd doc && $(MAKE) upload)
rsync -avz -O dose3.docdir/ scm.gforge.inria.fr:/home/groups/dose/htdocs/API/
.PHONY: \
common algo pef versioning debian rpm csw doseparseNoRpm doseparse \
all clean top-level headers test tags install uninstall dist doc man