-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1654368
commit 3fc5f07
Showing
1 changed file
with
9 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,16 @@ | ||
TARGETS = okafka.cma okafka.cmxa okafka.cmxs okafka.a dllocamlkafka.so libocamlkafka.a | ||
LIB = $(addprefix _build/, $(TARGETS)) | ||
TOOLS = tail_kafka_topic.native sendto_kafka_topic.native | ||
all: | ||
jbuilder build @install | ||
|
||
CFLAGS = -cflag -safe-string -cflag -bin-annot | ||
|
||
all: librdkafka-version | ||
rm -f libocamlkafka.clib okafka.mllib META | ||
ln -s libocamlkafka.clib.sync libocamlkafka.clib | ||
ln -s okafka.mllib.sync okafka.mllib | ||
ln -s META.sync META | ||
ocamlbuild -use-ocamlfind $(CFLAGS) kafka.ml $(TARGETS) | ||
|
||
LWT_OPT = -cflags -ccopt,-I,-ccopt,$(shell ocamlfind query lwt.unix) | ||
lwt: librdkafka-version | ||
rm -f libocamlkafka.clib okafka.mllib META | ||
ln -s libocamlkafka.clib.lwt libocamlkafka.clib | ||
ln -s okafka.mllib.lwt okafka.mllib | ||
ln -s META.lwt META | ||
ocamlbuild -use-ocamlfind $(LWT_OPT) -pkgs lwt,lwt.unix kafka.ml $(CFLAGS) $(TARGETS) | ||
|
||
librdkafka-version: librdkafka-version.c | ||
$(CC) -o librdkafka-version librdkafka-version.c -lrdkafka | ||
|
||
_build/tests.native: | ||
ocamlbuild -use-ocamlfind $(LWT_OPT) -pkgs lwt,lwt.unix -libs okafka $(CFLAGS) tests.native | ||
|
||
install: | ||
ocamlfind install okafka META $(LIB) _build/kafka*.cmi _build/kafka*.mli _build/kafka*.cmt* _build/kafka*cmx | ||
install: all | ||
jbuilder install | ||
|
||
uninstall: | ||
ocamlfind remove okafka | ||
|
||
tools: lwt | ||
ocamlbuild -use-ocamlfind $(LWT_OPT) -pkgs lwt,lwt.unix,cmdliner -libs okafka $(CFLAGS) $(TOOLS) | ||
|
||
issues: lwt | ||
ocamlbuild -use-ocamlfind $(LWT_OPT) -pkgs lwt,lwt.unix,cmdliner -libs okafka $(CFLAGS) issue3.native | ||
jbuilder uninstall | ||
|
||
tests: _build/tests.native | ||
_build/tests.native | ||
test: | ||
jbuilder runtest | ||
|
||
clean: | ||
ocamlbuild -clean | ||
jbuilder clean | ||
|
||
.PHONY: all clean tests install | ||
.PHONY: all clean test install uninstall |