Document job names.
[whenjobs.git] / daemon / Makefile.am
1 # whenjobs
2 # Copyright (C) 2012 Red Hat Inc.
3 #
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.
8 #
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.
13 #
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.
17
18 EXTRA_DIST = $(SOURCES) whenjobsd.pod
19
20 sbin_SCRIPTS = whenjobsd
21
22 OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc -I ../lib
23
24 OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
25 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
26
27 # These should be in alphabetical order. 
28 SOURCES = \
29         daemon.mli \
30         daemon.ml \
31         syslog.mli \
32         syslog.ml \
33         whenjobsd.ml \
34         whenproto_srv.mli \
35         whenproto_srv.ml
36
37 # In dependency order.
38 OBJECTS = \
39         syslog.cmo \
40         whenproto_srv.cmo \
41         daemon.cmo \
42         whenjobsd.cmo
43
44 # Daemon.
45 noinst_LIBRARIES = libdaemon.a
46 libdaemon_a_SOURCES = exit.c syslog_c.c
47 libdaemon_a_CFLAGS = -I$(shell $(OCAMLC) -where)
48
49 whenproto_srv.ml whenproto_srv.mli: whenproto.x
50         $(OCAMLRPCGEN) -int int32 -hyper int64 -srv $<
51
52 whenproto.x: ../lib/whenproto.x
53         ln -f $< $@
54
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 \
59           $(OBJECTS) -o $@
60
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 $@
68
69 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
70
71 # OCaml dependencies.
72 depend: .depend
73
74 .depend: $(SOURCES)
75         rm -f $@ $@-t
76         $(OCAMLFIND) ocamldep $^ | \
77           $(SED) -e 's/ *$$//' | \
78           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
79           LANG=C sort > $@-t
80         mv $@-t $@
81
82 -include .depend
83
84 # Manual page.
85 man_MANS = whenjobsd.8
86
87 whenjobsd.8: whenjobsd.pod
88         pod2man \
89           -c "Job scheduling" \
90           --release "$(PACKAGE)-$(VERSION)" \
91           --section 8 \
92           --stderr --utf8 \
93           $< > $@
94
95 CLEANFILES = \
96         *.cmi *.cmo *.cmx *.cma *.cmxa *~ \
97         whenproto.x \
98         whenproto_srv.ml whenproto_srv.mli \
99         whenjobsd