-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile.in
54 lines (39 loc) · 1.39 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export NO_CUSTOM=1
SOURCES=mysql.mli mysql.ml mysql_stubs.c
RESULT=mysql
VERSION=@PACKAGE_VERSION@
LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmx *.cmxa *.a *.so *.cmxs)
CFLAGS=@CFLAGS@ @DEFS@ -Wall -Wextra
CPPFLAGS=@CPPFLAGS@
CLIBS=$(foreach x, $(filter -l%, @LDFLAGS@), $(patsubst -l%,%,${x}))
LDFLAGS=$(filter-out -l%, @LDFLAGS@)
OCAMLMKLIB_FLAGS=$(LDFLAGS)
OCAMLFIND_INSTFLAGS=-patch-version "$(VERSION)"
build: all opt
all: byte-code-library
ifeq (@CAN_NATDYNLINK@,yes)
CMXS=mysql.cmxs
clean::
rm -f mysql.cmxs
endif
opt: native-code-library $(CMXS)
reallyall: byte-code-library native-code-library $(CMXS) htdoc
install: libinstall
uninstall: libuninstall
demos: reallyall
ocamlc -custom -I . mysql.cma demo.ml -o demo.byte
$(OCAMLOPT) -I . mysql.cmxa demo.ml -o demo.native
ocamlc -custom -I . -thread unix.cma threads.cma mysql.cma demo2.ml -o demo2.byte
$(OCAMLOPT) -I . -thread unix.cmxa threads.cmxa mysql.cmxa demo2.ml -o demo2.native
mysql.cmxs: mysql.cmx
$(OCAMLOPT) -shared $(foreach flag,$(LDFLAGS), -ccopt ${flag}) mysql_stubs.o $(foreach lib,$(CLIBS), -cclib -l${lib}) -o mysql.cmxs mysql.cmx
clean-demos:
rm -f demo*.{byte,native,cm*,o}
cleanall: clean-demos clean-doc clean
-include OCamlMakefile
NAME=ocaml-mysql-$(VERSION)
.PHONY: release
release:
git tag -a -m $(VERSION) v$(VERSION)
git archive --prefix=$(NAME)/ v$(VERSION) | gzip > $(NAME).tar.gz
gpg -a -b $(NAME).tar.gz