Command line parsing, the concept of publishing goals.
[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         config.ml.in \
24         COPYING \
25         goaljobs \
26         goaljobs.spec \
27         goaljobs.spec.in \
28         META.in \
29         NOTES \
30         README \
31         $(sources) \
32         pa_goal.ml
33
34 SUBDIRS = . examples tests
35
36 sources = \
37         config.ml \
38         goaljobs.ml \
39         goaljobs.mli
40
41 bin_SCRIPTS = goaljobs
42
43 # These targets are noinst because we use a custom install hook to
44 # install them, and are _SCRIPTS because automake doesn't know how to
45 # compile OCaml code.
46 noinst_SCRIPTS = goaljobs.cma goaljobs.cmxa pa_goal.cmo
47
48 # Library.
49 goaljobs.cma: config.cmo goaljobs.cmo
50         $(OCAMLFIND) ocamlc -a -o $@ $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $^
51
52 goaljobs.cmxa: config.cmx goaljobs.cmx
53         $(OCAMLFIND) ocamlopt -a -o $@ $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $^
54
55 # Preprocessor for goaljobs scripts.
56 pa_goal.cmo: pa_goal.ml
57         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package camlp4.lib -linkpkg \
58             -pp $(CAMLP4OF) -c $< -o $@
59
60 # Install.
61 install-data-hook:
62         mkdir -p $(DESTDIR)$(OCAMLLIB)
63         $(OCAMLFIND) install \
64             -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
65             goaljobs \
66             META goaljobs.cma goaljobs.cmxa pa_goal.cmo *.cmi $(srcdir)/*.mli
67         rm $(DESTDIR)$(OCAMLLIB)/goaljobs/pa_goal.cmi
68
69 # Dependencies.
70 depend: .depend
71
72 .depend: $(sources)
73         rm -f $@ $@-t
74         $(OCAMLFIND) ocamldep -I $(abs_srcdir) $^ | \
75           $(SED) 's/ *$$//' | \
76           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
77           $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
78           sort > $@-t
79         mv $@-t $@
80
81 -include .depend
82
83 rpm: dist
84         rpmbuild -ta $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
85
86 # License check.
87 licensecheck:
88         licensecheck $$(git ls-files)