Commit | Line | Data |
---|---|---|
abad11c5 C |
1 | #! /bin/sh -e |
2 | ||
3 | set -e | |
4 | ||
5 | # This wrapper is a work-around to fool ocamlbuild to | |
6 | # use menhir but actually using ocamlyacc for some files. | |
7 | # Since this wrapper makes some assumptions about how | |
8 | # ocamlbuild works, it may break in the future. | |
9 | # In particular: the paths to the files may change. | |
10 | ||
11 | # $1: path to menhir | |
12 | # $2: path to ocamlyacc | |
13 | ||
14 | OCAMLYACC="$1" | |
15 | MENHIR="$2" | |
16 | shift 2 | |
17 | ||
18 | case "$@" in | |
19 | ||
20 | # use ocamlyacc for parsing_c/parsing_c.mly | |
21 | *raw-depend*parsing_c/parser_c.mly*) | |
22 | # echo "Notice: using ocamlyacc instead of menhir: skipping apriori dependency generation" 1>&2 | |
23 | ;; | |
24 | *parsing_c/parser_c.mly*) | |
25 | # echo "Notice: invoking ocamlyacc instead of menhir." 1>&2 | |
26 | exec $OCAMLYACC parsing_c/parser_c.mly | |
27 | ;; | |
28 | ||
29 | # execute with menhir | |
30 | *) | |
31 | exec $MENHIR "$@" | |
32 | ;; | |
33 | esac |