-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (59 loc) · 1.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
PACKNAME:=Lwt_websocket
MODNAME:=lwt_websocket
LIBNAME:=lwt-websocket
PKGS:=unix threads num extlib cryptokit bitstring bitstring.syntax lwt.unix lwt.syntax
CAMLC:=ocamlfind ocamlc -g -thread
OPT:=ocamlfind ocamlopt -g -thread
#LWT_DEBUG:=-ppopt -lwt-debug
LWT_DEBUG:=
VERSION:=1.0.0
MLS:=\
utils.ml\
httpRequest.ml\
frame.ml\
channel.ml\
MLIS:=\
httpRequest.mli\
frame.mli\
channel.mli\
CMXS:=$(MLS:.ml=.cmx)
CMOS:=$(MLS:.ml=.cmo)
CMIS:=$(MLIS:.mli=.cmi)
CMXS_DEBUG:=$(MLS:.ml=.debug.cmx)
all:$(LIBNAME).cma $(LIBNAME).cmxa META
$(MODNAME).cmo:$(CMIS) $(CMOS)
$(CAMLC) -pack -o $@ $(CMOS)
$(MODNAME).cmx:$(CMIS) $(CMXS)
$(OPT) -pack -o $@ $(CMXS)
$(LIBNAME).cma:$(MODNAME).cmo
$(CAMLC) -a -o $@ $<
$(LIBNAME).cmxa:$(MODNAME).cmx
$(OPT) -a -o $@ $<
%.cmi:%.mli
$(CAMLC) -syntax camlp4o -package "$(PKGS)" -for-pack $(PACKNAME) -c $<
%.cmo:%.ml
$(CAMLC) -syntax camlp4o -package "$(PKGS)" -for-pack $(PACKNAME) -c $<
%.cmx:%.ml
$(OPT) -syntax camlp4o $(LWT_DEBUG) -package "$(PKGS)" -for-pack $(PACKNAME) -c $<
META:Makefile
echo "description = \"lwt websocket\"" > $@
echo "version = \"$(VERSION)\"" >> $@
echo "archive(byte) = \"$(LIBNAME).cma\"" >> $@
echo "archive(native) = \"$(LIBNAME).cmxa\"" >> $@
echo "requires = \"$(PKGS)\"" >> $@
install:
ocamlfind install $(LIBNAME) META $(MODNAME).* $(LIBNAME).* httpRequest.mli frame.mli channel.mli
uninstall:
ocamlfind remove $(LIBNAME)
reinstall:
make uninstall
make install
clean:
rm -f *.cm* *.o *.a *.out META
rebuild:
make clean
make all
#%.mli:%.ml
# $(CAMLC) -syntax camlp4o -package "$(PKGS)" -i $< > $@
#channel.mli:channel.ml
# $(CAMLC) -syntax camlp4o -package "$(PKGS)" -i $<