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