stdlib/fedora: Use rpmdev-bumpspec -r flag for < Rawhide builds.
[goals.git] / Makefile.am
1 # Goals
2 # Copyright (C) 2019-2020 Richard W.M. Jones
3 # Copyright (C) 2019-2020 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 # These will override the automake targets printing warnings which
22 # can be ignored.
23
24 all clean depend install check \
25 dist distcheck \
26 maintainer-clean \
27 maintainer-commit maintainer-tag \
28 maintainer-check-extra-dist maintainer-release \
29 maintainer-srpm maintainer-fedora-copr: src/goals
30         @./run src/goals $@ 'DESTDIR="$(DESTDIR)"'
31
32 # If src/goals doesn't exist then brute-force build it.  Once we have
33 # src/goals we can rebuild it and other parts of the project using
34 # goals itself (see Goalfile.in).
35
36 src/goals:
37         $(MENHIR) --explain src/parser.mly
38 # Hack required to break circular dependencies.
39         echo 'val lexer_read : (Lexing.lexbuf -> token) option ref' >> src/parser.mli
40         echo 'val eval_substitute : (Ast.env -> Ast.loc -> Ast.substs -> string) option ref' >> src/parser.mli
41         $(OCAMLLEX) src/lexer.mll
42         $(OCAMLFIND) opt $(OCAMLFLAGS) $(OCAMLPACKAGES) -I . -I src \
43             src/utils-c.c \
44             $$($(OCAMLDEP) -sort src/*.mli src/*.ml) \
45             -linkpkg -o $@