# whenjobs # Copyright (C) 2012 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. EXTRA_DIST = whenproto.x pa_when.ml $(SOURCES) libwhenjobsdir = $(libdir)/$(PACKAGE_NAME) libwhenjobs_SCRIPTS = whenlib.cma pa_when.cmo OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES) OCAMLOPTFLAGS = $(OCAMLCFLAGS) # These should be in alphabetical order. SOURCES = \ config.ml \ whenfile.mli \ whenfile.ml \ whenlock.ml \ whenlock.mli \ whenproto_aux.ml \ whenproto_aux.mli \ whenutils.mli \ whenutils.ml # In dependency order. OBJECTS = \ config.cmo \ whenproto_aux.cmo \ whenutils.cmo \ whenfile.cmo \ whenlock.cmo # Library. noinst_LIBRARIES = liblibrary.a liblibrary_a_SOURCES = flock.c liblibrary_a_CFLAGS = -I$(shell $(OCAMLC) -where) whenlib.cma: $(OBJECTS) liblibrary.a $(OCAMLFIND) c -a $(OCAMLCFLAGS) $(OBJECTS) -cclib -llibrary -o $@ whenproto_aux.ml whenproto_aux.mli: whenproto.x $(OCAMLRPCGEN) -int int32 -hyper int64 -aux $< # Preprocessor for whenjobs files. # Note that we intentionally don't want this to depend on any # libraries except for camlp4.lib. pa_when.cmo: pa_when.ml $(OCAMLFIND) c -g -warn-error CDEFLMPSUVYZX \ -package camlp4.lib -linkpkg \ -pp $(CAMLP4OF) -c $< -o $@ # Rules for all OCaml files. %.cmi: %.mli $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ %.cmo: %.ml $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@ %.cmx: %.ml $(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 CLEANFILES = \ *.cmi *.cmo *.cmx *.cma *.cmxa *~ \ config.ml whenproto_aux.ml whenproto_aux.mli