release 0.6.0
[ocurl.git] / Makefile.in
blobc60509037b822193a875cb020dfbfdc39172ece6
1 ###
2 ### @configure_input@
3 ###
5 .PHONY: all targets examples install clean distclean depend release
7 .SUFFIXES: .ml .mli .cmx .cmi .cmo .cmxa .cma .c .o
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 FLAGS =
20 LIBS =
22 CFLAGS = @CFLAGS@ @CURLCFLAGS@ @DEFS@ -Wall
24 CURLHELPEROBJS = curl-helper.o
25 CURLOBJS = curl.cmx
26 CURLBCOBJS = $(CURLOBJS:.cmx=.cmo)
28 CLIBS = @CURLLIBS@
30 ifeq (@OCAMLBEST@,opt)
31 TARGETS = curl.cma curl.cmxa libcurl-helper.a dllcurl-helper.so
32 else
33 TARGETS = curl.cma libcurl-helper.a dllcurl-helper.so
34 endif
36 all:
37 @$(MAKE) depend
38 @$(MAKE) targets
40 targets: $(TARGETS) examples
42 examples:
43 (cd examples; $(MAKE))
45 curl.cma: $(CURLBCOBJS) dllcurl-helper.so
46 $(OCAMLMKLIB) -o curl $(CURLBCOBJS) -oc curl-helper $(CLIBS)
48 curl.cmxa: $(CURLOBJS) dllcurl-helper.so
49 $(OCAMLMKLIB) -o curl $(CURLOBJS) -oc curl-helper $(CLIBS)
51 .ml.cmx:
52 $(OCAMLOPT) -c $(FLAGS) $< -o $@
54 .mli.cmi:
55 $(OCAMLC) -c $(FLAGS) $< -o $@
57 .ml.cmo:
58 $(OCAMLC) -c $(FLAGS) $< -o $@
60 libcurl-helper.a dllcurl-helper.so: $(CURLHELPEROBJS)
61 $(OCAMLMKLIB) -oc curl-helper $(CURLHELPEROBJS) $(CLIBS)
63 .c.o:
64 $(OCAMLC) -c -ccopt "$(CFLAGS)" $<
66 install:
67 ifneq (@OCAMLFIND@,no)
68 $(FINDLIB) install -patch-version @PACKAGE_VERSION@ -ldconf ignore curl META curl.a curl.cmi curl.mli $(TARGETS)
69 else
70 mkdir -p $(INSTALLDIR)
71 $(INSTALLDATA) curl.cma $(INSTALLDIR)
72 ifeq (@OCAMLBEST@,opt)
73 $(INSTALLDATA) curl.cmxa $(INSTALLDIR)
74 endif
75 $(INSTALLDATA) curl.mli curl.cmi $(INSTALLDIR)
76 $(INSTALLDATA) curl.a libcurl-helper.a $(INSTALLDIR)
77 endif
79 uninstall:
80 ifneq (@OCAMLFIND@,no)
81 $(FINDLIB) remove curl
82 else
83 (cd $(INSTALLDIR) && rm -f curl.cma curl.cmxa curl.mli curl.cmi curl.a libcurl-helper.a)
84 rmdir $(INSTALLDIR)
85 endif
87 NAME=@PACKAGE_NAME@-@PACKAGE_VERSION@
89 release:
90 git tag -a -m @PACKAGE_VERSION@ @PACKAGE_VERSION@
91 git archive --prefix=$(NAME)/ @PACKAGE_VERSION@ | gzip > $(NAME).tar.gz
92 gpg -a -b $(NAME).tar.gz
94 clean:
95 @rm -f $(TARGETS) *~ *.cm* *.o *.a *.so .depend core
96 @(cd examples; $(MAKE) clean)
98 distclean: clean
99 @rm -f config.log config.status config.h examples/Makefile
100 @rm -f Makefile
102 depend:
103 @$(OCAMLDEP) *.mli *.ml > .depend
105 ifeq ($(wildcard .depend),.depend)
106 ifneq ($(MAKECMDGOALS),clean)
107 include .depend
108 endif
109 endif