generate error mappings (fix typos)
[ocurl.git] / Makefile.in
blob8990bdfc47eb9e06363e98bd9e1ea48c8581a8d0
1 ###
2 ### @configure_input@
3 ###
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@
10 INSTALL = @INSTALL@
11 INSTALLDATA = @INSTALL_DATA@
13 FINDLIB = @OCAMLFIND@
14 OCAMLC = @OCAMLC@
15 OCAMLOPT = @OCAMLOPT@
16 OCAMLDEP = @OCAMLDEP@
17 OCAMLMKLIB = @OCAMLMKLIB@
19 EXT_LIB = @EXT_LIB@
20 EXT_OBJ = @EXT_OBJ@
21 EXT_DLL = @EXT_DLL@
23 FLAGS = -g
24 ifeq (@OCAML_HAS_BIN_ANNOT@,yes)
25 FLAGS += -bin-annot
26 endif
27 LIBS =
29 CFLAGS = @CFLAGS@ @DEFS@ -Wall
31 CURLHELPEROBJS = curl-helper$(EXT_OBJ)
32 CURLOBJS = curl.cmx
33 CURLBCOBJS = $(CURLOBJS:.cmx=.cmo)
35 CLIBS = @CURLLIBS@
37 TARGETS := curl.cma libcurl-helper$(EXT_LIB) dllcurl-helper$(EXT_DLL)
38 ifneq (@OCAML_PKG_lwt@,no)
39 TARGETS += curl_lwt.cmo
40 endif
41 ifeq (@OCAMLBEST@,opt)
42 TARGETS += curl.cmxa
43 ifneq (@OCAML_PKG_lwt@,no)
44 TARGETS += curl_lwt.cmx
45 endif
46 endif
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
51 endif
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
56 endif
57 endif
59 all:
60 @$(MAKE) depend
61 @$(MAKE) $(TARGETS)
63 build: all
65 test: examples
66 examples/test_cb_exn
67 examples/test_memory_leaks
68 ifneq (@OCAML_PKG_lwt@,no)
69 examples/test_lwt_unit
70 endif
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
76 endif
77 endif
79 doc:
80 mkdir -p doc
81 ifneq (@OCAML_PKG_lwt@,no)
82 ocamlfind ocamldoc -html -d doc -package lwt curl.mli curl_lwt.mli
83 else
84 ocamldoc -html -d doc curl.mli
85 endif
87 examples:
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 $@
105 .ml.cmx:
106 $(OCAMLOPT) -c $(FLAGS) $< -o $@
108 .mli.cmi:
109 $(OCAMLC) -c $(FLAGS) $< -o $@
111 .ml.cmo:
112 $(OCAMLC) -c $(FLAGS) $< -o $@
114 libcurl-helper$(EXT_LIB) dllcurl-helper$(EXT_DLL): $(CURLHELPEROBJS)
115 $(OCAMLMKLIB) -oc curl-helper $(CURLHELPEROBJS) $(CLIBS)
117 .c$(EXT_OBJ):
118 $(OCAMLC) -c -ccopt "$(CFLAGS)" $<
120 install:
121 ifneq (@OCAMLFIND@,no)
122 $(FINDLIB) install -patch-version @PACKAGE_VERSION@ -ldconf ignore curl META $(INSTALL_TARGETS)
123 else
124 mkdir -p $(INSTALLDIR)
125 $(INSTALLDATA) curl.cma $(INSTALLDIR)
126 ifeq (@OCAMLBEST@,opt)
127 $(INSTALLDATA) curl.cmxa $(INSTALLDIR)
128 endif
129 $(INSTALLDATA) curl.mli curl.cmi $(INSTALLDIR)
130 $(INSTALLDATA) curl$(EXT_LIB) libcurl-helper$(EXT_LIB) $(INSTALLDIR)
131 endif
133 uninstall:
134 ifneq (@OCAMLFIND@,no)
135 $(FINDLIB) remove curl
136 else
137 (cd $(INSTALLDIR) && rm -f curl.cma curl.cmxa curl.mli curl.cmi curl$(EXT_LIB) libcurl-helper$(EXT_LIB))
138 rmdir $(INSTALLDIR)
139 endif
141 reinstall:
142 $(MAKE) uninstall
143 $(MAKE) install
145 NAME=@PACKAGE_NAME@-@PACKAGE_VERSION@
147 release:
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
152 clean:
153 @rm -f $(TARGETS) *~ *.cm* *$(EXT_OBJ) *$(EXT_LIB) *$(EXT_DLL) .depend core
154 @(cd examples; $(MAKE) clean)
156 distclean: clean
157 @rm -f config.log config.status config.h examples/Makefile
158 @rm -f Makefile
160 depend:
161 @$(OCAMLDEP) *.mli *.ml > .depend
163 ifeq ($(wildcard .depend),.depend)
164 ifneq ($(MAKECMDGOALS),clean)
165 include .depend
166 endif
167 endif