diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2016-11-15 13:00:01 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2016-11-15 13:00:01 +0100 |
commit | ef312564ca84a2b49fc291434d8fb2f8501bb618 (patch) | |
tree | 79415fcf225e6da1042c8edaae5e4a74c7a983cb /stub/Makefile |
Initial commit
Diffstat (limited to 'stub/Makefile')
-rwxr-xr-x | stub/Makefile | 22 |
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
+
|