Commit 1ef2cb1d authored by Erwan Jahier's avatar Erwan Jahier

Use oasis (and thus ocamlbuild) instead of OcamlMakefile.

The C binding does not work yet (hence the test in examples/C and
examples/lustre are broken).
parent fbd316f5
......@@ -7,6 +7,24 @@ obj-*
src/TAGS
*log
*.diff
*.mldylib
*.mllib
*.clib
META
setup.ml
myocamlbuild.ml
old_source
_build/
checkRif.native
lurettetop.native
main.native
polka/matrix.ml
polka/matrix.mli
polka/poly.ml
polka/poly.mli
polka/sedscript
polka/vector.ml
polka/vector.mli
.*.swp
._bcdi
._d
......
# cluctch to fix the unability of oasis to deal with .idl files
CAMLIDL=camlidl
IDLFILES =$(shell ls *.idl)
CFILE=$(IDLFILES:%.idl=%_stubs.c)
MLFILE=$(IDLFILES:%.idl=%.ml)
MLIFILE=$(IDLFILES:%.idl=%.mli)
all: $(CFILE) $(MLFILE) $(MLIFILE)
idl : $(IDLFILES)
# camlidl
%_stubs.c %.ml %.mli: %.idl
$(CAMLIDL) -nocpp -I . $*.idl
clean:
/bin/rm -f $(CFILE) $(MLFILE) $(MLIFILE)
all:build
include ./Makefile.version
include ./Makefile.common.source
-include mymakefile
# migth be necessary if camlidl is not installed for the current version of ocaml
# nb: to be done only once since for camlidl, the install is made in the ocaml install
# dir, which is not the case for polka and co.
camlidl:
cd camlidl-1.05/ && make clean && make all && make install
slink:
rm -f bin lib include
ln -s $(HOSTTYPE)/bin
ln -s $(HOSTTYPE)/lib
ln -s $(HOSTTYPE)/include
# to run after a 'git clone', or a change in the ocaml version, or to compile on another arch
source: build
build: gen_version
./lnsw
mkdir -p $(LOCAL_INSTALL)/lib
mkdir -p $(LOCAL_INSTALL)/bin
mkdir -p $(LOCAL_INSTALL)/include
mkdir -p $(BIN_INSTALL_DIR)
mkdir -p $(LIB_INSTALL_DIR)
mkdir -p $(INC_INSTALL_DIR)
cd polka && make clean && make all && make install&& cd .. &&\
cd GBDDML && make clean && make && make all && make cp && cd ..&&\
cd source && make clean && make install&& cd ..&&\
make slink &&\
cd install && autoconf && cd .. &&\
make cpcomp && \
./RUN_ME
build: setup.data
ocaml setup.ml -build
slink:
rm -rf $(HOSTTYPE) && ln -sf pre_release/$(HOSTTYPE)
rm -rf bin && ln -sf pre_release/$(HOSTTYPE)/bin
rm -rf lib && ln -sf pre_release/$(HOSTTYPE)/lib
rm -rf include && ln -sf pre_release/$(HOSTTYPE)/include
cp -rf $(LOCAL_INSTALL)/lib/* $(LIB_INSTALL_DIR)
cp -rf $(LOCAL_INSTALL)/include/* $(INC_INSTALL_DIR)
setup.ml:_oasis polka/vector.ml Liblutin/src/liblutin.ml
oasis setup
# a clutch because oasis does not support camlidl
polka/vector.ml:
cd polka; make idl
Liblutin/src/liblutin.ml:
cd Liblutin/src/; make
setup.data:configure
configure: setup.ml
ocaml setup.ml -configure \
--prefix $(LURETTE_PATH) \
--exec-prefix $(LURETTE_PATH)/$(HOSTTYPE) \
--enable-tests
utest: build
./ounitTestRun.native -output-html-dir test/html -output-junit-file test/result-junit.xml
.PHONY:doc
doc:
ocaml setup.ml -doc
install:
ocaml setup.ml -install
cp lutin/src/lut4c_stubs.h $(shell ocamlc -where)/../lutin/
uninstall:
ocaml setup.ml -uninstall
reinstall:
ocaml setup.ml -reinstall
cp lutin/src/lut4c_stubs.h $(shell ocamlc -where)/../lutin/
AR=ar
XXX= -I +ezdl -cclib -lezdl ezdl.cmxa
# essayons a la main
xxx:
cd _build/lutin/src; \
ocamlopt -output-obj \
-I +rdbg-plugin \
str.cmxa unix.cmxa nums.cmxa rdbg-plugin.cmxa \
../../polka/polka.cmxa ../../gbddml/gbddml.cmxa \
$(XXX) \
-o lut4c_lib.o \
version.cmx lutVersion.cmx lexeme.cmx utils.cmx util.cmx sol_nb.cmx type.cmx prevar.cmx value.cmx var.cmx exp.cmx ne.cmx constraint.cmx gne.cmx thickness.cmx poly_draw.cmx polyhedron.cmx formula_to_bdd.cmx store.cmx draw.cmx bddd.cmx fair_bddd.cmx solver.cmx prog.cmx fGen.cmx lucFGen.cmx lucky.cmx rif.cmx reactive.cmx exprUtil.cmx expEval.cmx verbose.cmx lutErrors.cmx lutParser.cmx lutLexer.cmx syntaxe.cmx parsers.cmx syntaxeDump.cmx ckTypeEff.cmx ckIdentInfo.cmx checkEnv.cmx lutPredef.cmx checkType.cmx coIdent.cmx coAlgExp.cmx coTraceExp.cmx glue.cmx guard.cmx expand.cmx loopWeights.cmx autoGen.cmx auto2Lucky.cmx lutProg.cmx luc2alice.cmx luc2c.cmx mainArg.cmx lutExe.cmx lut4c.cmx ;
[ -d tmp_dir ] || mkdir tmp_dir && \
cd tmp_dir && rm -f * && \
$(AR) rcs liblut4c.a ../lut4c_lib.o ../lut4c_stubs.o && \
$(AR) x $(shell ocamlc -where)/libasmrun.a &&\
$(AR) q liblut4c.a *.o && rm *.o &&\
cp liblut4c.a ..
oi:install
or:reinstall
ob:build
oc:clean
clean:
ocaml setup.ml -clean
rm -f setup.data
cd polka; make clean
cd Liblutin/src/ ; make clean
distclean:
ocaml setup.ml -distclean
rm -rf _build/src
###############################
# tags
OTAGS=otags
# otags don't manage to parse gnuplotRif.ml
NO_TAGS=gnuplotRif.ml
tags:
$(OTAGS) -v $(shell ocamlc -where)/*.mli $(shell ls src/*.ml | grep -v $(NO_TAGS))
BIN_INSTALL_DIR=$(HOSTTYPE)/bin
cpcomp:
cp `which lus2lic$(EXE)` $(BIN_INSTALL_DIR) || true
cp `which lus2ec` $(BIN_INSTALL_DIR) || true
......@@ -44,25 +110,8 @@ cpcomp:
cp `which simec$(EXE)` $(BIN_INSTALL_DIR) || true
clean:
cd polka; make clean; cd ..
cd GBDDML; make clean; cd ..
cd source; make clean; cd ..
cleanall:clean
rm -f pre_release/$(HOSTTYPE)/include/*|| true
rm -f pre_release/$(HOSTTYPE)/lib/*|| true
rm -f pre_release/$(HOSTTYPE)/include/*|| true
rm -f working/$(HOSTTYPE)/include/* || true
rm -f working/$(HOSTTYPE)/lib/*|| true
rm -f working/$(HOSTTYPE)/include/*|| true
bisect-test: gen_version
cd source/; make lucky && ./Lucky/lucky ~/t.luc
.PHONY: test
test:
.PHONY: test slink
test: slink cpcomp
cd examples && make test
###############################
......
......@@ -23,9 +23,9 @@ SHA:=`git log -1 --pretty=format:"%h"`
gen_version:
cd $(LURETTE_PATH) ; \
rm -f source/version.ml ; \
echo "let str=\"$(VERSION)\"" > source/common/version.ml ; \
echo "let sha=\"$(SHA)\"" >> source/common/version.ml ; \
rm -f src/version.ml ; \
echo "let str=\"$(VERSION)\"" > lutin/src/version.ml ; \
echo "let sha=\"$(SHA)\"" >> lutin/src/version.ml ; \
rm -f version.tex ; \
date +VERSION_DATE=%d-%m-%y > version.tex ; \
echo "\\\newcommand{\\\version}{$(VERSION)}" > doc/version.tex ; \
......
OASISFormat: 0.4
Name: Lutin
Version: 1.0
Authors: Erwan Jahier
Maintainers: erwan.jahier@imag.fr
License: PROP
Plugins: DevFiles (0.4), META (0.4)
Synopsis: Lutin: modeling stochastic reactive systems.
Homepage: http://www-verimag.imag.fr/Lutin.html
OCamlVersion: >= 4.01
Description:
Lutin is a language to model stochastic reactive systems.
It has been initially designed to model environments and perform
automated testing of reactive systems with Lurette.
BuildTools: ocamlbuild
#PreBuildCommand: make gen_version
Executable lutin
Path: lutin/src
MainIs: main.ml
BuildDepends: str,unix,num,rdbg-plugin,liblutin,ezdl,gbddml,polka,camlp4,camlidl
Build: true
Install:true
CompiledObject: native
CClib: -lcamlidl
Library lutin
XMETADescription: Provides an API to call Lutin from ocaml (and rdbg)
Path: lutin/src
Modules: LutinRun
BuildDepends: str,unix,num,rdbg-plugin,liblutin,ezdl,gbddml,polka,camlp4
Install:true
CompiledObject: native
XMETAEnable: true
InternalModules: Auto2Lucky,AutoGen,Bddd,CheckEnv,CheckType,CkIdentInfo,CkTypeEff,CoAlgExp,CoIdent,CoTraceExp,Constraint,Draw,Exp,ExpEval,Expand,ExprUtil,FGen,Fair_bddd,Formula_to_bdd,GenOcamlGlue,Glue,Gne,Guard,Lexeme,LoopWeights,Luc2alice,Luc2c,LucFGen,Lucky,LutErrors,LutExe,LutLexer,LutParser,LutPredef,LutProg,LutVersion,Main,MainArg,Ne,Parsers,Poly_draw,Polyhedron,Prevar,Prog,Reactive,Rif,Sol_nb,Solver,Store,Syntaxe,SyntaxeDump,Thickness,Type,Util,Utils,Value,Var,Verbose,Version
# DllLib: libgmp.so dllcamlidl.so
Library lut4c
XMETADescription: Calling Lutin from C XXX can oasis do that ?
# XXX providing C+ml file migth be enough ?
Path: lutin/src
Modules: Lut4c
FindlibParent: lutin
BuildDepends: str,unix,num,rdbg-plugin,liblutin,ezdl,gbddml,polka,camlp4
Install: true
CSources: lut4c_stubs.h,lut4c_stubs.c
CCOpt: -fPIC
Library liblutin
Path: Liblutin/src
Modules: Liblutin
Install: true
CSources: liblutin.h,liblutin_c.c,liblutin_stubs.c
CCOpt: -fPIC -I$pkg_camlidl
Executable lurettetop_exe
Path: ltop/src
MainIs: lurettetop.ml
BuildDepends: num,str,unix,dynlink,rdbg-plugin,ezdl,lustre-v6,lutin,gbddml,polka,camlp4,camlidl
Build: true
Install:true
CompiledObject: native
CClib: -lcamlidl
CCOpt: -fPIC
Library ezdl
XMETADescription: ezdl: easy dynamic linking of C functions from ocaml
Path: EZDL
Modules: Ezdl
Install: true
CSources: Ezdl_c.c,Inspect_c.c
CCOpt: -fPIC
Library gbddml
XMETADescription: gbddml: the Verimag bdd library
Path: gbddml
Modules: Bdd
Install: true
CSources: gbdd_cml.c, gbdd.c, gbdd.h
CCOpt: -x c++ -g -O0 -fno-operator-names -fPIC -I$pkg_camlidl
CClib: -lstdc++
Library polka
XMETADescription: polka: convex polyhedron library by Bertrand Jeannet (now part of apron)
Path: polka
Modules: Polka,PolkaIO,Vector,Matrix,Poly,Polka_parser,Polka_lexer
BuildDepends: gmp
Install: true
CSources: pkint.h, config.h,
polka.h, internal.h, bit.h, satmat.h, cherni.h,
vector.h, matrix.h, poly.h, polka_caml.h,
polka_c.c, internal.c, bit.c, satmat.c, cherni.c,
vector_c.c, matrix_c.c, poly_c.c,
vector_caml.c, matrix_caml.c, poly_caml.c, polka_caml.c
CCOpt: -O3 -fPIC -DPOLKA_NUM=3 -I$pkg_camlidl
# should be part of rdbg?
Executable "check-rif"
Path: ltop/src
MainIs: checkRif.ml
BuildDepends: num,str,unix,rdbg-plugin,ezdl,lustre-v6
Build: true
Install:true
CompiledObject: native
CCOpt: -fPIC
# OASIS_START
# DO NOT EDIT (digest: 541237c860acc9505d2ac0799be32037)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
true: annot, bin_annot
<**/.svn>: -traverse
<**/.svn>: not_hygienic
".bzr": -traverse
".bzr": not_hygienic
".hg": -traverse
".hg": not_hygienic
".git": -traverse
".git": not_hygienic
"_darcs": -traverse
"_darcs": not_hygienic
# Library liblutin
"Liblutin/src/liblutin.cmxs": use_liblutin
<Liblutin/src/*.ml{,i,y}>: oasis_library_liblutin_ccopt
"Liblutin/src/liblutin_c.c": oasis_library_liblutin_ccopt