Initial commit.
[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)
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
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 BUILT_SOURCES = dummy.c
63 dummy.c:
64         rm -f $@
65         touch $@
66
67 # Dependencies.
68 depend: .depend
69
70 .depend: $(all_sources)
71         rm -f $@ $@-t
72         $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) -I $(abs_srcdir) $^ | \
73           $(SED) 's/ *$$//' | \
74           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
75           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
76           sort > $@-t
77         mv $@-t $@
78
79 -include .depend
80
81 # RPM package.
82 rpm: dist
83         rpmbuild -ta $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
84
85 if HAVE_POD2MAN
86
87 #man_MANS = 
88
89 #goaljobs.1: goaljobs.pod
90 #       $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t
91 #       mv $@-t $@
92
93 endif