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 = $(SOURCES) whenjobsd.pod
20 sbin_SCRIPTS = whenjobsd
22 OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc -I ../lib
24 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
25 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
27 # These should be in alphabetical order.
37 # In dependency order.
45 noinst_LIBRARIES = libdaemon.a
46 libdaemon_a_SOURCES = exit.c syslog_c.c
47 libdaemon_a_CFLAGS = -I$(shell $(OCAMLC) -where)
49 whenproto_srv.ml whenproto_srv.mli: whenproto.x
50 $(OCAMLRPCGEN) -int int32 -hyper int64 -srv $<
52 whenproto.x: ../lib/whenproto.x
55 whenjobsd: ../lib/whenlib.cma $(OBJECTS) libdaemon.a
56 $(OCAMLFIND) c -custom $(OCAMLCFLAGS) -ccopt -L../lib \
57 -linkpkg whenlib.cma \
58 libdaemon_a-exit.o libdaemon_a-syslog_c.o \
61 # Rules for all OCaml files.
62 %.cmi: %.mli ../lib/whenlib.cma
63 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
64 %.cmo: %.ml ../lib/whenlib.cma
65 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
66 %.cmx: %.ml ../lib/whenlib.cma
67 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
69 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
76 $(OCAMLFIND) ocamldep $^ | \
77 $(SED) -e 's/ *$$//' | \
78 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
85 man_MANS = whenjobsd.8
87 whenjobsd.8: whenjobsd.pod
90 --release "$(PACKAGE)-$(VERSION)" \
96 *.cmi *.cmo *.cmx *.cma *.cmxa *~ \
98 whenproto_srv.ml whenproto_srv.mli \