2 # Copyright (C) 2012 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 libwhenjobsdir = $(libdir)/$(PACKAGE_NAME)
19 libwhenjobs_SCRIPTS = whenlib.cma pa_when.cmo
21 OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc
23 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
24 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
26 # These should be in alphabetical order.
38 # In dependency order.
47 noinst_LIBRARIES = liblibrary.a
48 liblibrary_a_SOURCES = flock.c
49 liblibrary_a_CFLAGS = -I$(shell $(OCAMLC) -where)
51 whenlib.cma: $(OBJECTS) liblibrary.a
52 $(OCAMLFIND) c -a $(OCAMLCFLAGS) $(OBJECTS) -cclib -llibrary -o $@
54 whenproto_aux.ml whenproto_aux.mli: whenproto.x
55 $(OCAMLRPCGEN) -int int32 -hyper int64 -aux $<
57 # Preprocessor for whenjobs files.
58 pa_when.cmo: pa_when.ml whenlib.cma
59 $(OCAMLFIND) c $(OCAMLCFLAGS) \
60 -linkpkg whenlib.cma -pp $(CAMLP4OF) -c $< -o $@
62 # Rules for all OCaml files.
64 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
66 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
68 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
70 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
77 $(OCAMLFIND) ocamldep $^ | \
78 $(SED) -e 's/ *$$//' | \
79 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
86 *.cmi *.cmo *.cmx *.cma *.cmxa *~ \
87 config.ml whenproto_aux.ml whenproto_aux.mli