X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=daemon%2FMakefile.am;h=0599e565a8bbda5345efd463b12825d308fa9e08;hp=057074c846994e075627d7f514c3cd7c78ad40a3;hb=0bfe72d06b55b0db076c900c6c2173b59c8b75f3;hpb=21298f7a45ee536800be5e771438b01089a5cb2c diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 057074c..0599e56 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -15,4 +15,85 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -CLEANFILES = *~ +EXTRA_DIST = $(SOURCES) whenjobsd.pod + +sbin_SCRIPTS = whenjobsd + +OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc -I ../lib + +OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) +OCAMLOPTFLAGS = $(OCAMLCFLAGS) + +# These should be in alphabetical order. +SOURCES = \ + daemon.mli \ + daemon.ml \ + syslog.mli \ + syslog.ml \ + whenjobsd.ml \ + whenproto_srv.mli \ + whenproto_srv.ml + +# In dependency order. +OBJECTS = \ + syslog.cmo \ + whenproto_srv.cmo \ + daemon.cmo \ + whenjobsd.cmo + +# Daemon. +noinst_LIBRARIES = libdaemon.a +libdaemon_a_SOURCES = exit.c syslog_c.c +libdaemon_a_CFLAGS = -I$(shell $(OCAMLC) -where) + +whenproto_srv.ml whenproto_srv.mli: whenproto.x + $(OCAMLRPCGEN) -int int32 -hyper int64 -srv $< + +whenproto.x: ../lib/whenproto.x + ln -f $< $@ + +whenjobsd: ../lib/whenlib.cma $(OBJECTS) libdaemon.a + $(OCAMLFIND) c -custom $(OCAMLCFLAGS) -ccopt -L../lib \ + -linkpkg whenlib.cma \ + libdaemon_a-exit.o libdaemon_a-syslog_c.o \ + $(OBJECTS) -o $@ + +# Rules for all OCaml files. +%.cmi: %.mli ../lib/whenlib.cma + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +%.cmo: %.ml ../lib/whenlib.cma + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ +%.cmx: %.ml ../lib/whenlib.cma + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@ + +SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly + +# OCaml dependencies. +depend: .depend + +.depend: $(SOURCES) + rm -f $@ $@-t + $(OCAMLFIND) ocamldep $^ | \ + $(SED) -e 's/ *$$//' | \ + $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ + LANG=C sort > $@-t + mv $@-t $@ + +-include .depend + +# Manual page. +man_MANS = whenjobsd.8 + +whenjobsd.8: whenjobsd.pod + pod2man \ + -c "Job scheduling" \ + --release "$(PACKAGE)-$(VERSION)" \ + --section 8 \ + --stderr --utf8 \ + $< > $@ + +CLEANFILES = \ + *.cmi *.cmo *.cmx *.cma *.cmxa *~ \ + whenproto.x \ + whenproto_srv.ml whenproto_srv.mli \ + whenjobsd