examples: fix oput build on windows
[ocurl.git] / examples / Makefile.in
blob55b4a15f9dcc79bb860b6107ac1a6b28a7cf6ea9
1 ###
2 ### @configure_input@
3 ###
5 .PHONY: clean
6 .PRECIOUS: %.cmx %.cmo %.cmi
7 .SUFFIXES: .ml .mli .cmx .cmi .cmo
9 OCBYTE = @OCAMLC@ -thread
10 OCOPT = @OCAMLOPT@ -thread
11 FINDLIB = @OCAMLFIND@
13 FLAGS = -g -I ..
14 LFLAGS = -g -I .. -ccopt -L..
16 OCURLLIB = curl.cma unix.cma threads.cma
17 OCURLOPTLIB = curl.cmxa unix.cmxa threads.cmxa
19 TARGETS = ocurl ominimal ossl ocurl_test_threads opar test_cb_exn test_memory_leaks
20 ifneq (@OCAML_PKG_bytes@,no)
21 TARGETS += oput
22 endif
23 ifneq (@OCAML_PKG_lwt_unix@,no)
24 TARGETS += test_lwt_unit
25 ifneq (@OCAML_PKG_lwt_ppx@,no)
26 TARGETS += test_lwt
27 endif
28 endif
30 ifeq (@OCAMLBEST@,opt)
31 TARGETS += ocurl.opt ominimal.opt ossl.opt ocurl_test_threads.opt opar.opt test_cb_exn.opt test_memory_leaks.opt
32 ifneq (@OCAML_PKG_bytes@,no)
33 TARGETS += oput.opt
34 endif
35 ifneq (@OCAML_PKG_lwt_unix@,no)
36 TARGETS += test_lwt_unit.opt
37 ifneq (@OCAML_PKG_lwt_ppx@,no)
38 TARGETS += test_lwt.opt
39 endif
40 endif
41 endif
43 all: $(TARGETS)
45 FINDLIB_LWT_FLAGS=-linkpkg -package lwt.unix,lwt.ppx
47 test_lwt: ../curl.cma ../curl_lwt.cmo test_lwt.ml
48 $(FINDLIB) c -custom $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
50 test_lwt.opt: ../curl.cmxa ../curl_lwt.cmx test_lwt.ml
51 $(FINDLIB) opt $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
53 test_lwt_unit: ../curl.cma ../curl_lwt.cmo test_lwt_unit.ml
54 $(FINDLIB) c -custom $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
56 test_lwt_unit.opt: ../curl.cmxa ../curl_lwt.cmx test_lwt_unit.ml
57 $(FINDLIB) opt $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
59 oput: ../curl.cma oput.ml
60 $(FINDLIB) c -custom -package bytes,unix -linkpkg $(LFLAGS) $^ -o $@
62 oput.opt: ../curl.cmxa oput.ml
63 $(FINDLIB) opt -package bytes,unix -linkpkg $(LFLAGS) $^ -o $@
65 %: %.cmo ../curl.cma
66 $(OCBYTE) -custom $(LFLAGS) $(OCURLLIB) $< -o $@
68 %.opt: %.cmx ../curl.cmxa
69 $(OCOPT) $(LFLAGS) $(OCURLOPTLIB) $< -o $@
71 .ml.cmx:
72 $(OCOPT) -c $(FLAGS) $< -o $@
74 .mli.cmi:
75 $(OCBYTE) -c $(FLAGS) $< -o $@
77 .ml.cmo:
78 $(OCBYTE) -c $(FLAGS) $< -o $@
80 clean:
81 @rm -f $(TARGETS) *.cm* *.o *.a