maintainer: Build Fedora package in copr.
[goals.git] / Makefile.in
1 # Goals
2 # Copyright (C) 2019 Richard W.M. Jones
3 # Copyright (C) 2019 Red Hat Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 # Pass through normal targets to Goalfile.in
20
21 all clean depend install check maintainer-clean dist distcheck \
22 maintainer-check-extra-dist maintainer-release \
23 maintainer-srpm maintainer-fedora-copr: src/goals
24         @./run src/goals $@ 'DESTDIR="$(DESTDIR)"'
25
26 # If src/goals doesn't exist then brute-force build it.  Once we have
27 # src/goals we can rebuild it and other parts of the project using
28 # goals itself (see Goalfile.in).
29
30 MENHIR = @MENHIR@
31 OCAMLDEP = @OCAMLDEP@
32 OCAMLFIND = @OCAMLFIND@
33 OCAMLLEX = @OCAMLLEX@
34 OCAMLFLAGS = @OCAMLFLAGS@
35 OCAMLPACKAGES = @OCAMLPACKAGES@
36
37 src/goals:
38         $(MENHIR) --explain src/parser.mly
39 # Hack required to break circular dependencies.
40         echo 'val lexer_read : (Lexing.lexbuf -> token) option ref' >> src/parser.mli
41         echo 'val eval_substitute : (Ast.env -> Ast.loc -> Ast.substs -> string) option ref' >> src/parser.mli
42         $(OCAMLLEX) src/lexer.mll
43         $(OCAMLFIND) opt $(OCAMLFLAGS) $(OCAMLPACKAGES) -I . -I src \
44             src/utils-c.c \
45             $$($(OCAMLDEP) -sort src/*.mli src/*.ml) \
46             -linkpkg -o $@
47
48 # These rules are required by autoconf.
49 config.h: stamp-h
50 stamp-h: config.h.in config.status
51         ./config.status config.h
52         touch $@
53
54 Makefile: Makefile.in config.status
55         ./config.status $@
56
57 run: run.in config.status
58         ./config.status $@
59
60 $(srcdir)/configure: configure.ac aclocal.m4
61         cd '$(srcdir)' && autoconf
62
63 $(srcdir)/config.h.in: stamp-h.in
64 $(srcdir)/stamp-h.in: configure.ac aclocal.m4
65         cd '$(srcdir)' && autoheader
66         echo timestamp > '$(srcdir)/stamp-h.in'
67
68 config.status: configure
69         ./config.status --recheck