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 EXTRA_DIST = whenproto.x pa_when.ml $(SOURCES)
20 libwhenjobsdir = $(libdir)/$(PACKAGE_NAME)
21 libwhenjobs_SCRIPTS = whenlib.cma pa_when.cmo $(CMI_FILES)
24 libwhenjobs_SCRIPTS += whenlib.cmxa
27 OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc
29 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
30 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
32 # These should be in alphabetical order.
34 # NB. whenproto_aux.{ml,mli} are not included here. These generated
35 # files are not compatible across different versions of ocamlnet, so
36 # must not be included in the tarball and should be regenerated by the
54 # In alphabetical order.
65 # In dependency order.
76 XOBJECTS = $(OBJECTS:.cmo=.cmx)
79 noinst_LIBRARIES = liblibrary.a
80 liblibrary_a_SOURCES = flock.c
81 liblibrary_a_CFLAGS = -I$(shell $(OCAMLC) -where)
83 whenlib.cma: $(OBJECTS) liblibrary.a
84 $(OCAMLFIND) c -a $(OCAMLCFLAGS) $(OBJECTS) -cclib -llibrary -o $@
86 whenlib.cmxa: $(XOBJECTS) liblibrary.a
87 $(OCAMLFIND) opt -a $(OCAMLOPTFLAGS) $(XOBJECTS) -cclib -llibrary -o $@
89 whenproto_aux.ml whenproto_aux.mli: whenproto.x
90 $(OCAMLRPCGEN) -int int32 -hyper int64 -aux $<
92 # Preprocessor for whenjobs files.
93 # Note that we intentionally don't want this to depend on any
94 # libraries except for camlp4.lib.
95 pa_when.cmo: pa_when.ml
96 $(OCAMLFIND) c -g -warn-error CDEFLMPSUVYZX \
97 -package camlp4.lib -linkpkg \
98 -pp $(CAMLP4OF) -c $< -o $@
100 # Rules for all OCaml files.
102 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
104 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
106 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
108 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
110 # OCaml dependencies.
115 $(OCAMLFIND) ocamldep $^ | \
116 $(SED) -e 's/ *$$//' | \
117 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
124 *.cmi *.cmo *.cmx *.cma *.cmxa *~ \
125 config.ml whenproto_aux.ml whenproto_aux.mli