Remove NOTES from EXTRA_DIST.
[goaljobs.git] / Makefile.am
1 # goaljobs
2 # Copyright (C) 2013 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         goaljobs \
25         goaljobs_config.ml.in \
26         goaljobs.ml \
27         goaljobs.mli \
28         goaljobs.pod \
29         goaljobs-reference.pod \
30         goaljobs.spec \
31         goaljobs.spec.in \
32         html/.gitignore \
33         META.in \
34         pa_goal.ml \
35         README \
36         TODO
37
38 SUBDIRS = . examples tests
39
40 sources = \
41         goaljobs_config.ml \
42         goaljobs.ml \
43         goaljobs.mli
44
45 bin_SCRIPTS = goaljobs
46
47 # These targets are noinst because we use a custom install hook to
48 # install them, and are _SCRIPTS because automake doesn't know how to
49 # compile OCaml code.
50 noinst_SCRIPTS = goaljobs.cma goaljobs.cmxa pa_goal.cmo
51
52 # Library.
53 goaljobs.cma: goaljobs_config.cmo goaljobs.cmo
54         $(OCAMLFIND) ocamlc -a -o $@ $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $^
55
56 goaljobs.cmxa: goaljobs_config.cmx goaljobs.cmx
57         $(OCAMLFIND) ocamlopt -a -o $@ $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $^
58
59 # Preprocessor for goaljobs scripts.
60 pa_goal.cmo: pa_goal.ml
61         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package camlp4.lib -linkpkg \
62             -pp $(CAMLP4OF) -c $< -o $@
63
64 # Install.
65 install-data-hook:
66         mkdir -p $(DESTDIR)$(OCAMLLIB)
67         $(OCAMLFIND) install \
68             -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
69             goaljobs \
70             META goaljobs.cma goaljobs.cmxa pa_goal.cmo *.cmi $(srcdir)/*.mli
71         rm $(DESTDIR)$(OCAMLLIB)/goaljobs/pa_goal.cmi
72
73 # Dependencies.
74 depend: .depend
75
76 .depend: $(sources)
77         rm -f $@ $@-t
78         $(OCAMLFIND) ocamldep -I $(abs_srcdir) $^ | \
79           $(SED) 's/ *$$//' | \
80           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
81           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
82           sort > $@-t
83         mv $@-t $@
84
85 -include .depend
86
87 rpm: dist
88         rpmbuild -ta $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
89
90 if HAVE_POD2MAN
91
92 man_MANS = goaljobs.1 goaljobs-reference.1
93
94 goaljobs.1: goaljobs.pod
95         $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t
96         mv $@-t $@
97
98 goaljobs-reference.1: goaljobs-reference.pod
99         $(POD2MAN) -c "Goaljobs" --release $(PACKAGE)-$(VERSION) $< > $@-t
100         mv $@-t $@
101
102 goaljobs.1.txt: goaljobs.pod
103         pod2text $< > $@-t
104         mv $@-t $@
105
106 goaljobs-reference.1.txt: goaljobs-reference.pod
107         pod2text $< > $@-t
108         mv $@-t $@
109
110 endif
111
112 if HAVE_OCAMLDOC
113
114 # HTML library documentation.
115 # XXX The list below probably changes with every ocamldoc version.
116 # How can we use a wildcard?
117 doc_DATA = \
118         html/Goaljobs.html \
119         html/index_attributes.html \
120         html/index_classes.html \
121         html/index_class_types.html \
122         html/index_exceptions.html \
123         html/index.html \
124         html/index_methods.html \
125         html/index_modules.html \
126         html/index_module_types.html \
127         html/index_types.html \
128         html/index_values.html \
129         html/style.css \
130         html/type_Goaljobs.html
131
132 $(doc_DATA): stamp-ocamldoc
133 stamp-ocamldoc: goaljobs.mli goaljobs.ml
134         rm -f $@
135         $(OCAMLFIND) ocamldoc -html -d html $(OCAMLCPACKAGES) $^
136         touch $@
137
138 endif
139
140 # License check.
141 licensecheck:
142         licensecheck $$(git ls-files)