diff --git a/Makefile b/Makefile index c6e21f45d25ee4bfd2b0de60884a114402c883ac..27d60152bb58286a9f73854cd7c28af58d3cb0d3 100644 --- a/Makefile +++ b/Makefile @@ -1,227 +1,58 @@ -all: doit - - -include ./Makefile.common - - -COMON_SOURCES = \ - $(OBJDIR)/verbose.ml \ - $(OBJDIR)/verbose.mli \ - - -SOC_SOURCES = \ - $(OBJDIR)/soc.ml \ - $(OBJDIR)/socUtils.mli \ - $(OBJDIR)/socUtils.ml \ - $(OBJDIR)/socPredef.mli \ - $(OBJDIR)/socPredef.ml \ - $(OBJDIR)/toposort.mli \ - $(OBJDIR)/toposort.ml \ - $(OBJDIR)/actionsDeps.mli \ - $(OBJDIR)/actionsDeps.ml \ - $(OBJDIR)/lic2soc.mli \ - $(OBJDIR)/lic2soc.ml \ - $(OBJDIR)/socExecValue.mli \ - $(OBJDIR)/socExecValue.ml \ - $(OBJDIR)/socExecEvalPredef.mli \ - $(OBJDIR)/socExecEvalPredef.ml \ - $(OBJDIR)/socExec.mli \ - $(OBJDIR)/socExec.ml - - -COMPILER_SOURCES = \ - $(OBJDIR)/lv6util.ml \ - $(OBJDIR)/filenameExtras.mli \ - $(OBJDIR)/filenameExtras.ml \ - $(OBJDIR)/lv6MainArgs.ml \ - $(OBJDIR)/lv6MainArgs.mli \ - $(OBJDIR)/ident.mli \ - $(OBJDIR)/ident.ml \ - $(OBJDIR)/lxm.mli \ - $(OBJDIR)/lxm.ml \ - $(OBJDIR)/lv6errors.ml \ - $(OBJDIR)/astPredef.ml \ - $(OBJDIR)/astCore.ml \ - $(OBJDIR)/astV6.ml \ - $(OBJDIR)/astV6Dump.mli \ - $(OBJDIR)/astV6Dump.ml \ - $(OBJDIR)/astRecognizePredef.mli \ - $(OBJDIR)/astRecognizePredef.ml \ - $(OBJDIR)/lv6parserUtils.ml \ - $(OBJDIR)/lv6parser.mly \ - $(OBJDIR)/lv6lexer.mll \ - $(OBJDIR)/astInstanciateModel.mli \ - $(OBJDIR)/astInstanciateModel.ml \ - $(OBJDIR)/astTabSymbol.mli \ - $(OBJDIR)/astTabSymbol.ml \ - $(OBJDIR)/astTab.mli \ - $(OBJDIR)/astTab.ml \ - $(OBJDIR)/lic.ml \ - $(OBJDIR)/idSolver.ml \ - $(OBJDIR)/licName.mli \ - $(OBJDIR)/licName.ml \ - $(OBJDIR)/licDump.ml \ - $(OBJDIR)/licPrg.mli \ - $(OBJDIR)/licPrg.ml \ - $(SOC_SOURCES) \ - $(OBJDIR)/unifyType.mli \ - $(OBJDIR)/unifyType.ml \ - $(OBJDIR)/unifyClock.mli \ - $(OBJDIR)/unifyClock.ml \ - $(OBJDIR)/licEvalType.mli \ - $(OBJDIR)/licEvalType.ml \ - $(OBJDIR)/licEvalConst.mli \ - $(OBJDIR)/licEvalConst.ml \ - $(OBJDIR)/licEvalClock.mli \ - $(OBJDIR)/licEvalClock.ml \ - $(OBJDIR)/evalConst.mli \ - $(OBJDIR)/evalConst.ml \ - $(OBJDIR)/evalType.mli \ - $(OBJDIR)/evalType.ml \ - $(OBJDIR)/evalClock.mli \ - $(OBJDIR)/evalClock.ml \ - $(OBJDIR)/licMetaOp.mli \ - $(OBJDIR)/licMetaOp.ml \ - $(OBJDIR)/ast2lic.mli \ - $(OBJDIR)/ast2lic.ml \ - $(OBJDIR)/misc.ml \ - $(OBJDIR)/l2lCheckLoops.mli \ - $(OBJDIR)/l2lCheckLoops.ml \ - $(OBJDIR)/l2lCheckOutputs.mli \ - $(OBJDIR)/l2lCheckOutputs.ml \ - $(OBJDIR)/l2lExpandArrays.mli \ - $(OBJDIR)/l2lExpandArrays.ml \ - $(OBJDIR)/l2lExpandNodes.mli \ - $(OBJDIR)/l2lExpandNodes.ml \ - $(OBJDIR)/l2lExpandMetaOp.ml \ - $(OBJDIR)/l2lExpandMetaOp.mli \ - $(OBJDIR)/l2lRmPoly.mli \ - $(OBJDIR)/l2lRmPoly.ml \ - $(OBJDIR)/l2lAliasType.mli \ - $(OBJDIR)/l2lAliasType.ml \ - $(OBJDIR)/l2lSplit.mli \ - $(OBJDIR)/l2lSplit.ml \ - $(OBJDIR)/licTab.ml \ - $(OBJDIR)/licTab.mli \ - $(OBJDIR)/compile.mli \ - $(OBJDIR)/compile.ml \ - -SOURCES = \ - $(OBJDIR)/lv6version.ml \ - $(COMON_SOURCES) \ - $(COMPILER_SOURCES) \ - $(OBJDIR)/main.ml - -LDBG_SOURCES = \ - $(OBJDIR)/lv6version.ml \ - $(COMPILER_SOURCES) - -# -# Be sure to build those files before doing something else -# since they are needed by $(RESULT) -PRE_TARGETS=$(OBJDIR)/lv6version.ml - -NOMLI_SOURCES=$(filter %.ml %.mll %.mly, $(SOURCES)) - -NOMLY_SOURCES=$(SOURCES:.mly=.ml) -MLONLY_SOURCES=$(NOMLY_SOURCES:.mll=.ml) +# oasis entry points -show: - git log --reverse --pretty=oneline | nl +build: setup.ml src/lv6version.ml + ocaml setup.ml -build -dot: - ocamldoc -I $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -dot -dot-reduce - dot -Tpdf ocamldoc.out > lus2lic.pdf - ocamldoc -I $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -dot -dot-reduce -dot-types - dot -Tpdf ocamldoc.out > lus2lic-types.pdf - xpdf lus2lic.pdf - xpdf lus2lic-types.pdf +setup.ml:_oasis + oasis setup -html: - ocamldoc -I $(OBJDIR) $(MLONLY_SOURCES) -d ocamldoc -html -keep-code +setup.data:configure +configure: setup.ml + ocaml setup.ml -configure --prefix $(LUSTREV6_PATH) --exec-prefix $(LUSTREV6_PATH)/$(HOSTTYPE) -nomli: - rm $(OBJDIR)/*.mli +test: build test/lurettetop + cd test; make test -debug: nomli dc +install: + ocaml setup.ml -install -ln: $(OBJDIR) $(SOURCES) +uninstall: + ocaml setup.ml -uninstall -doit: ln nc +reinstall: + ocaml setup.ml -reinstall -include $(OCAMLMAKEFILE) +clean: + ocaml setup.ml -clean -# Specific rule (lv6version) +distclean: + ocaml setup.ml -distclean -.PRECIOUS: $(OBJDIR)/lv6version.ml +include ./Makefile.version -$(OBJDIR)/lv6version.ml: Makefile - echo "(** Automatically generated from Makefile *) " > $@ - echo "let tool = \"lus2lic\"" >> $@ - echo "let branch = \"$(shell utils/get_branch_name)\"" >> $@ - echo "let commit = \"$(shell utils/get_commit_number)\"" >> $@ - echo "let sha_1 = \"$(shell utils/get_sha_1)"\">> $@ - echo "let str = (branch ^ \".\" ^ commit ^ \" (\" ^ sha_1 ^ \")\")">> $@ - echo "let maintainer = \"jahier@imag.fr\"">> $@ - -all: nc -lus2lic: - make all - make test +####################################################################################### # TEST, NON REGR. ETC... TESTDIR=./test .PHONY: diff test log -dif: - git --no-pager diff --color-words - -diff: - rm -f diff_lv6.diff; git diff --ignore-all-space > diff_lv6.diff ; ls -l diff_lv6.diff - -OTAGS=$(HOME)/bin/otags -tags: - $(OTAGS) -v $(shell $(OCAMLC) -where)/*.mli src/*.ml - -log: - rm -f lv6.log; git log > lv6.log test_nc: cd $(TESTDIR) ; make test ; cd $(curdir) -Clean: - rm -rf $(OBJDIR) - -test: test/lurettetop - cd $(TESTDIR) ; make +test: + cd $(TESTDIR) ; make ; make time cd $(curdir) - -ci: $(OBJDIR)/lv6version.ml - make test && git commit -F log && rm -f $(OBJDIR)/lv6version.ml - -cia: $(OBJDIR)/lv6version.ml - git commit -a -F log && rm -f $(OBJDIR)/lv6version.ml - - -amend: - git commit -a -F log --amend && rm -f $(OBJDIR)/lv6version.ml - -push: - git push git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git - -pull: - git pull git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git - - +# XXX use rdbg -lurette !!! # Compile and copy lurrettop from here because # (1) lurettetop uses lus2lic source (it embeds the V6 interpreter) # (2) the tests performed here uses lurettetop... test/lurettetop: ltop cp ~/lurette/bin/lurettetop test -ltop: scp +ltop: cd ~/lurette/source/ ; make ltop; make cp # copy (lus2lic -> lurette) the shared source to the lurette directory @@ -242,4 +73,59 @@ cp_comon_file: chmod u-w src/verbose.ml chmod u-w src/verbose.mli +####################################################################################### +# git entry points + +ci: + git commit -F log && rm -f src/lv6version.ml + +cia: src/lv6version.ml + git commit -a -F log && rm -f src/lv6version.ml + + +amend: + git commit -a -F log --amend && rm -f src/lv6version.ml + +push: + git push git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git + +pull: + git pull git+ssh://jahier@scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/git/lustre/lus2lic.git + +####################################################################################### +# misc + +show: + git log --reverse --pretty=oneline | nl + +dot: + ocamldoc src/*.ml -d ocamldoc -dot -dot-reduce + dot -Tpdf ocamldoc.out > lus2lic.pdf + ocamldoc src/*.ml -d ocamldoc -dot -dot-reduce -dot-types + dot -Tpdf ocamldoc.out > lus2lic-types.pdf + xpdf lus2lic.pdf + xpdf lus2lic-types.pdf + +html: + ocamldoc -I src/*.ml -d ocamldoc -html -keep-code + +debug: nomli dc + +all: nc +lus2lic: + make all + make test + +dif: + git --no-pager diff --color-words + +diff: + rm -f diff_lv6.diff; git diff --ignore-all-space > diff_lv6.diff ; ls -l diff_lv6.diff + +OTAGS=otags +tags: + $(OTAGS) -v $(shell $(OCAMLC) -where)/*.mli src/*.ml + +log: + rm -f lv6.log; git log > lv6.log diff --git a/Makefile.version b/Makefile.version new file mode 100644 index 0000000000000000000000000000000000000000..baeb0d92343a3b82c60dba5bfc38377a5ee428b6 --- /dev/null +++ b/Makefile.version @@ -0,0 +1,20 @@ + +# can oasis do all this stuff? +SHA:=`git log -1 --pretty=format:"%h"` +COMMIT_NB:=`git log --pretty=oneline | wc -l` + +VERSION:=1.0.$(COMMIT_NB) + +gen_version: + rm -f src/lv6version.ml + + +src/lv6version.ml: Makefile + echo "(** Automatically generated from Makefile *) " > $@ + echo "let tool = \"lus2lic\"" >> $@ + echo "let branch = \"$(shell utils/get_branch_name)\"" >> $@ + echo "let commit = \"$(shell utils/get_commit_number)\"" >> $@ + echo "let sha_1 = \"$(shell utils/get_sha_1)"\">> $@ + echo "let str = (branch ^ \".\" ^ commit ^ \" (\" ^ sha_1 ^ \")\")">> $@ + echo "let maintainer = \"jahier@imag.fr\"">> $@ + diff --git a/_oasis b/_oasis new file mode 100644 index 0000000000000000000000000000000000000000..b59a94bb517a1b25f5ba8ea13980e73ce8f367b9 --- /dev/null +++ b/_oasis @@ -0,0 +1,19 @@ +OASISFormat: 0.3 +Name: lus2lic +Version: 1 +Synopsis: The Lustre V6 compiler +Authors: Erwan Jahier and Pascal Raymond +License: LGPL-3 with OCaml linking exception +Synopsis: The Lustre V6 Verimag compiler +Homepage: http://www-verimag.imag.fr/lustre-v6.html +Description: The Lustre V6 Verimag compiler + +Executable lus2lic + Path: src + BuildTools: ocamlbuild + MainIs: main.ml + BuildDepends: str,unix,num,rdbg-plugin + Install:true + CompiledObject: native + + diff --git a/src/licDump.mli b/src/licDump.mli deleted file mode 100644 index 2eaf7291828bd3bab6f7a9c6f17ab21db77f4e79..0000000000000000000000000000000000000000 --- a/src/licDump.mli +++ /dev/null @@ -1,33 +0,0 @@ -(* Time-stamp: <modified the 24/04/2013 (at 17:41) by Erwan Jahier> *) - - -val string_of_node_key_rec : bool -> Lic.node_key -> string -val string_of_node_key_iter : Lic.node_key -> string -val node_of_node_exp_eff: Lic.node_exp -> string - -val string_of_const_eff : Lic.const -> string -val string_of_leff : Lic.left -> string - -val string_of_type_eff : Lic.type_ -> string -val string_of_type_eff4msg : Lic.type_ -> string -val string_of_type_eff_list : Lic.type_ list -> string -val string_of_type_eff_list4msg : Lic.type_ list -> string -val type_eff_list_to_string :Lic.type_ list -> string - -val type_decl: Ident.long -> Lic.type_ -> string -val const_decl: Ident.long -> Lic.const -> string - -val string_of_var_info_eff: Lic.var_info -> string -val string_of_var_info_eff4msg: Lic.var_info -> string -val type_string_of_var_info_eff: Lic.var_info -> string -val type_string_of_var_info_eff4msg: Lic.var_info -> string -val string_of_slice_info_eff : Lic.slice_info -> string - -(* used for error msgs *) -val string_of_clock_exp : AstCore.clock_exp -> string -val string_of_clock2 : Lic.clock -> string -val string_of_val_exp_eff : Lic.val_exp -> string -val string_of_val_exp_eff_core : Lic.val_exp_core -> string - -(* dump Lic.local_env *) -val dump_local_env : Lic.local_env -> unit diff --git a/src/lv6version.ml b/src/lv6version.ml new file mode 100644 index 0000000000000000000000000000000000000000..a3df66d57d349a9f6270cc57d4546a66e939926d --- /dev/null +++ b/src/lv6version.ml @@ -0,0 +1,7 @@ +(** Automatically generated from Makefile *) +let tool = "lus2lic" +let branch = "(no" +let commit = "423" +let sha_1 = "4610f3bbda8c7e2402c965e346b1c56f080f22db" +let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") +let maintainer = "jahier@imag.fr" diff --git a/test/Makefile b/test/Makefile index c07b5a024557b98b3f7a443939716ef37dac31ef..87013a04e1330d9b240f4c5d3e5c328db55daa1a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -45,6 +45,7 @@ prog: ssh $(TEST_MACHINE) "cd $(testdir) ; runtest --all --tool lus2lic --ignore non-reg.exp" || true clean: - rm -f *.ec *.lus *.lut *.cov *.gp *.rif *.out + rm -f *.ec *.lus *.lut *.cov *.gp *.rif *.out *.cov + diff --git a/test/lus2lic b/test/lus2lic index 793bff7b83c2116dafc27304f525ec5125d5b51d..55b000a54966b2a666f7679c6eeb4201f0abed8a 120000 --- a/test/lus2lic +++ b/test/lus2lic @@ -1 +1 @@ -../objlinux/lus2lic \ No newline at end of file +../main.native \ No newline at end of file diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 3b0ddec057580790850746d040f2005ea123c8aa..78eacb356c7a8d04aae875a874629b58fd6cde00 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,4 +1,4 @@ -Test Run By jahier on Mon Nov 25 10:24:12 2013 +Test Run By jahier on Thu Nov 28 11:04:59 2013 Native configuration is i686-pc-linux-gnu === lus2lic tests === @@ -1028,5 +1028,5 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman # of unexpected failures 76 # of unexpected successes 21 # of expected failures 37 -testcase ./lus2lic.tests/non-reg.exp completed in 101 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 104 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds diff --git a/test/lus2lic.time b/test/lus2lic.time index fb760bc9ae033f25a995d284af1de833c7b38fbf..0f5df5f1440b3e292964858ab3b3a5a855758d3b 100644 --- a/test/lus2lic.time +++ b/test/lus2lic.time @@ -1,2 +1,2 @@ -testcase ./lus2lic.tests/non-reg.exp completed in 101 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 104 seconds testcase ./lus2lic.tests/progression.exp completed in 0 seconds