aboutsummaryrefslogtreecommitdiffhomepage
path: root/build
blob: 6edc6b0f41c050e5988dcdfd09a36e289cad137e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

FLAGS=
OCAMLBUILD=ocamlbuild

check_config() {
 [ -f config/coq_config.ml ] || (echo "please run ./configure first"; exit 1)
 [ -L myocamlbuild_config.ml ] || ln -sf config/coq_config.ml myocamlbuild_config.ml
}

ocb()
{
  check_config
  $OCAMLBUILD $FLAGS $*
}

rule() {
  case $1 in
    clean)  ocb -clean && rm -rf bin/* && rm -f myocamlbuild_config.ml;;
    all)    ocb coq.otarget;;
    *)      ocb $1;;
  esac;
}

if [ $# -eq 0 ]; then
  rule all
else
  while [ $# -gt 0 ]; do
    rule $1;
    shift
  done
fi