5 .PHONY
: all targets examples
install clean depend
7 .SUFFIXES
: .ml .mli .cmx .cmi .cmo .cmxa .cma .c .o
9 INSTALLDIR
= @INSTALLDIR@
11 INSTALLDATA
= @INSTALL_DATA@
23 CFLAGS
= @CFLAGS@ @DEFS@
-Wall
24 CAMLINCDIR
= -I@OCAMLLIB@
26 CURLHELPEROBJS
= curl-helper.o
28 CURLBCOBJS
= $(CURLOBJS
:.cmx
=.cmo
)
30 CURLFLAGS
= -ccopt @CURLFLAGS@
31 CURLCLIBS
= -cclib
-lcurl-helper
-cclib
"@CURLLIBS@"
33 ifeq (@OCAMLBEST@
,opt
)
34 TARGETS
= curl.cma curl.cmxa libcurl-helper.a dllcurl-helper.so
36 TARGETS
= curl.cma libcurl-helper.a dllcurl-helper.so
43 targets
: $(TARGETS
) examples
46 (cd examples
; $(MAKE
))
48 curl.cma
: $(CURLBCOBJS
) dllcurl-helper.so
49 ocamlmklib
-o curl
$(CURLBCOBJS
) -oc curl-helper @CURLLIBS@
51 curl.cmxa
: $(CURLOBJS
) dllcurl-helper.so
52 ocamlmklib
-o curl
$(CURLOBJS
) -oc curl-helper @CURLLIBS@
55 $(OCOPT
) -c
$(FLAGS
) $< -o
$@
58 $(OCBYTE
) -c
$(FLAGS
) $< -o
$@
61 $(OCBYTE
) -c
$(FLAGS
) $< -o
$@
63 libcurl-helper.a dllcurl-helper.so
: $(CURLHELPEROBJS
)
64 ocamlmklib
-oc curl-helper
$(CURLHELPEROBJS
) \
68 $(OC
) -c
-ccopt
"$(CFLAGS)" $<
71 ifeq ($(FINDLIB
),ocamlfind
)
72 ocamlfind
install -ldconf ignore \
73 curl META
$(wildcard *.cmi
) \
74 $(wildcard *.a
) $(wildcard *.cma
) \
75 $(wildcard *.cmxa
) $(wildcard *.so
) $(wildcard *.mli
)
77 mkdir
-p
$(INSTALLDIR
)
78 $(INSTALLDATA
) curl.cma
$(INSTALLDIR
)
79 ifeq (@OCAMLBEST@
,opt
)
80 $(INSTALLDATA
) curl.cmxa
$(INSTALLDIR
)
82 $(INSTALLDATA
) curl.mli curl.cmi
$(INSTALLDIR
)
83 $(INSTALLDATA
) curl.a libcurl-helper.a
$(INSTALLDIR
)
88 @
rm -f
$(TARGETS
) *~
*.cm
* *.o
*.a
*.so .depend core
89 @
(cd examples
; $(MAKE
) clean)
92 @ocamldep
*.mli
*.ml
> .depend
94 ifeq ($(wildcard .depend
),.depend
)
95 ifneq ($(MAKECMDGOALS
),clean)