minor
[ocurl.git] / examples / Makefile.in
blob45da28b7d9d36515528b128915d3d3c7329f8705
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 oput ominimal ossl ocurl_test_threads opar test_cb_exn test_memory_leaks
20 ifneq (@OCAML_PKG_lwt@,no)
21 ifneq (@OCAML_PKG_camlp4@,no)
22 TARGETS += test_lwt test_lwt_unit
23 endif
24 endif
26 ifeq (@OCAMLBEST@,opt)
27 TARGETS += ocurl.opt oput.opt ominimal.opt ossl.opt ocurl_test_threads.opt opar.opt test_cb_exn.opt test_memory_leaks.opt
28 ifneq (@OCAML_PKG_lwt@,no)
29 ifneq (@OCAML_PKG_camlp4@,no)
30 TARGETS += test_lwt.opt test_lwt_unit.opt
31 endif
32 endif
33 endif
35 all: $(TARGETS)
37 FINDLIB_LWT_FLAGS=-linkpkg -syntax camlp4o -package lwt.unix,lwt.syntax
39 test_lwt: ../curl.cma ../curl_lwt.cmo test_lwt.ml
40 $(FINDLIB) c -custom $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
42 test_lwt.opt: ../curl.cmxa ../curl_lwt.cmx test_lwt.ml
43 $(FINDLIB) opt $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
45 test_lwt_unit: ../curl.cma ../curl_lwt.cmo test_lwt_unit.ml
46 $(FINDLIB) c -custom $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
48 test_lwt_unit.opt: ../curl.cmxa ../curl_lwt.cmx test_lwt_unit.ml
49 $(FINDLIB) opt $(FINDLIB_LWT_FLAGS) $(LFLAGS) $^ -o $@
51 %: %.cmo ../curl.cma
52 $(OCBYTE) -custom $(LFLAGS) $(OCURLLIB) $< -o $@
54 %.opt: %.cmx ../curl.cmxa
55 $(OCOPT) $(LFLAGS) $(OCURLOPTLIB) $< -o $@
57 .ml.cmx:
58 $(OCOPT) -c $(FLAGS) $< -o $@
60 .mli.cmi:
61 $(OCBYTE) -c $(FLAGS) $< -o $@
63 .ml.cmo:
64 $(OCBYTE) -c $(FLAGS) $< -o $@
66 clean:
67 @rm -f $(TARGETS) *.cm* *.o *.a