Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (58 sloc) 2.08 KB
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
HAS_ENABLE_LOAD_EXTENSION=@HAS_ENABLE_LOAD_EXTENSION@
ifeq ($(HAS_ENABLE_LOAD_EXTENSION), true)
HAS_ENABLE_LOAD_EXTENSION= -DHAS_ENABLE_LOAD_EXTENSION
OCFLAGS=-pp "cpp -DHAS_ENABLE_LOAD_EXTENSION"
else
HAS_ENABLE_LOAD_EXTENSION=
OCFLAGS=-pp cpp
endif
CC=@CC@
CFLAGS=@CPPFLAGS@ @CFLAGS@ $(HAS_ENABLE_LOAD_EXTENSION) -fPIC -Wall -pedantic -Werror -Wno-long-long
LIBS=@LIBS@
LDFLAGS=@LDFLAGS@
# -linkall: all users of this library must load all our modules;
# in particular, we need sqlite3.cmo to register some exceptions.
MKLIBFLAGS=-linkall
INSTALL=@INSTALL@
all: bytecode opt docs
docs:
if [ ! -d doc ]; then mkdir doc; fi
ocamldoc $(OCFLAGS) -html -d doc sqlite3.mli
bytecode: sqlite3.cma sqlite3top
opt: sqlite3.cmxa
clean:
rm -f *.o *.cmo *.cmx *.cmi *.so *.cma *.cmxa *.a sqlite3top
distclean: clean
rm -rf autom4te.* config.* META Makefile doc
# install rebuilds sqlite3top to point to the findlib-managed dll and not the
# one in .
install: sqlite3.cma sqlite3.cmxa sqlite3top
[ -f *.so ] && SO_FILES=*.so; \
ocamlfind install sqlite3 META sqlite3.cmi sqlite3.mli sqlite3.cma *.cmxa *.a *.cmx $$SO_FILES
ocamlfind ocamlmktop -o sqlite3top -package "sqlite3" sqlite3.cma
$(INSTALL) sqlite3top $(bindir)/sqlite3top
remove: uninstall
uninstall:
ocamlfind remove sqlite3
rm -f $(bindir)/sqlite3top
update: sqlite3.cma
ocamlfind remove sqlite3
make install
sqlite3top: sqlite3.cma
ocamlfind ocamlmktop -o sqlite3top sqlite3.cma
sqlite3.cma: sqlite3.cmo sqlite3_stubs.o
ocamlmklib -o sqlite3 -oc sqlite3_stubs sqlite3.cmo sqlite3_stubs.o -L. $(LDFLAGS) $(LIBS) $(MKLIBFLAGS)
sqlite3.cmxa: sqlite3.cmx sqlite3.o sqlite3_stubs.o
ocamlmklib -o sqlite3 -oc sqlite3_stubs sqlite3.cmx sqlite3_stubs.o -L. $(LDFLAGS) $(LIBS) $(MKLIBFLAGS)
sqlite3.cmo: sqlite3.cmi sqlite3.ml
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.mli.cmi:
ocamlc -w A -warn-error A $(OCFLAGS) -c $<
.ml.cmo:
ocamlc -w A -warn-error A $(OCFLAGS) -c $<
.ml.cmx:
ocamlc -w A -warn-error A $(OCFLAGS) -c $*.mli
ocamlopt -w A -warn-error A -inline 20 $(OCFLAGS) -c $<