File: cduce_mktop

package info (click to toggle)
cduce 0.4.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,836 kB
  • ctags: 3,143
  • sloc: ml: 20,402; xml: 5,376; makefile: 411; sh: 45
file content (53 lines) | stat: -rwxr-xr-x 815 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

FLAGS=
LINK=
NATIVE=true

while true; do
 case "$1" in
   -I)
    FLAGS="$FLAGS -I $2"
    shift
    shift
    ;;
   -p)
    FLAGS="$FLAGS -I `ocamlfind query $2`"
    LINK="$LINK -package $2"
    shift
    shift
    ;;
   -l)
    LINK="$LINK $2"
    shift
    shift
    ;;
  -byte)
    NATIVE=false
    shift
    ;;
  *)
    break
    ;;
 esac
done

TARG=$1
PRIMS=$2

if [ "${TARG}" = "" ] || [ "${PRIMS}" = "" ]; then
  echo "Usage: cduce_mktop [(-I path | -p package | -l unit.cmo/cma/cmx/cmxa) ...] <target> <primitive file>"
  exit 2
fi


if [ ${NATIVE} = "true" ]; then
 CAML=ocamlopt
else
 CAML=ocamlc
fi

echo "Effective flags for CDuce: $FLAGS"
echo "Effective flags for OCaml: $LINK"

exec ocamlfind $CAML -package cduce -o $TARG $FLAGS -linkpkg -pp "cduce --topstub $FLAGS" $LINK -impl $PRIMS