aboutsummaryrefslogtreecommitdiff
path: root/stub/Makefile
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2018-07-16 11:52:12 +0200
committerSébastien Dailly <sebastien@chimrod.com>2018-07-26 21:34:10 +0200
commit5711287dc01133195297cd2309aaca0191c01473 (patch)
tree0faa2c7e924d4d9d4cb1b7b2eb3f8bbe5e962d54 /stub/Makefile
parent725a98ea6133fe7741ac1ada32d53f7978bfede0 (diff)
Update compilation for windows
Diffstat (limited to 'stub/Makefile')
-rwxr-xr-xstub/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/stub/Makefile b/stub/Makefile
index 462ba73..ea4ddde 100755
--- a/stub/Makefile
+++ b/stub/Makefile
@@ -3,20 +3,23 @@ LIB_STUB = $(LIB)_stub
C_FILES = $(wildcard *.c)
OBJ_FILES = $(patsubst %.c,%.o,$(C_FILES))
+SHARED_EXTENSION=$(shell ocamlc -config | grep ext_dll | cut -d' ' -f2)
+LIBRARY=dll$(LIB_STUB)$(SHARED_EXTENSION)
+
#LINK_FLAG = $(shell pkg-config --libs $(LIB))
LINK_FLAG=
-all: dll$(LIB_STUB).so
+all: $(LIBRARY)
%.o: %.c
ocamlc -o $@ $<
-dll$(LIB_STUB).so: $(OBJ_FILES)
+$(LIBRARY): $(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/
+ cp $(LIBRARY) ../_build/
+ cp lib$(LIB_STUB).a ../_build/
clean:
- rm $(OBJ_FILES) *.so *.a
+ rm $(OBJ_FILES) $(LIBRARY) *.a