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.
44 XOBJECTS = $(OBJECTS:.cmo=.cmx)
47 noinst_LIBRARIES = libdaemon.a
48 libdaemon_a_SOURCES = exit.c syslog_c.c
49 libdaemon_a_CFLAGS = -I$(shell $(OCAMLC) -where)
51 whenproto_srv.ml whenproto_srv.mli: whenproto.x
52 $(OCAMLRPCGEN) -int int32 -hyper int64 -srv $<
54 whenproto.x: ../lib/whenproto.x
58 whenjobsd: ../lib/whenlib.cmxa $(XOBJECTS) libdaemon.a
59 $(OCAMLFIND) opt $(OCAMLOPTFLAGS) -ccopt -L../lib \
60 -linkpkg whenlib.cmxa \
61 libdaemon_a-exit.o libdaemon_a-syslog_c.o \
64 whenjobsd: ../lib/whenlib.cma $(OBJECTS) libdaemon.a
65 $(OCAMLFIND) c -custom $(OCAMLCFLAGS) -ccopt -L../lib \
66 -linkpkg whenlib.cma \
67 libdaemon_a-exit.o libdaemon_a-syslog_c.o \
71 # Rules for all OCaml files.
72 %.cmi: %.mli ../lib/whenlib.cma
73 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
74 %.cmo: %.ml ../lib/whenlib.cma
75 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
76 %.cmx: %.ml ../lib/whenlib.cma
77 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -c $< -o $@
79 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
86 $(OCAMLFIND) ocamldep $^ | \
87 $(SED) -e 's/ *$$//' | \
88 $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
95 man_MANS = whenjobsd.8
97 whenjobsd.8: whenjobsd.pod
100 --release "$(PACKAGE)-$(VERSION)" \
106 *.cmi *.cmo *.cmx *.cma *.cmxa *~ \
108 whenproto_srv.ml whenproto_srv.mli \