/trunk/Examples/test-suite/ocaml/makedebugtop

# · Shell · 21 lines · 12 code · 2 blank · 7 comment · 1 complexity · da4f05ee6d1382f3a0534943c7a95467 MD5 · raw file

  1. #!/bin/sh
  2. #
  3. # Usage: makedebugtop test_name.c[pp]test
  4. #
  5. # Creates an ocaml toplevel for debugging based on a .cpptest or .ctest
  6. # file.
  7. #
  8. OCAMLINC=/usr/local/lib/ocaml
  9. swigtest=$1
  10. thetest=`echo $1 | sed -e 's/\.c[p]*test//g'`
  11. cppopt=""
  12. if echo $swigtest | grep -s cpptest ; then
  13. cppopt=-xc++
  14. fi
  15. echo "Making the test"
  16. make $swigtest
  17. echo "Building ${thetest}_top"
  18. gcc -c -g $cppopt -I$OCAMLINC ${thetest}_wrap.c
  19. ocamlmktop -cclib -g -custom swig.cmo ${thetest}_wrap.o ${thetest}.cmo -o ${thetest}_top -cclib -lstdc++