/trunk/Examples/test-suite/ocaml/makedebugtop
Shell | 21 lines | 12 code | 2 blank | 7 comment | 1 complexity | da4f05ee6d1382f3a0534943c7a95467 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- #!/bin/sh
- #
- # Usage: makedebugtop test_name.c[pp]test
- #
- # Creates an ocaml toplevel for debugging based on a .cpptest or .ctest
- # file.
- #
- OCAMLINC=/usr/local/lib/ocaml
- swigtest=$1
- thetest=`echo $1 | sed -e 's/\.c[p]*test//g'`
- cppopt=""
- if echo $swigtest | grep -s cpptest ; then
- cppopt=-xc++
- fi
- echo "Making the test"
- make $swigtest
- echo "Building ${thetest}_top"
- gcc -c -g $cppopt -I$OCAMLINC ${thetest}_wrap.c
- ocamlmktop -cclib -g -custom swig.cmo ${thetest}_wrap.o ${thetest}.cmo -o ${thetest}_top -cclib -lstdc++