aboutsummaryrefslogtreecommitdiff
path: root/stub/Makefile
blob: 462ba73d678409af4544b735bd12138b7d176437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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