Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Makefile for buildling xapian ocaml bindings
INCLUDE=-I. -I./../generic $(shell xapian-config --cxxflags)
LINK=$(shell xapian-config --libs)
all: static
static: libs
ocamlc -pp "camlp4o ./swigp4.cmo" -c
ocamlfind ocamlc -g -ccopt -g -cclib \
-g -custom -o smoketest \
-package unix -linkpkg \
swig.cmo xapian.cmo smoketest.cmo \
xapian_wrap.o \
-cc 'g++ -Wno-write-strings $(INCLUDE) $(LINK)'
$(SWIG) -ocaml -co
$(SWIG) -ocaml -co swig.mli
$(SWIG) -ocaml -co
ocamlfind ocamlc -package camlp4 \
-pp "camlp4o pa_extend.cmo q_MLast.cmo" \
ocamlc -c swig.mli
libs: swig
$(SWIG) -Wall $(INCLUDE) -c++ -ocaml \
-outdir . -o xapian_wrap.c ../xapian.i
ocamlc -cc 'g++ -Wno-write-strings' -g -c -ccopt \
-g -ccopt '-xc++' -ccopt '$(INCLUDE)' \
ocamlc -c xapian.mli
toplevel: libs
ocamlfind ocamlmktop -custom swig.cmo \
-package dynlink -package camlp4 \
dynlink.cma camlp4o.cma swigp4.cmo \
xapian_wrap.o xapian.cmo -o xapian_top \
-cc 'g++ -Wno-write-strings $(INCLUDE) $(LINK)'
rm -rf *.dSYM smoketest
rm -f swig.mli
rm -f *.cmo *.cmi
rm -f xapian_wrap.*
rm -f xapian.*
rm -f xapian_top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.