aboutsummaryrefslogtreecommitdiff
path: root/stub/Makefile
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2016-11-15 13:00:01 +0100
committerSébastien Dailly <sebastien@chimrod.com>2016-11-15 13:00:01 +0100
commitef312564ca84a2b49fc291434d8fb2f8501bb618 (patch)
tree79415fcf225e6da1042c8edaae5e4a74c7a983cb /stub/Makefile
Initial commit
Diffstat (limited to 'stub/Makefile')
-rwxr-xr-xstub/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/stub/Makefile b/stub/Makefile
new file mode 100755
index 0000000..462ba73
--- /dev/null
+++ b/stub/Makefile
@@ -0,0 +1,22 @@
+LIB_STUB = $(LIB)_stub
+
+C_FILES = $(wildcard *.c)
+OBJ_FILES = $(patsubst %.c,%.o,$(C_FILES))
+
+#LINK_FLAG = $(shell pkg-config --libs $(LIB))
+LINK_FLAG=
+
+all: dll$(LIB_STUB).so
+
+%.o: %.c
+ ocamlc -o $@ $<
+
+dll$(LIB_STUB).so: $(OBJ_FILES)
+ ocamlmklib -I ../_build -oc $(LIB_STUB) $(LINK_FLAG) $^
+ test -d ../_build || mkdir ../_build
+ ln -sf ../stub/dll$(LIB_STUB).so ../_build/
+ ln -sf ../stub/lib$(LIB_STUB).a ../_build/
+
+clean:
+ rm $(OBJ_FILES) *.so *.a
+