(alias
 (name all)
 (deps test.bc
       test.exe
;       test.bc.c
       test.bc%{ext_obj}
       test.exe%{ext_obj}
       test.bc%{ext_dll}
       test%{ext_dll}
       static.bc
       static.exe))

(executable
 (name test)
 (modes (byte   exe          )
        (native exe          )
;        (byte   c            )
        (byte   object       )
        (native object       )
        (byte   shared_object)
        (native shared_object)))

(rule
 (targets static.exe)
 (deps test.exe%{ext_obj} static.c)
 (action (run %{cc} -o %{targets} -I %{ocaml_where} -I . %{deps}
          %{ocaml-config:native_c_libraries})))

(rule
 (targets static.bc)
 (deps test.bc%{ext_obj} static.c)
 (action (run %{cc} -o %{targets} -I %{ocaml_where} -I . %{deps}
          %{ocaml-config:bytecomp_c_libraries})))

;(rule
; (targets static.bc.c.exe)
; (deps test.bc.c static.c)
; (action (run %{cc} -o %{targets} -I %{ocaml_where} -I . %{deps}
;          %{ocaml-config:bytecomp_c_libraries} -L %{ocaml_where} -lcamlrun)))

(rule
 (targets dynamic.exe)
 (deps dynamic.c)
 (action (run %{cc} -o %{targets} %{deps} %{ocaml-config:native_c_libraries})))

(alias
 (name runtest)
 (action
  (run ./static.exe)))

(alias
 (name runtest)
 (action
  (run ./static.bc)))

;; This fails in travis.  Can't seem to find libcamlrun (see pull request #1229
;; for discussion)
;(alias
; (name runtest)
; (action
;  (run ./static.bc.c.exe)))

(alias
 (name   runtest)
 (deps   test.bc%{ext_dll})
 (action (run ./dynamic.exe ./%{deps})))

(alias
 (name   runtest)
 (deps   test%{ext_dll})
 (action (run ./dynamic.exe ./%{deps})))
