Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 13 additions & 205 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,215 +1,23 @@
# Makefile for ReactiveML
# Taken from Lucid-synchrone
# Organization : SPI team, LIP6 laboratory, University Paris 6

include configure-tools/version
include config

all: config-stamp
(cd compiler; touch .depend; $(MAKE) depend; $(MAKE) $(TARGET))
(cd stdlib; $(MAKE) all)
(cd interpreter; touch .depend; $(MAKE) depend; $(MAKE) all)
(cd toplevel; $(MAKE) all)
(cd tools; $(MAKE) $(TARGET))
build:
echo "(* This file is generated *)" > compiler/global/version.ml
echo "let version = \"$(VERSION)\"" >> compiler/global/version.ml
echo "let stdlib = \"$(LIBDIR)\"" >> compiler/global/version.ml
dune build stdlib
RML_RECOMPILE_RZI=0 dune build compiler tools interpreter toplevel

config-stamp:
./configure
touch $@
test: build
dune runtest

toplevel: FORCE
(cd toplevel; $(MAKE) all)

toplevel-install:
(cd toplevel; $(MAKE) install)


opt: TARGET := opt
opt: all

byte: TARGET := byte
byte: all

.PHONY: install

install:
(cd compiler; $(MAKE) install)
(cd stdlib; $(MAKE) install)
(cd interpreter; $(MAKE) install)
(cd man; $(MAKE) install)
(cd emacs; $(MAKE) install)
(cd toplevel; $(MAKE) install)
(cd tools; $(MAKE) install)

checkinstall: config
checkinstall -D --deldoc=yes --deldesc=yes --nodoc -y --install=no
install: build
dune install

uninstall:
(cd compiler; $(MAKE) uninstall)
(cd stdlib; $(MAKE) uninstall)
(cd interpreter; $(MAKE) uninstall)
(cd man; $(MAKE) uninstall)
(cd emacs; $(MAKE) uninstall)
(cd toplevel; $(MAKE) uninstall)
(cd tools; $(MAKE) uninstall)


### BEGIN Patch from Serge Leblanc

install.findlib:
@echo "Install ReactiveML interpreter in ocamlfind hierarchy."
@(echo "version = \"$(VERSION)\"" > ./META)
@(cat ./configure-tools/META.in >> ./META)
- [ ! -e ./rmllib.a ] && \
ln -s ./interpreter/rmllib.a ./rmllib.a
- [ ! -e ./rmllib.cma ] && \
ln -s ./interpreter/rmllib.cma ./rmllib.cma
- [ ! -e ./rmllib.cmxa ] && \
ln -s ./interpreter/rmllib.cmxa ./rmllib.cmxa
- [ -r ./META -a -r ./rmllib.a -a -r ./rmllib.cma -a -r ./rmllib.cmxa ] && \
ocamlfind install rmlc ./META ./rmllib.a ./rmllib.cma ./rmllib.cmxa
- rm -rf rmllib.a rmllib.cma rmllib.cmxa

uninstall.findlib:
ocamlfind remove rmlc

### END


doc: dvi
dvi:
(cd doc; $(MAKE) dvi)
html:
(cd doc; $(MAKE) html)

wc:
(cd compiler;$(MAKE) wc)
(cd interpreter; $(MAKE) wc)
(cd toplevel; $(MAKE) wc)
(cd tools; $(MAKE) wc)
dune uninstall

clean:
(cd compiler;$(MAKE) clean)
(cd stdlib; $(MAKE) clean)
(cd interpreter; $(MAKE) clean)
(cd toplevel; $(MAKE) clean)
(cd tools; $(MAKE) clean)
(cd man; $(MAKE) clean)
(cd doc; $(MAKE) clean)
(cd patch; $(MAKE) clean)
(cd examples; $(MAKE) clean)

realclean: clean-distrib
(cd compiler;$(MAKE) realclean)
(cd stdlib; $(MAKE) realclean)
(cd interpreter; $(MAKE) realclean)
(cd toplevel; $(MAKE) realclean)
(cd tools; $(MAKE) realclean)
(cd man; $(MAKE) realclean)
(cd doc; $(MAKE) realclean)
(cd patch; $(MAKE) realclean)
(cd examples; $(MAKE) realclean)
rm -rf META
rm -rf config config-stamp Makefile.common distrib/rml/rmlc.in distrib/rml/Makefile *~
touch config
rm -rf configure-tools/rmlbuild.config

cleanall: realclean

# Making distribution
DATE=`date "+%Y-%m-%d"`

public-distrib:
touch config
$(MAKE) realclean
mkdir -p distrib/rml-$(VERSION)-$(DATE)
cp -r compiler interpreter stdlib toplevel tools emacs doc man examples \
distrib/rml-$(VERSION)-$(DATE)
cp -r configure configure-tools patch Makefile CHANGES INSTALL LICENSE \
distrib/rml-$(VERSION)-$(DATE)
mkdir -p distrib/rml-$(VERSION)-$(DATE)/distrib
cp -r distrib/rml distrib/Makefile.byte distrib/Makefile.opt \
distrib/rmlc.in.byte distrib/rmlc.in.opt \
distrib/rml-$(VERSION)-$(DATE)/distrib
(cd distrib/rml-$(VERSION)-$(DATE)/patch; \
$(MAKE) public-distrib)
(cd distrib; \
tar --exclude=CVS --exclude=.svn --exclude=.git -zcvf rml-$(VERSION)-$(DATE).tar.gz rml-$(VERSION)-$(DATE); \
rm -rf rml-$(VERSION)-$(DATE); \
mv rml-$(VERSION)-$(DATE).tar.gz ..)


source-distrib:
touch config
$(MAKE) realclean
mkdir -p distrib/rml-$(VERSION)-$(DATE)
cp -r compiler interpreter stdlib toplevel tools emacs doc man examples \
distrib/rml-$(VERSION)-$(DATE)
cp -r configure configure-tools patch Makefile CHANGES INSTALL LICENSE \
distrib/rml-$(VERSION)-$(DATE)
mkdir -p distrib/rml-$(VERSION)-$(DATE)/distrib
cp -r distrib/rml distrib/Makefile.byte distrib/Makefile.opt \
distrib/rmlc.in.byte distrib/rmlc.in.opt \
distrib/rml-$(VERSION)-$(DATE)/distrib
(cd distrib; \
tar --exclude=CVS --exclude=.svn --exclude=.git -zcvf rml-$(VERSION)-$(DATE).tar.gz rml-$(VERSION)-$(DATE); \
rm -rf rml-$(VERSION)-$(DATE); \
mv rml-$(VERSION)-$(DATE).tar.gz ..)

binary-distrib: binary-distrib.opt

binary-distrib.opt: clean-distrib
touch config
$(MAKE) realclean
./configure
(cd compiler; touch .depend; $(MAKE) depend; $(MAKE) opt)
(cd stdlib; $(MAKE) all)
(cd interpreter; $(MAKE) all)
(cd toplevel; $(MAKE) all)
(cd tools; $(MAKE) opt)
(cd distrib/rml/; \
mkdir bin lib lib/rml; \
cp ../../compiler/rmlc.opt bin/rmlc.opt ; \
cp ../../toplevel/rmltop bin/rmltop ; \
cp ../../stdlib/*.rzi ../../stdlib/*.rmli lib/rml ; \
cp ../../interpreter/*.cma ../../interpreter/*.cmxa ../../interpreter/*.a ../../interpreter/*.cmi lib/rml ; \
cp ../../toplevel/*.cmo ../../toplevel/*.cmi lib/rml ; \
cp ../../tools/rmldep/rmldep.opt bin/rmldep ; \
cp -r ../../emacs . ; \
cp ../Makefile.opt Makefile; \
cp ../rmlc.in.opt rmlc.in; \
cd ..; \
tar --exclude=CVS --exclude=.svn --exclude=.git -zcvf rml-`../compiler/rmlc -version`.opt.tar.gz rml; \
mv rml-`../compiler/rmlc -version`.opt.tar.gz ..)

binary-distrib.byte: clean-distrib
touch config
$(MAKE) realclean
./configure
(cd compiler; touch .depend; $(MAKE) depend; $(MAKE) byte)
(cd stdlib; $(MAKE) all)
(cd interpreter; $(MAKE) all)
(cd toplevel; $(MAKE) all)
(cd tools; $(MAKE) all)
(cd distrib/rml/ ; \
mkdir bin lib lib/rml ; \
cp ../../compiler/rmlc.byte bin/rmlc.byte ; \
cp ../../toplevel/rmltop bin/rmltop ; \
cp ../../stdlib/*.rzi ../../stdlib/*.rmli lib/rml ; \
cp ../../interpreter/*.cma ../../interpreter/*.cmxa ../../interpreter/*.a ../../interpreter/*.cmi lib/rml ; \
cp ../../toplevel/*.cmo ../../toplevel/*.cmi lib/rml ; \
cp ../../tools/rmldep/rmldep.byte bin/rmldep ; \
cp -r ../../emacs . ; \
cp ../Makefile.byte Makefile ; \
cp ../rmlc.in.byte rmlc.in ; \
cd ..; tar --exclude=CVS --exclude=.svn --exclude=.git -zcvf rml-`../compiler/rmlc -version`.byte.tar.gz rml ; \
mv rml-`../compiler/rmlc -version`.byte.tar.gz ..)

clean-distrib:
rm -rf distrib/rml/bin \
distrib/rml/lib \
distrib/rml/emacs \
distrib/rml/man
- rm -f rml-`./compiler/rmlc -version`.*.tar.gz
rm -f rml-$(VERSION)-????-??-??.tar.gz

FORCE:
rm -f compiler/global/version.ml
dune clean
87 changes: 87 additions & 0 deletions compiler/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
(rule (target rmlc.ml) (action (copy main/rmlc.ml rmlc.ml)))
(rule (target compiler.ml) (action (copy main/compiler.ml compiler.ml)))
(rule (target rml_errors.ml) (action (copy main/rml_errors.ml rml_errors.ml)))
(rule (target options.ml) (action (copy main/options.ml options.ml)))
(rule (target configure.ml) (action (copy main/configure.ml configure.ml)))
(rule (target interactive.ml) (action (copy main/interactive.ml interactive.ml)))

(rule (target rml_misc.ml) (action (copy global/rml_misc.ml rml_misc.ml)))
(rule (target version.ml) (action (copy global/version.ml version.ml)))
(rule (target modules.ml) (action (copy global/modules.ml modules.ml)))
(rule (target global_ident.ml) (action (copy global/global_ident.ml global_ident.ml)))
(rule (target rml_ident.ml) (action (copy global/rml_ident.ml rml_ident.ml)))
(rule (target rml_asttypes.ml) (action (copy global/rml_asttypes.ml rml_asttypes.ml)))
(rule (target global.ml) (action (copy global/global.ml global.ml)))
(rule (target def_modules.ml) (action (copy global/def_modules.ml def_modules.ml)))
(rule (target rzi.ml) (deps ../configure-tools/embedrzi.exe (env_var RML_RECOMPILE_RZI)) (action (with-stdout-to rzi.ml (run ../configure-tools/embedrzi.exe ..))))
(rule (target warnings.ml) (action (copy global/warnings.ml warnings.ml)))
(rule (target symbol_table.ml) (action (copy global/symbol_table.ml symbol_table.ml)))
(rule (target initialization.ml) (action (copy global/initialization.ml initialization.ml)))

(rule (target def_types.ml) (action (copy typing/def_types.ml def_types.ml)))
(rule (target reactivity_check.ml) (action (copy typing/reactivity_check.ml reactivity_check.ml)))
(rule (target reactivity_effects.ml) (action (copy typing/reactivity_effects.ml reactivity_effects.ml)))
(rule (target rml_types.ml) (action (copy typing/rml_types.ml rml_types.ml)))
(rule (target types_printer.ml) (action (copy typing/types_printer.ml types_printer.ml)))
(rule (target typing_errors.ml) (action (copy typing/typing_errors.ml typing_errors.ml)))
(rule (target typing.ml) (action (copy typing/typing.ml typing.ml)))

(rule (target def_static.ml) (action (copy static/def_static.ml def_static.ml)))
(rule (target static_errors.ml) (action (copy static/static_errors.ml static_errors.ml)))
(rule (target static_printer.ml) (action (copy static/static_printer.ml static_printer.ml)))
(rule (target static.ml) (action (copy static/static.ml static.ml)))

(rule (target parse_ident.ml) (action (copy parsing/parse_ident.ml parse_ident.ml)))
(rule (target parse_ast.ml) (action (copy parsing/parse_ast.ml parse_ast.ml)))
(rule (target rml_syntaxerr.ml) (action (copy parsing/rml_syntaxerr.ml rml_syntaxerr.ml)))
(rule (target parse_printer.ml) (action (copy parsing/parse_printer.ml parse_printer.ml)))
(rule (target location.ml) (action (copy parsing/location.ml location.ml)))
(rule (target linenum.mll) (action (copy parsing/linenum.mll linenum.mll)))
(rule (target rml_parse.ml) (action (copy parsing/rml_parse.ml rml_parse.ml)))
(rule (target rml_parser.mly) (action (copy parsing/rml_parser.mly rml_parser.mly)))
(rule (target rml_lexer.mll) (action (copy parsing/rml_lexer.mll rml_lexer.mll)))

(rule (target binding_errors.ml) (action (copy reac/binding_errors.ml binding_errors.ml)))
(rule (target parse2reac.ml) (action (copy reac/parse2reac.ml parse2reac.ml)))
(rule (target reac_ast.ml) (action (copy reac/reac_ast.ml reac_ast.ml)))
(rule (target reac_misc.ml) (action (copy reac/reac_misc.ml reac_misc.ml)))
(rule (target reac2reac.ml) (action (copy reac/reac2reac.ml reac2reac.ml)))
(rule (target rml_annot.ml) (action (copy reac/rml_annot.ml rml_annot.ml)))

(rule (target reac_optimization.ml) (action (copy optimization/reac_optimization.ml reac_optimization.ml)))

(rule (target instantaneous_loop.ml) (action (copy other_analysis/instantaneous_loop.ml instantaneous_loop.ml)))
(rule (target wf_rec.ml) (action (copy other_analysis/wf_rec.ml wf_rec.ml)))

(rule (target lk_ast.ml) (action (copy lk/lk_ast.ml lk_ast.ml)))
(rule (target lk_misc.ml) (action (copy lk/lk_misc.ml lk_misc.ml)))
(rule (target reac2lk.ml) (action (copy lk/reac2lk.ml reac2lk.ml)))

(rule (target lco_ast.ml) (action (copy lco/lco_ast.ml lco_ast.ml)))
(rule (target lco_misc.ml) (action (copy lco/lco_misc.ml lco_misc.ml)))
(rule (target reac2lco.ml) (action (copy lco/reac2lco.ml reac2lco.ml)))

(rule (target caml_ast.ml) (action (copy caml/caml_ast.ml caml_ast.ml)))
(rule (target caml_misc.ml) (action (copy caml/caml_misc.ml caml_misc.ml)))
(rule (target caml2caml.ml) (action (copy caml/caml2caml.ml caml2caml.ml)))
(rule (target lco2caml.ml) (action (copy caml/lco2caml.ml lco2caml.ml)))
(rule (target lk2caml.ml) (action (copy caml/lk2caml.ml lk2caml.ml)))
(rule (target print_caml_src.ml) (action (copy caml/print_caml_src.ml print_caml_src.ml)))

(rule (target external.ml) (action (copy external/external.ml external.ml)))
(rule (target lucky.ml) (action (copy external/lucky.ml lucky.ml)))
(rule (target lucky_errors.ml) (action (copy external/lucky_errors.ml lucky_errors.ml)))

(ocamllex
(modules rml_lexer linenum))

(menhir
(modules rml_parser))


(executables
(names rmlc))

(install
(files (rmlc.exe as rmlc))
(section bin))
2 changes: 1 addition & 1 deletion compiler/global/global.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

(* $Id$ *)

open Rml_misc
(* open Rml_misc unused open *)

(* values in the symbol table *)

Expand Down
2 changes: 2 additions & 0 deletions compiler/main/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ let compile_implementation module_name filename =
"(* "^(Array.fold_right (fun s cmd -> s^" "^cmd) Sys.argv " ")^
"*)\n\n");
(* selection of the interpreter *)
output_string out_chan ("open Rmllib;;\n");
output_string out_chan ("open "^ !interpreter_impl ^";;\n");

(* the implementation *)
Expand Down Expand Up @@ -452,6 +453,7 @@ let compile_interface parse module_name filename filename_end =
begin
let out_chan = open_out obj_name in
(* selection of the interpreter *)
output_string out_chan ("open Rmllib;;\n");
output_string out_chan ("open "^ !interpreter_impl ^";;\n");

(* the interface *)
Expand Down
Loading