Fix build requirements by correctly noting that Python is required.
[pspp] / src / output / spv / automake.mk
1 # PSPP - a program for statistical analysis.
2 # Copyright (C) 2019, 2020 Free Software Foundation, 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 3 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, see <http://www.gnu.org/licenses/>.
16 #
17 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
18
19 src_output_liboutput_la_SOURCES += \
20         src/output/spv/spv-css-parser.c \
21         src/output/spv/spv-css-parser.h \
22         src/output/spv/spv-legacy-data.c \
23         src/output/spv/spv-legacy-data.h \
24         src/output/spv/spv-legacy-decoder.c \
25         src/output/spv/spv-legacy-decoder.h \
26         src/output/spv/spv-light-decoder.c \
27         src/output/spv/spv-light-decoder.h \
28         src/output/spv/spv-table-look.c \
29         src/output/spv/spv-table-look.h \
30         src/output/spv/spv-writer.c \
31         src/output/spv/spv-writer.h \
32         src/output/spv/spv.c \
33         src/output/spv/spv.h \
34         src/output/spv/spvbin-helpers.c \
35         src/output/spv/spvbin-helpers.h \
36         src/output/spv/spvxml-helpers.c \
37         src/output/spv/spvxml-helpers.h
38
39 AM_CPPFLAGS += -Isrc
40
41 light_binary_in = \
42         src/output/spv/binary-parser-generator \
43         src/output/spv/light-binary.grammar
44 light_binary_out = \
45         src/output/spv/light-binary-parser.c \
46         src/output/spv/light-binary-parser.h
47 src/output/spv/light-binary-parser.c: $(light_binary_in)
48         $(AM_V_GEN)$(PYTHON3) $^ code spvlb '"output/spv/light-binary-parser.h"' > $@.tmp
49         $(AM_V_at)mv $@.tmp $@
50 src/output/spv/light-binary-parser.h: $(light_binary_in)
51         $(AM_V_GEN)$(PYTHON3) $^ header spvlb > $@.tmp && mv $@.tmp $@
52 nodist_src_output_liboutput_la_SOURCES += $(light_binary_out)
53 BUILT_SOURCES += $(light_binary_out)
54 CLEANFILES += $(light_binary_out)
55 EXTRA_DIST += $(light_binary_in)
56
57 old_binary_in = \
58         src/output/spv/binary-parser-generator \
59         src/output/spv/old-binary.grammar
60 old_binary_out = \
61         src/output/spv/old-binary-parser.c \
62         src/output/spv/old-binary-parser.h
63 src/output/spv/old-binary-parser.c: $(old_binary_in)
64         $(AM_V_GEN)$(PYTHON3) $^ code spvob '"output/spv/old-binary-parser.h"' > $@.tmp
65         $(AM_V_at)mv $@.tmp $@
66 src/output/spv/old-binary-parser.h: $(old_binary_in)
67         $(AM_V_GEN)$(PYTHON3) $^ header spvob > $@.tmp && mv $@.tmp $@
68 nodist_src_output_liboutput_la_SOURCES += $(old_binary_out)
69 BUILT_SOURCES += $(old_binary_out)
70 CLEANFILES += $(old_binary_out)
71 EXTRA_DIST += $(old_binary_in)
72
73 detail_xml_in = \
74         src/output/spv/xml-parser-generator \
75         src/output/spv/detail-xml.grammar
76 detail_xml_out = \
77         src/output/spv/detail-xml-parser.c \
78         src/output/spv/detail-xml-parser.h
79 src/output/spv/detail-xml-parser.c: $(detail_xml_in)
80         $(AM_V_GEN)$(PYTHON3) $^ code spvdx '"output/spv/detail-xml-parser.h"' > $@.tmp
81         $(AM_V_at)mv $@.tmp $@
82 src/output/spv/detail-xml-parser.h: $(detail_xml_in)
83         $(AM_V_GEN)$(PYTHON3) $^ header spvdx > $@.tmp && mv $@.tmp $@
84 nodist_src_output_liboutput_la_SOURCES += $(detail_xml_out)
85 BUILT_SOURCES += $(detail_xml_out)
86 CLEANFILES += $(detail_xml_out)
87 EXTRA_DIST += $(detail_xml_in)
88
89 structure_xml_in = \
90         src/output/spv/xml-parser-generator \
91         src/output/spv/structure-xml.grammar
92 structure_xml_out = \
93         src/output/spv/structure-xml-parser.c \
94         src/output/spv/structure-xml-parser.h
95 src/output/spv/structure-xml-parser.c: $(structure_xml_in)
96         $(AM_V_GEN)$(PYTHON3) $^ code spvsx '"output/spv/structure-xml-parser.h"' > $@.tmp
97         $(AM_V_at)mv $@.tmp $@
98 src/output/spv/structure-xml-parser.h: $(structure_xml_in)
99         $(AM_V_GEN)$(PYTHON3) $^ header spvsx > $@.tmp && mv $@.tmp $@
100 nodist_src_output_liboutput_la_SOURCES += $(structure_xml_out)
101 BUILT_SOURCES += $(structure_xml_out)
102 CLEANFILES += $(structure_xml_out)
103 EXTRA_DIST += $(structure_xml_in)
104
105 tlo_in = \
106         src/output/spv/binary-parser-generator \
107         src/output/spv/tlo.grammar
108 tlo_out = \
109         src/output/spv/tlo-parser.c \
110         src/output/spv/tlo-parser.h
111 src/output/spv/tlo-parser.c: $(tlo_in)
112         $(AM_V_GEN)$(PYTHON3) $^ code tlo '"output/spv/tlo-parser.h"' > $@.tmp
113         $(AM_V_at)mv $@.tmp $@
114 src/output/spv/tlo-parser.h: $(tlo_in)
115         $(AM_V_GEN)$(PYTHON3) $^ header tlo > $@.tmp && mv $@.tmp $@
116 nodist_src_output_liboutput_la_SOURCES += $(tlo_out)
117 BUILT_SOURCES += $(tlo_out)
118 CLEANFILES += $(tlo_out)
119 EXTRA_DIST += $(tlo_in)
120
121 # These explicit dependencies seem to be necessary when cross building ---
122 # more precisely, when building the native build necessary to build the cross.
123 # Note that the use of the pspp_kludge_N variables is necessary.  Otherwise
124 # automake thinks if need not emit build rules for these items.
125 pspp_kludge_0=src/output/spv/liboutput_la-spv-legacy-data.lo
126 $(pspp_kludge_0): src/output/spv/old-binary-parser.h
127
128 pspp_kludge_1=src/output/spv/liboutput_la-spv-legacy-decoder.lo
129 $(pspp_kludge_1): src/output/spv/detail-xml-parser.h \
130  src/output/spv/structure-xml-parser.h
131
132 pspp_kludge_2=src/output/spv/liboutput_la-spv-light-decoder.lo
133 $(pspp_kludge_2): src/output/spv/light-binary-parser.h
134
135 pspp_kludge_3=src/output/spv/liboutput_la-spv-table-look.lo
136 $(pspp_kludge_3): src/output/spv/tlo-parser.h