aboutsummaryrefslogtreecommitdiff
path: root/stub/Makefile
diff options
context:
space:
mode:
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
+