58 lines
2.0 KiB
Plaintext
58 lines
2.0 KiB
Plaintext
(ocamllex LexToken)
|
|
(ocamllex Lexer)
|
|
|
|
(menhir
|
|
(merge_into Parser)
|
|
(modules ParToken Parser)
|
|
(flags -la 1 --explain --external-tokens LexToken))
|
|
|
|
(executables
|
|
(names LexerMain ParserMain)
|
|
(public_names ligo-lexer ligo-parser)
|
|
(package ligo-parser)
|
|
(modules_without_implementation Error)
|
|
(libraries getopt hex str uutf zarith))
|
|
|
|
;; Les deux directives (rule) qui suivent sont pour le dev local.
|
|
;; Il suffit de faire "dune build Parser.exe" pour avoir un Parser.exe dans le dossier.
|
|
;; Pour le purger, il faut faire "dune clean".
|
|
(rule
|
|
(targets Parser.exe)
|
|
(deps ParserMain.exe)
|
|
(action (copy ParserMain.exe Parser.exe))
|
|
(mode promote-until-clean))
|
|
|
|
(rule
|
|
(targets Lexer.exe)
|
|
(deps LexerMain.exe)
|
|
(action (copy LexerMain.exe Lexer.exe))
|
|
(mode promote-until-clean))
|
|
|
|
(rule
|
|
(targets .git_main_dir)
|
|
(deps)
|
|
(action (run "sh" "-c" "if test -d ../../.git; then printf %s '../../.git' > .git_main_dir; else cat ../../.git | sed -e 's/^gitdir: //' | sed -e 's|$|/../..|' > .git_main_dir; fi")))
|
|
|
|
(rule
|
|
(targets .git_worktree_dir)
|
|
(deps)
|
|
(action (run "sh" "-c" "if test -d ../../.git; then printf %s '../../.git' > .git_worktree_dir; else cat ../../.git | sed -e 's/^gitdir: //' > .git_worktree_dir; fi")))
|
|
|
|
(rule
|
|
(targets .gitHEAD)
|
|
(deps .git_main_dir .git_worktree_dir)
|
|
;; TODO: re-compute .git_main_dir, just in case (since it does not have a dependency on .git)
|
|
(action (run "sh" "-c" "ln -s \"$(cat .git_worktree_dir)/HEAD\" .gitHEAD")))
|
|
|
|
(rule
|
|
(targets Version.gitHEAD)
|
|
(deps .gitHEAD)
|
|
;; TODO: re-compute .git_main_dir, just in case (since it does not have a dependency on .git)
|
|
(action (run "sh" "-c" "if git symbolic-ref HEAD >/dev/null 2>&1; then ln -s \"$(cat .git_main_dir)/$(git symbolic-ref HEAD)\" Version.gitHEAD; else ln -s \"$(cat .git_worktree_dir)/HEAD\" Version.gitHEAD; fi")))
|
|
|
|
(rule
|
|
(targets Version.ml)
|
|
(deps Version.gitHEAD)
|
|
(action (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(cat Version.gitHEAD)\" > Version.ml"))
|
|
(mode promote-until-clean))
|