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