5 .PHONY
: all targets examples
install clean distclean depend release doc build
test reinstall
7 .SUFFIXES
: .ml .mli .cmx .cmi .cmo .cmxa .cma .c @EXT_OBJ@
9 INSTALLDIR
= @INSTALLDIR@
11 INSTALLDATA
= @INSTALL_DATA@
17 OCAMLMKLIB
= @OCAMLMKLIB@
24 ifeq (@OCAML_HAS_BIN_ANNOT@
,yes
)
29 CFLAGS
= @CFLAGS@ @DEFS@
-Wall
31 CURLHELPEROBJS
= curl-helper
$(EXT_OBJ
)
33 CURLBCOBJS
= $(CURLOBJS
:.cmx
=.cmo
)
37 TARGETS
:= curl.cma libcurl-helper
$(EXT_LIB
) dllcurl-helper
$(EXT_DLL
)
38 ifneq (@OCAML_PKG_lwt@
,no
)
39 TARGETS
+= curl_lwt.cmo
41 ifeq (@OCAMLBEST@
,opt
)
42 TARGETS
+= curl.cmxa curl.cmx
43 ifneq (@OCAML_PKG_lwt@
,no
)
44 TARGETS
+= curl_lwt.cmx
48 INSTALL_TARGETS
= curl
$(EXT_LIB
) curl.cmi curl.mli
$(TARGETS
)
49 ifeq (@OCAML_HAS_BIN_ANNOT@
,yes
)
50 INSTALL_TARGETS
+= curl.cmt curl.cmti
52 ifneq (@OCAML_PKG_lwt@
,no
)
53 INSTALL_TARGETS
+= curl_lwt.cmi curl_lwt.mli curl_lwt
$(EXT_OBJ
)
54 ifeq (@OCAML_HAS_BIN_ANNOT@
,yes
)
55 INSTALL_TARGETS
+= curl_lwt.cmt curl_lwt.cmti
67 examples
/test_memory_leaks
68 ifneq (@OCAML_PKG_lwt@
,no
)
69 examples
/test_lwt_unit
71 ifeq (@OCAMLBEST@
,opt
)
72 examples
/test_cb_exn.opt
73 examples
/test_memory_leaks.opt
74 ifneq (@OCAML_PKG_lwt@
,no
)
75 examples
/test_lwt_unit.opt
81 ifneq (@OCAML_PKG_lwt@
,no
)
82 ocamlfind ocamldoc
-html
-d doc
-package lwt curl.mli curl_lwt.mli
84 ocamldoc
-html
-d doc curl.mli
88 (cd examples
; $(MAKE
))
90 curl.cma
: $(CURLBCOBJS
) dllcurl-helper
$(EXT_DLL
)
91 $(OCAMLMKLIB
) -o curl
$(CURLBCOBJS
) -oc curl-helper
$(CLIBS
)
93 curl.cmxa
: $(CURLOBJS
) dllcurl-helper
$(EXT_DLL
)
94 $(OCAMLMKLIB
) -o curl
$(CURLOBJS
) -oc curl-helper
$(CLIBS
)
96 curl_lwt.cmo
: curl_lwt.ml
97 $(FINDLIB
) c
-package lwt.unix
-c
$(FLAGS
) $< -o
$@
99 curl_lwt.cmx
: curl_lwt.ml
100 $(FINDLIB
) opt
-package lwt.unix
-c
$(FLAGS
) $< -o
$@
102 curl_lwt.cmi
: curl_lwt.mli
103 $(FINDLIB
) c
-package lwt
-c
$(FLAGS
) $< -o
$@
106 $(OCAMLOPT
) -c
$(FLAGS
) $< -o
$@
109 $(OCAMLC
) -c
$(FLAGS
) $< -o
$@
112 $(OCAMLC
) -c
$(FLAGS
) $< -o
$@
114 libcurl-helper
$(EXT_LIB
) dllcurl-helper
$(EXT_DLL
): $(CURLHELPEROBJS
)
115 $(OCAMLMKLIB
) -oc curl-helper
$(CURLHELPEROBJS
) $(CLIBS
)
118 $(OCAMLC
) -c
-ccopt
"$(CFLAGS)" $<
121 ifneq (@OCAMLFIND@
,no
)
122 $(FINDLIB
) install -patch-version @PACKAGE_VERSION@
-ldconf ignore curl META
$(INSTALL_TARGETS
)
124 mkdir
-p
$(INSTALLDIR
)
125 $(INSTALLDATA
) curl.cma
$(INSTALLDIR
)
126 ifeq (@OCAMLBEST@
,opt
)
127 $(INSTALLDATA
) curl.cmxa
$(INSTALLDIR
)
129 $(INSTALLDATA
) curl.mli curl.cmi
$(INSTALLDIR
)
130 $(INSTALLDATA
) curl
$(EXT_LIB
) libcurl-helper
$(EXT_LIB
) $(INSTALLDIR
)
134 ifneq (@OCAMLFIND@
,no
)
135 $(FINDLIB
) remove curl
137 (cd
$(INSTALLDIR
) && rm -f curl.cma curl.cmxa curl.mli curl.cmi curl
$(EXT_LIB
) libcurl-helper
$(EXT_LIB
))
145 NAME
=@PACKAGE_NAME@
-@PACKAGE_VERSION@
148 git tag
-a
-m @PACKAGE_VERSION@ @PACKAGE_VERSION@
149 git archive
--prefix=$(NAME
)/ @PACKAGE_VERSION@ | gzip
> $(NAME
).
tar.gz
150 gpg
-a
-b
$(NAME
).
tar.gz
153 @
rm -f
$(TARGETS
) *~
*.cm
* *$(EXT_OBJ
) *$(EXT_LIB
) *$(EXT_DLL
) .depend core
154 @
(cd examples
; $(MAKE
) clean)
157 @
rm -f config.log config.status config.h examples
/Makefile
161 @
$(OCAMLDEP
) *.mli
$(filter-out errors.ml print_ext.ml
, $(wildcard *.ml
)) > .depend
163 ifeq ($(wildcard .depend
),.depend
)
164 ifneq ($(MAKECMDGOALS
),clean)