list: Improve output.
[todo.git] / Makefile.am
1 # todo
2 # Copyright (C) 2016 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 include common-rules.mk
19
20 ACLOCAL_AMFLAGS = -I m4
21
22 EXTRA_DIST = \
23         COPYING \
24         META.in \
25         README
26
27 all_sources = $(TODO_SOURCES_ML) $(POLL_BUGZILLA_SOURCES_ML)
28
29 # You must adjust this to point to the right database host.  The
30 # database itself is hard-coded as 'todo'.  Setting the environment
31 # variable here merely tells PG'OCaml that.
32 #export PGHOST=todo
33 export PGDATABASE=todo
34
35 bin_PROGRAMS = todo poll-bugzilla
36
37 TODO_SOURCES_ML = \
38         todo_config.ml \
39         todo_types.ml \
40         todo_utils.ml \
41         todo_tag_utils.ml \
42         todo_add.ml \
43         todo_list.ml \
44         todo_move.ml \
45         todo_retire.ml \
46         todo_tag.ml \
47         todo_cmdline.ml \
48         todo.ml
49 if !HAVE_OCAMLOPT
50 TODO_OBJECTS = $(TODO_SOURCES_ML:.ml=.cmo)
51 else
52 TODO_OBJECTS = $(TODO_SOURCES_ML:.ml=.cmx)
53 endif
54
55 todo_SOURCES = dummy.c
56 todo_DEPENDENCIES = $(TODO_OBJECTS) $(top_srcdir)/ocaml-link.sh
57 todo_LINK = \
58         $(top_srcdir)/ocaml-link.sh -- \
59             $(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
60                 $(OCAMLLINKFLAGS) $(TODO_OBJECTS) -o $@
61
62 POLL_BUGZILLA_SOURCES_ML = \
63         poll_bugzilla.ml
64 if !HAVE_OCAMLOPT
65 POLL_BUGZILLA_OBJECTS = $(POLL_BUGZILLA_SOURCES_ML:.ml=.cmo)
66 else
67 POLL_BUGZILLA_OBJECTS = $(POLL_BUGZILLA_SOURCES_ML:.ml=.cmx)
68 endif
69
70 poll_bugzilla_SOURCES = dummy.c
71 poll_bugzilla_DEPENDENCIES = $(POLL_BUGZILLA_OBJECTS) $(top_srcdir)/ocaml-link.sh
72 poll_bugzilla_LINK = \
73         $(top_srcdir)/ocaml-link.sh -- \
74             $(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
75                 $(OCAMLLINKFLAGS) $(POLL_BUGZILLA_OBJECTS) -o $@
76
77 BUILT_SOURCES = dummy.c
78 dummy.c:
79         rm -f $@
80         touch $@
81
82 # Dependencies.
83 depend: .depend
84
85 .depend: $(all_sources)
86         rm -f $@ $@-t
87         $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) -I $(abs_srcdir) $^ | \
88           $(SED) 's/ *$$//' | \
89           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
90           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
91           sort > $@-t
92         mv $@-t $@
93
94 -include .depend
95
96 # RPM package.
97 rpm: dist
98         rpmbuild -ta $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
99
100 if HAVE_POD2MAN
101
102 #man_MANS = 
103
104 #goaljobs.1: goaljobs.pod
105 #       $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t
106 #       mv $@-t $@
107
108 endif