X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=tools%2FMakefile.am;h=bbb5fa8757d90c33dae7699378ce5989ab0ebfce;hp=057074c846994e075627d7f514c3cd7c78ad40a3;hb=0bfe72d06b55b0db076c900c6c2173b59c8b75f3;hpb=21298f7a45ee536800be5e771438b01089a5cb2c;ds=sidebyside diff --git a/tools/Makefile.am b/tools/Makefile.am index 057074c..bbb5fa8 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -15,4 +15,87 @@ # 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) whenjobs.pod + +bin_SCRIPTS = whenjobs + +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 = \ + libdir.ml \ + tutorial.ml \ + whenproto_clnt.ml \ + whenproto_clnt.mli \ + whenjobs.ml + +# In dependency order. +OBJECTS = \ + libdir.cmo \ + tutorial.cmo \ + whenproto_clnt.cmo \ + whenjobs.cmo + +libdir.ml: Makefile + rm -f $@ $@-t + echo 'let libdir = "$(libdir)/$(PACKAGE_NAME)"' > $@-t + mv $@-t $@ + +whenproto_clnt.ml whenproto_clnt.mli: whenproto.x + $(OCAMLRPCGEN) -int int32 -hyper int64 -clnt $< + +whenproto.x: ../lib/whenproto.x + ln -f $< $@ + +whenjobs: ../lib/whenlib.cma $(OBJECTS) + $(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -ccopt -L../lib \ + -linkpkg whenlib.cma $(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 = whenjobs.1 + +whenjobs.1: whenjobs.pod + pod2man \ + -c "Job scheduling" \ + --release "$(PACKAGE)-$(VERSION)" \ + --section 1 \ + --stderr --utf8 \ + $< > $@ + +whenjobs.txt: whenjobs.pod + pod2text \ + --stderr --utf8 \ + $< > $@ + +CLEANFILES = \ + *.cmi *.cmo *.cmx *.cma *.cmxa *~ \ + libdir.ml \ + whenproto.x \ + whenproto_clnt.ml whenproto_clnt.mli \ + whenjobs