X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=a2f89ae92946e07e49493a4b8ad2b71117e6518a;hb=refs%2Fheads%2F0.9;hp=3bf56a63611c9fe7e9c071003fd7fb2c51ef79fb;hpb=a9f606051125de2acc9140074f91054755fa67b4;p=vsys.git diff --git a/Makefile b/Makefile index 3bf56a6..a2f89ae 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,13 @@ -all: vsys +# +# $Id$ +# $URL$ +# + +# 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 @@ -24,21 +33,32 @@ include .dep ocamllex $< docs: *.ml - cd docs && ocamldoc -d . -html ../*.ml + ocamldoc -d . -html -o docs *.ml + mkdir 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: inotify.cmxa inotify.cmi globals.cmx fdwatcher.cmx dirwatcher.cmx fifowatcher.cmx frontend.cmx backend.cmx main.cmx docs - ocamlopt str.cmxa unix.cmxa inotify.cmxa globals.cmx fdwatcher.cmx dirwatcher.cmx fifowatcher.cmx frontend.cmx backend.cmx str.cmxa main.cmx -o vsys +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: inotify.cma inotify.cmi globals.ml fdwatcher.ml dirwatcher.ml fifowatcher.ml frontend.ml backend.ml main.ml - ocamlc -g str.cmxa unix.cma inotify.cma globals.cmo fdwatcher.cmo dirwatcher.cmo fifowatcher.cmo frontend.cmo backend.cmo str.cma main.cmo -o vsys.b +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 /usr/bin - cp vsys.b /usr/bin - cp vsys-initscript /etc/init.d/vsys + cp vsys $(INSTALL_DIR)/usr/bin + cp vsys-initscript $(INSTALL_DIR)/etc/init.d/vsys dep: ocamldep *.ml > .dep clean: - rm -fR *.cmi *.cmx sys usys + $(MAKE) -C ocaml_inotify-0.4 clean + rm -f *.cmi *.cmx sys usys *.o vsys vsys.b *.html *.css