-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (47 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
64 lines (47 loc) · 2.16 KB
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
#
# $Id: Makefile 16196 2009-12-15 20:36:21Z thierry $
# $URL: https://svn.planet-lab.org/svn/vsys/branches/0.9/Makefile $
#
# OCAML_OLD is set to non-empty if str.cmxa needs to be passed twice to the loader
OCAML_RELEASE := $(shell ocaml -version)
OCAML_OLD := $(strip $(findstring version 3.09,$(OCAML_RELEASE)) $(findstring version 3.10,$(OCAML_RELEASE)))
all: vsys docs
include .dep
.SUFFIXES: .ml .cmo
.SUFFIXES: .mli .cmi
.SUFFIXES: .ml .cmx
.SUFFIXES: .mll .ml
.SUFFIXES: .mly .ml
.ml.cmo:
ocamlc -g -c $(INCLUDEDIR) $<
.mli.cmi:
ocamlopt -c $<
.ml.cmx:
ocamlopt $(CFLAGS) -c $(INCLUDEDIR) $<
.mly.ml:
ocamlyacc $<
.mll.ml:
ocamllex $<
docs: *.ml
ocamldoc -d . -html -o docs *.ml
mkdir -p docs;mv *.html *.css docs
ocaml_inotify-0.4/inotify.cmxa:
$(MAKE) -C ocaml_inotify-0.4 && cp -f ocaml_inotify-0.4/inotify_stubs.o ./
splice_stub.o: splice_stub.c
gcc -c -I /usr/lib/ocaml -I /usr/lib64/ocaml splice_stub.c -o splice_stub.o
vsys: ocaml_inotify-0.4/inotify.cmxa globals.cmx fdwatcher.cmx conffile.cmx splice_stub.o splice.cmx dirwatcher.cmx fifowatcher.cmx frontend.cmx unixsocketwatcher.cmx backend.cmx main.cmx
ifneq "$(OCAML_OLD)" ""
ocamlopt -I ocaml_inotify-0.4 str.cmxa unix.cmxa inotify.cmxa globals.cmx fdwatcher.cmx dirwatcher.cmx splice.cmx splice_stub.o directfifowatcher.cmx unixsocketwatcher.cmx frontend.cmx backend.cmx str.cmxa conffile.cmx main.cmx -o vsys
else
ocamlopt -I ocaml_inotify-0.4 str.cmxa unix.cmxa inotify.cmxa globals.cmx fdwatcher.cmx dirwatcher.cmx splice.cmx splice_stub.o directfifowatcher.cmx unixsocketwatcher.cmx frontend.cmx backend.cmx conffile.cmx main.cmx -o vsys
endif
vsys.b: ocaml_inotify-0.4/inotify.cma inotify.cmi globals.ml fdwatcher.ml dirwatcher.ml directfifowatcher.ml frontend.ml backend.ml main.ml
ocamlc -g str.cma unix.cma ocaml_inotify-0.4/inotify.cma globals.cmo fdwatcher.cmo dirwatcher.cmo directfifowatcher.cmo frontend.cmo backend.cmo str.cma conffile.cmo main.cmo -o vsys.b
install: vsys
cp vsys $(INSTALL_DIR)/usr/bin
cp vsys-initscript $(INSTALL_DIR)/etc/init.d/vsys
.dep:
ocamldep *.ml > .dep
clean:
$(MAKE) -C ocaml_inotify-0.4 clean
rm -f *.cmi *.cmx sys usys *.o vsys vsys.b *.html *.css