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
|
#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 profile -tag debug
#OBFLAGS := $(OBFLAGS) -classic-display
all: itarget $(CAMLP4CMXS) $(BYTELIBS) $(OPTLIBS) $(CMXSLIBS) $(ALIBS) man
$(OCAMLBUILD) $(APPFLAGS) applications/apps.otarget
apps: itarget $(CAMLP4CMXS) $(BYTELIBS) $(OPTLIBS)
echo $(LIBNAMES)
echo $(BYTELIBS)
echo $(OPTLIBS)
$(OCAMLBUILD) $(APPFLAGS) applications/apps.otarget
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)
# @touch applications/.itarget
_build/Camlp4MacroParser.cmxs:
mkdir -p _build
ocamlopt -shared $(shell ocamlc -where)/camlp4/Camlp4Parsers/Camlp4MacroParser.cmx -o _build/Camlp4MacroParser.cmxs
$(DOSELIBS)/cudf.%:
$(OCAMLBUILD) $(OBFLAGS) cudf/cudf.$*
@mkdir -p $(DOSELIBS)
@cp _build/cudf/*.cmi $(DOSELIBS)
@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
$(OCAMLBUILD) $(OBFLAGS) common/common.otarget
@mkdir -p $(DOSELIBS)
@for i in _build/common/common.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/algo.%: algo/*.ml $(DOSELIBS)/common.%
$(OCAMLBUILD) $(OBFLAGS) algo/algo.otarget
@for i in _build/algo/algo.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/debian.%: deb/*.ml $(DOSELIBS)/algo.%
$(OCAMLBUILD) $(OBFLAGS) deb/debian.otarget
@for i in _build/deb/debian.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
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 -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/eclipse.%: eclipse/*.ml $(DOSELIBS)/debian.%
$(OCAMLBUILD) $(OBFLAGS) eclipse/eclipse.otarget
@for i in _build/eclipse/eclipse.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/csw.%: opencsw/*.ml $(DOSELIBS)/debian.%
$(OCAMLBUILD) $(OBFLAGS) opencsw/csw.otarget
@for i in _build/opencsw/csw.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/cv.%:
$(OCAMLBUILD) $(OBFLAGS) cv/cv.otarget
@for i in _build/cv/cv.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
$(DOSELIBS)/doseparse.%: $(DOSELIBS)/debian.% $(DOSELIBS)/eclipse.%
$(OCAMLBUILD) $(OBFLAGS) doseparse/doseparse.otarget
@for i in _build/doseparse/doseparse.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx $(DOSELIBS)/*.ml ; \
fi ; \
done
$(DOSELIBS)/doseparseNoRpm.%: $(DOSELIBS)/debian.% $(DOSELIBS)/eclipse.%
$(OCAMLBUILD) $(OBFLAGS) doseparseNoRpm/doseparseNoRpm.otarget
@for i in _build/doseparseNoRpm/doseparseNoRpm.*; do \
if [ -e $$i ]; then \
cp $$i $(DOSELIBS) ; \
rm -f $(DOSELIBS)/*.mlpack $(DOSELIBS)/*.cmx ; \
fi ; \
done
clean:
$(OCAMLBUILD) -clean
rm -f applications/apps.itarget
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
testapps: apps
@applications/dose-tests.py applications/dose-tests.list
testlib:
@for i in $(TESTS); do\
echo "#######START TESTING $$i" ;\
$(OCAMLBUILD) $(APPFLAGS) $$i/tests.$(OCAMLEXT) ;\
./tests.$(OCAMLEXT) ;\
done
test: testapps testlib
# stuff not not put in a distribution tarball
DIST_EXCLUDE = cudf tests $(wildcard */tests) experimental
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 _build/rpm/*.a)
exclude_cudf = $(wildcard _build/doselibs/*cudf* _build/cudf/*)
INSTALL_STUFF = $(filter-out $(exclude_cudf), $(INSTALL_STUFF_))
install: META installcudf
test -d $(LIBDIR) || mkdir -p $(LIBDIR)
test -d $(LIBDIR)/stublibs || mkdir -p $(LIBDIR)/stublibs
$(INSTALL) -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF)
# install applications
cd _build/applications ; \
install -d $(BINDIR) ; \
for f in $$(ls *.$(OCAMLEXT)) ; do \
install $(INSTALLOPTS) $$f $(BINDIR)/$${f%.$(OCAMLEXT)} ; \
done
ln -s $(BINDIR)/distcheck $(BINDIR)/debcheck
ln -s $(BINDIR)/distcheck $(BINDIR)/rpmcheck
ln -s $(BINDIR)/distcheck $(BINDIR)/eclipsecheck
uninstall: uninstallcudf
$(OCAMLFIND) remove -destdir $(LIBDIR) $(NAME)
for f in $$(ls *.$(OCAMLEXT)) ; do \
rm -f $(BINDIR)/$${f%.$(OCAMLEXT)} ; \
done
rm -f $(BINDIR)/debcheck $(BINDIR)/rpmcheck $(BINDIR)/eclipsecheck
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
if [ -d .svn ]; then \
svn export . ./$(DIST_DIR) ; \
else \
mkdir ./$(DIST_DIR)/ ; git archive --format=tar HEAD | tar -x -C ./$(DIST_DIR)/ ; \
fi
for f in $(DIST_EXCLUDE) ; do rm -rf ./$(DIST_DIR)/$$f; done
tar cvzf ./$(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) dose3.docdir/index.html dose3.docdir/index.dot
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/doc/api/
.PHONY: \
common algo debian eclipse rpm cws doseparseNoRpm doseparse \
all clean top-level headers test tags install uninstall dist doc man
|