]>
Commit | Line | Data |
---|---|---|
1eee94d3 GM |
1 | # Top level -*- makefile -*- fragment for GNU M2. |
2 | ||
a945c346 | 3 | # Copyright (C) 2000-2024 Free Software Foundation, Inc. |
1eee94d3 GM |
4 | |
5 | #This file is part of GCC. | |
6 | ||
7 | #GCC is free software; you can redistribute it and/or modify | |
8 | #it under the terms of the GNU General Public License as published by | |
9 | #the Free Software Foundation; either version 3, or (at your option) | |
10 | #any later version. | |
11 | ||
12 | #GCC is distributed in the hope that it will be useful, | |
13 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | #GNU General Public License for more details. | |
16 | ||
17 | #You should have received a copy of the GNU General Public License | |
18 | #along with GCC; see the file COPYING3. If not see | |
19 | #<http://www.gnu.org/licenses/>. | |
20 | ||
21 | # Actual names to use when installing a native compiler. | |
22 | GM2_INSTALL_NAME = $(shell echo gm2|sed '$(program_transform_name)') | |
23 | GM2_TARGET_INSTALL_NAME = $(target_noncanonical)-$(shell echo gm2|sed '$(program_transform_name)') | |
24 | ||
25 | # Actual names to use when installing a cross-compiler. | |
26 | GM2_CROSS_NAME = `echo gm2|sed '$(program_transform_cross_name)'` | |
27 | ||
28 | M2_MAINTAINER = no | |
29 | ||
ef6696af GM |
30 | # CM2DEP must match the COMPILE and POSTCOMPILE defines in gcc/Make-lang.in |
31 | ifeq ($(CXXDEPMODE),depmode=gcc3) | |
32 | CM2DEP=-MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo | |
33 | else | |
34 | CM2DEP= | |
35 | endif | |
36 | ||
37 | GM2_1 = ./gm2 -B./m2/stage1 -g -fm2-g $(CM2DEP) | |
1eee94d3 GM |
38 | |
39 | GM2_FOR_TARGET = $(STAGE_CC_WRAPPER) ./gm2 -B./ -B$(build_tooldir)/bin/ -L$(objdir)/../ld $(TFLAGS) | |
40 | ||
ebc41f9a RO |
41 | # FIXME: Get from gcc-plugin.m4 instead of hardcoding. |
42 | ifeq (,$(findstring darwin,$(host))) | |
43 | soext=.so | |
44 | else | |
45 | soext=.dylib | |
46 | PLUGINLDFLAGS = -Wl,-undefined,dynamic_lookup | |
47 | PLUGINLDFLAGS += -Wl,-install_name,m2rte$(soext) | |
48 | PLUGINLDFLAGS += -nodefaultlibs | |
25be11e9 | 49 | PLUGINLDFLAGS += -lc |
ebc41f9a RO |
50 | endif |
51 | ||
8d2c5b61 | 52 | TEXISRC = $(srcdir)/doc/gm2.texi \ |
1eee94d3 GM |
53 | m2/gm2-libs.texi \ |
54 | m2/gm2-ebnf.texi \ | |
55 | m2/SYSTEM-pim.texi \ | |
56 | m2/SYSTEM-iso.texi \ | |
8d2c5b61 GM |
57 | m2/Builtins.texi \ |
58 | m2/gpl_v3_without_node.texi | |
1eee94d3 | 59 | |
8d2c5b61 | 60 | RSTSRC = $(srcdir)/doc/gm2.texi \ |
1eee94d3 GM |
61 | m2/gm2-libs.rst \ |
62 | m2/gm2-ebnf.rst \ | |
63 | m2/SYSTEM-pim.rst \ | |
64 | m2/SYSTEM-iso.rst \ | |
65 | m2/Builtins.rst | |
66 | ||
67 | # Define the names for selecting modula-2 in LANGUAGES. | |
68 | m2 modula-2 modula2: gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) \ | |
69 | $(GCC_PASSES) $(GCC_PARTS) | |
70 | m2.serial = cc1gm2$(exeext) | |
71 | ||
5c46cd85 GM |
72 | m2.tags: force |
73 | cd $(srcdir)/m2; $(ETAGS) -o TAGS.sub \ | |
74 | *.cc *.h gm2-gcc/*.cc gm2-gcc/*.h \ | |
75 | gm2-libs-ch/*.h gm2-libs-ch/*.c gm2-libs-ch/*.cc; \ | |
76 | $(ETAGS) --include TAGS.sub --include ../TAGS.sub | |
77 | ||
1eee94d3 GM |
78 | m2.srcinfo: doc/m2.info |
79 | -cp -p $^ $(srcdir)/doc | |
80 | ||
81 | ifeq ($(HAVE_PYTHON),yes) | |
82 | m2.srcextra: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/gm2-libs.texi m2/gm2-ebnf.texi | |
83 | -cp -p m2/SYSTEM-pim.texi $(srcdir)/m2 | |
84 | -cp -p m2/SYSTEM-iso.texi $(srcdir)/m2 | |
85 | -cp -p m2/gm2-libs.texi $(srcdir)/m2 | |
86 | -cp -p m2/gm2-ebnf.texi $(srcdir)/m2 | |
1eee94d3 GM |
87 | else |
88 | m2.srcextra: | |
89 | endif | |
90 | ||
91 | m2.srcman: doc/gm2.1 | |
92 | -cp -p $^ $(srcdir)/doc | |
93 | ||
94 | # Tell GNU make to ignore these if they exist. | |
95 | .PHONY: m2 modula-2 modula2 | |
96 | ||
97 | GM2_PROG_DEP=gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) | |
98 | ||
99 | include m2/config-make | |
100 | ||
81d5ca0b GM |
101 | # Determine if float128 should represent the Modula-2 type LONGREAL. |
102 | host_mc_longreal := $(if $(strip $(filter powerpc64le%,$(host))),--longreal=__float128) | |
103 | ||
1eee94d3 GM |
104 | LIBSTDCXX=../$(TARGET_SUBDIR)/libstdc++-v3/src/.libs/libstdc++.a |
105 | ||
106 | PGE=m2/pge$(exeext) | |
107 | ||
108 | SRC_PREFIX=G | |
109 | ||
46905fcd | 110 | ifeq ($(enable_plugin),yes) |
25be11e9 | 111 | M2RTE_PLUGIN_SO=plugin/m2rte$(soext) |
46905fcd GM |
112 | endif |
113 | ||
1eee94d3 GM |
114 | m2/gm2spec.o: $(srcdir)/m2/gm2spec.cc $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \ |
115 | m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) \ | |
116 | $(generated_files) $(C_TREE_H) insn-attr-common.h | |
117 | (SHLIB_LINK='$(SHLIB_LINK)' \ | |
118 | SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ | |
119 | $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
120 | $(DRIVER_DEFINES) \ | |
121 | -DLIBSUBDIR=\"$(libsubdir)\" \ | |
122 | -DPREFIX=\"$(prefix)\" \ | |
123 | -c $(srcdir)/m2/gm2spec.cc $(OUTPUT_OPTION)) | |
124 | ||
125 | # Create the compiler driver for M2. | |
126 | CFLAGS-m2/m2/gm2spec.o += $(DRIVER_DEFINES) | |
127 | ||
128 | GM2_OBJS = $(GCC_OBJS) prefix.o intl.o m2/gm2spec.o | |
129 | ||
130 | # Create the compiler driver for gm2. | |
131 | gm2$(exeext): $(GM2_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) \ | |
132 | m2/gm2config.h | |
133 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ | |
134 | $(GM2_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ | |
135 | $(EXTRA_GCC_LIBS) $(LIBS) | |
136 | ||
137 | # Create a version of the gm2 driver which calls the cross-compiler. | |
138 | gm2-cross$(exeext): gm2$(exeext) | |
139 | -rm -f gm2-cross$(exeext) | |
140 | cp gm2$(exeext) gm2-cross$(exeext) | |
141 | ||
142 | po-generated: | |
143 | ||
144 | # Build hooks: | |
145 | ||
46905fcd | 146 | m2.all.cross: gm2-cross$(exeext) $(M2RTE_PLUGIN_SO) |
1eee94d3 | 147 | |
46905fcd | 148 | m2.start.encap: gm2$(exeext) $(M2RTE_PLUGIN_SO) |
1eee94d3 GM |
149 | m2.rest.encap: |
150 | ||
151 | ||
152 | m2.info: doc/m2.info | |
153 | ||
154 | m2.man: doc/m2.1 | |
155 | ||
156 | m2.install-man: $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext) | |
157 | ||
158 | $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext): doc/m2.1 installdirs | |
159 | -rm -f $@ | |
160 | -$(INSTALL_DATA) $< $@ | |
161 | -chmod a-x $@ | |
162 | ||
e15e8d43 | 163 | m2.dvi: doc/m2.dvi |
1eee94d3 | 164 | |
8d2c5b61 | 165 | doc/m2.dvi: $(TEXISRC) $(objdir)/m2/images/gnu.eps |
e15e8d43 IS |
166 | $(TEXI2DVI) -c -I $(objdir)/m2 -I $(srcdir)/doc/include -o $@ $(srcdir)/doc/gm2.texi |
167 | ||
168 | doc/m2.ps: doc/m2.dvi | |
1eee94d3 GM |
169 | dvips -o $@ $< |
170 | ||
e15e8d43 IS |
171 | m2.pdf: doc/m2.pdf |
172 | ||
8d2c5b61 | 173 | doc/m2.pdf: $(TEXISRC) $(objdir)/m2/images/gnu.eps |
e15e8d43 | 174 | $(TEXI2PDF) -I $(objdir)/m2 -I $(srcdir)/doc/include $(srcdir)/doc/gm2.texi -o $@ |
1eee94d3 | 175 | |
8d2c5b61 GM |
176 | M2_PDFFILES = doc/m2.pdf |
177 | ||
178 | m2.install-pdf: $(M2_PDFFILES) | |
179 | @$(NORMAL_INSTALL) | |
180 | test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc" | |
181 | @list='$(M2_PDFFILES)'; for p in $$list; do \ | |
182 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | |
183 | f=$(pdf__strip_dir) \ | |
184 | echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \ | |
185 | $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \ | |
186 | done | |
187 | ||
1eee94d3 GM |
188 | .INTERMEDIATE: m2.pod |
189 | ||
8d2c5b61 | 190 | m2.pod: $(TEXISRC) $(objdir)/m2/images/gnu.eps |
1eee94d3 GM |
191 | -$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@ |
192 | ||
8d2c5b61 | 193 | doc/m2.info: $(TEXISRC) $(objdir)/m2/images/gnu.eps |
1eee94d3 GM |
194 | if test "x$(BUILD_INFO)" = xinfo; then \ |
195 | rm -f doc/m2.info*; \ | |
196 | $(MAKEINFO) -I$(objdir)/m2 -I$(srcdir)/doc/include \ | |
197 | -o $@ $(srcdir)/doc/gm2.texi ; \ | |
198 | else true; fi | |
199 | ||
200 | $(objdir)/m2/images/gnu.eps: $(srcdir)/m2/images/gnupng | |
8d2c5b61 | 201 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
202 | cp $(srcdir)/m2/images/gnu.eps $@ |
203 | ||
8d2c5b61 GM |
204 | m2.html: $(build_htmldir)/m2/index.html |
205 | ||
206 | $(build_htmldir)/m2/index.html: $(TEXISRC) $(objdir)/m2/images/gnu.eps | |
207 | $(mkinstalldirs) $(@D) | |
208 | rm -f $(@D)/* | |
209 | $(TEXI2HTML) -I $(objdir)/m2 -I $(srcdir)/m2 -I $(gcc_docdir)/include -o $(@D) $< | |
210 | ||
1eee94d3 GM |
211 | # gm2-libs.texi |
212 | ||
213 | m2/gm2-libs.texi: gm2-libs.texi-check; @true | |
214 | ||
215 | ifeq ($(HAVE_PYTHON),yes) | |
216 | gm2-libs.texi-check: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/Builtins.texi \ | |
217 | $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def | |
8d2c5b61 GM |
218 | -test -d m2/gm2-libs-log || $(mkinstalldirs) m2/gm2-libs-log |
219 | -test -d m2/gm2-libs-iso || $(mkinstalldirs) m2/gm2-libs-iso | |
220 | -test -d m2/gm2-libs || $(mkinstalldirs) m2/gm2-libs | |
1eee94d3 GM |
221 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -t -uLibraries -s$(srcdir)/m2 -b$(objdir)/m2 -o $(objdir)/m2/gm2-libs.texi |
222 | else | |
223 | gm2-libs.texi-check: | |
af4f6816 | 224 | cp $(srcdir)/m2/target-independent/m2/gm2-libs.texi $(objdir)/m2/gm2-libs.texi |
1eee94d3 GM |
225 | endif |
226 | $(STAMP) gm2-libs.texi-check | |
227 | ||
228 | # gm2-libs.rst | |
229 | ||
230 | m2/gm2-libs.rst: gm2-libs.rst-check; @true | |
231 | ||
232 | ifeq ($(HAVE_PYTHON),yes) | |
233 | gm2-libs.rst-check: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/Builtins.texi \ | |
234 | $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def | |
235 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -uLibraries -s$(srcdir)/m2 -b$(objdir)/m2 -o $(objdir)/m2/gm2-libs.rst | |
236 | else | |
237 | gm2-libs.rst-check: | |
af4f6816 | 238 | cp $(srcdir)/m2/target-independent/m2/gm2-libs.rst $(objdir)/m2/gm2-libs.rst |
1eee94d3 GM |
239 | endif |
240 | $(STAMP) gm2-libs.rst-check | |
241 | ||
242 | # gm2-ebnf.texi | |
243 | ||
244 | m2/gm2-ebnf.texi: gm2-ebnf.texi-check; @true | |
245 | ||
246 | gm2-ebnf.texi-check: $(PGE) $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf | |
247 | $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf -o m2/gm2-ebnf.texi | |
248 | $(STAMP) gm2-ebnf.texi-check | |
249 | ||
250 | # gm2-ebnf.rst | |
251 | ||
252 | m2/gm2-ebnf.rst: gm2-ebnf.rst-check; @true | |
253 | ||
254 | gm2-ebnf.rst-check: $(PGE) $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf | |
255 | $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf -o m2/gm2-ebnf.rst | |
256 | $(STAMP) gm2-ebnf.rst-check | |
257 | ||
258 | # SYSTEM-pim.texi | |
259 | ||
260 | m2/SYSTEM-pim.texi: SYSTEM-pim-texi-check; @true | |
261 | ||
262 | ifeq ($(HAVE_PYTHON),yes) | |
263 | SYSTEM-pim-texi-check: $(objdir)/m2/gm2-libs/SYSTEM.def | |
264 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -t -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs/SYSTEM.def -o $(objdir)/m2/SYSTEM-pim.texi | |
265 | else | |
266 | SYSTEM-pim-texi-check: $(objdir)/m2/gm2-libs/SYSTEM.def | |
af4f6816 | 267 | cp $(srcdir)/m2/target-independent/m2/SYSTEM-pim.texi $(objdir)/m2/SYSTEM-pim.texi |
1eee94d3 GM |
268 | endif |
269 | $(STAMP) SYSTEM-pim-texi-check | |
270 | ||
271 | # SYSTEM-pim.rst | |
272 | ||
273 | m2/SYSTEM-pim.rst: SYSTEM-pim-rst-check; @true | |
274 | ||
275 | ifeq ($(HAVE_PYTHON),yes) | |
276 | SYSTEM-pim-rst-check: $(objdir)/m2/gm2-libs/SYSTEM.def | |
277 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs/SYSTEM.def -o $(objdir)/m2/SYSTEM-pim.rst | |
278 | else | |
279 | SYSTEM-pim-rst-check: $(objdir)/m2/gm2-libs/SYSTEM.def | |
af4f6816 | 280 | cp $(srcdir)/m2/target-independent/m2/SYSTEM-pim.rst $(objdir)/m2/SYSTEM-pim.rst |
1eee94d3 GM |
281 | endif |
282 | $(STAMP) SYSTEM-pim-rst-check | |
283 | ||
284 | # SYSTEM-pim.texi | |
285 | ||
286 | m2/SYSTEM-iso.texi: SYSTEM-iso.texi-check; @true | |
287 | ||
288 | ifeq ($(HAVE_PYTHON),yes) | |
289 | SYSTEM-iso.texi-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def | |
290 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -t -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs-iso/SYSTEM.def -o $(objdir)/m2/SYSTEM-iso.texi | |
291 | else | |
292 | SYSTEM-iso.texi-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def | |
af4f6816 | 293 | cp $(srcdir)/m2/target-independent/m2/SYSTEM-iso.texi $(objdir)/m2/SYSTEM-iso.texi |
1eee94d3 GM |
294 | endif |
295 | $(STAMP) SYSTEM-iso.texi-check | |
296 | ||
297 | # SYSTEM-pim.rst | |
298 | ||
299 | m2/SYSTEM-iso.rst: SYSTEM-iso.rst-check; @true | |
300 | ||
301 | ifeq ($(HAVE_PYTHON),yes) | |
302 | SYSTEM-iso.rst-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def | |
303 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs-iso/SYSTEM.def -o $(objdir)/m2/SYSTEM-iso.rst | |
304 | else | |
305 | SYSTEM-iso.rst-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def | |
af4f6816 | 306 | cp $(srcdir)/m2/target-independent/m2/SYSTEM-iso.rst $(objdir)/m2/SYSTEM-iso.rst |
1eee94d3 GM |
307 | endif |
308 | $(STAMP) SYSTEM-iso.rst-check | |
309 | ||
310 | ||
311 | # m2/Builtins.texi | |
312 | ||
313 | m2/Builtins.texi: Builtins.texi-check; @true | |
314 | ||
315 | ifeq ($(HAVE_PYTHON),yes) | |
316 | Builtins.texi-check: m2/gm2-libs/Builtins.def | |
317 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -t -b./ -f$(srcdir)/m2/gm2-libs/Builtins.def -o $(objdir)/m2/Builtins.texi | |
318 | else | |
319 | Builtins.texi-check: m2/gm2-libs/Builtins.def | |
af4f6816 | 320 | cp $(srcdir)/m2/target-independent/m2/Builtins.texi $(objdir)/m2/Builtins.texi |
1eee94d3 GM |
321 | endif |
322 | $(STAMP) Builtins.texi-check | |
323 | ||
324 | # m2/Builtins.rst | |
325 | ||
326 | m2/Builtins.rst: Builtins.rst-check; @true | |
327 | ||
328 | ifeq ($(HAVE_PYTHON),yes) | |
329 | Builtins.rst-check: m2/gm2-libs/Builtins.def | |
330 | $(PYTHON) $(srcdir)/m2/tools-src/def2doc.py -x -b./ -f$(srcdir)/m2/gm2-libs/Builtins.def -o $(objdir)/m2/Builtins.rst | |
331 | else | |
332 | Builtins.rst-check: m2/gm2-libs/Builtins.def | |
af4f6816 | 333 | cp $(srcdir)/m2/target-independent/m2/Builtins.rst $(objdir)/m2/Builtins.rst |
1eee94d3 GM |
334 | endif |
335 | $(STAMP) Builtins.rst-check | |
336 | ||
8d2c5b61 GM |
337 | m2/gpl_v3_without_node.texi: doc/include/gpl_v3.texi |
338 | grep -v "^@node" $< > $@ | |
339 | ||
5b918b20 GM |
340 | # Stage hooks: |
341 | # The toplevel makefile has already created stage?/m2 at this point. | |
1eee94d3 | 342 | |
5b918b20 GM |
343 | m2.stage1: stage1-start |
344 | -mv m2/*$(objext) stage1/m2 | |
345 | m2.stage2: stage2-start | |
346 | -mv m2/*$(objext) stage2/m2 | |
347 | m2.stage3: stage3-start | |
348 | -mv m2/*$(objext) stage3/m2 | |
349 | m2.stage4: stage4-start | |
350 | -mv m2/*$(objext) stage4/m2 | |
351 | m2.stageprofile: stageprofile-start | |
352 | -mv m2/*$(objext) stageprofile/m2 | |
353 | m2.stagefeedback: stageprofile-start | |
354 | -mv m2/*$(objext) stagefeedback/m2 | |
1eee94d3 GM |
355 | |
356 | # No gm2-specific selftests | |
357 | selftest-m2: | |
358 | ||
359 | # Install hooks: | |
360 | # cc1gm2 is installed elsewhere as part of $(COMPILERS). | |
361 | # $(COMPILERS) is defined in `config-lang.in' | |
362 | ||
363 | m2.install-common: installdirs | |
364 | -rm -f $(DESTDIR)$(bindir)/$(GM2_INSTALL_NAME)$(exeext) | |
365 | $(INSTALL_PROGRAM) gm2$(exeext) $(DESTDIR)$(bindir)/$(GM2_INSTALL_NAME)$(exeext) | |
366 | -if test -f cc1gm2$(exeext); then \ | |
367 | if test -f gm2-cross$(exeext); then \ | |
368 | :; \ | |
369 | else \ | |
370 | rm -f $(DESTDIR)$(bindir)/$(GM2_TARGET_INSTALL_NAME)$(exeext); \ | |
371 | ( cd $(DESTDIR)$(bindir) && \ | |
372 | $(LN) $(GM2_INSTALL_NAME)$(exeext) $(GM2_TARGET_INSTALL_NAME)$(exeext) ); \ | |
373 | fi; \ | |
374 | fi | |
375 | -for tool in cc1gm2$(exeext); do \ | |
376 | if [ -f $$tool ]; then \ | |
377 | rm -f $(DESTDIR)$(libexecsubdir)/$$tool; \ | |
378 | $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(libexecsubdir)/$$tool; \ | |
379 | chmod a+x $(DESTDIR)$(libexecsubdir)/$$tool; \ | |
380 | else \ | |
381 | echo "cannot find $$tool" ; \ | |
382 | fi ; \ | |
383 | done | |
384 | ||
385 | m2.install-info: installdirs | |
386 | if [ -d gm2$(exeext) ] ; then \ | |
387 | if [ -f $(objdir)/doc/gm2.info ]; then \ | |
388 | rm -f $(DESTDIR)$(infodir)/gm2.info*; \ | |
389 | for f in $(objdir)/doc/gm2.info*; do \ | |
390 | realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ | |
391 | rm -f $(DESTDIR)$(infodir)/`basename $$realfile`; \ | |
392 | $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/`basename $$realfile`; \ | |
393 | done; \ | |
394 | chmod a-x $(DESTDIR)$(infodir)/gm2.info*; \ | |
395 | else true; fi; \ | |
396 | else true; fi | |
397 | -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/gm2.info ]; then \ | |
398 | if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ | |
399 | install-info --dir-file=$(infodir)/dir $(DESTDIR)$(infodir)/gm2.info; \ | |
400 | else true; fi; \ | |
401 | else true; fi | |
402 | ||
403 | m2.install-normal: m2.install-common m2.install-info m2.install-man | |
404 | ||
405 | # This target will install GM2 into an existing GCC installation, | |
406 | # without overwriting existing files. | |
407 | # The semicolon is to prevent the install.sh -> install default rule | |
408 | # from doing anything. Having it run true helps avoid problems and | |
409 | # noise from versions of make which don't like to have null commands. | |
410 | m2.install: m2.install-normal; @true | |
411 | ||
412 | gm2.install-with-gcc: $(INSTALL_HEADERS) gm2.install $(INSTALL_LIBGCC) | |
413 | for file in $(GCC_PASSES); do \ | |
414 | if [ x"$$file" != x"xgcc$(exeext)" ]; then \ | |
415 | rm -f $(DESTDIR)$(libsubdir)/$$file; \ | |
416 | $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file || exit 1; \ | |
417 | fi; \ | |
418 | done; exit 0 | |
419 | ||
420 | m2.uninstall: | |
421 | -rm -rf $(bindir)/$(GM2_INSTALL_NAME) | |
422 | -rm -rf $(bindir)/$(GM2_CROSS_NAME) | |
423 | ||
46905fcd | 424 | ifeq ($(enable_plugin),yes) |
1eee94d3 GM |
425 | m2.install-plugin: installdirs |
426 | $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir) | |
46905fcd | 427 | $(INSTALL_PROGRAM) $(M2RTE_PLUGIN_SO) $(DESTDIR)$(plugin_resourcesdir)/m2rte$(soext) |
ebc41f9a RO |
428 | chmod a+x $(DESTDIR)$(plugin_resourcesdir)/m2rte$(soext) |
429 | ||
430 | override PLUGINCFLAGS := $(filter-out -mdynamic-no-pic,$(PLUGINCFLAGS)) | |
1eee94d3 | 431 | |
ebc41f9a | 432 | plugin/m2rte$(soext): $(srcdir)/m2/plugin/m2rte.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) \ |
1eee94d3 | 433 | insn-attr-common.h insn-flags.h $(generated_files) |
8d2c5b61 | 434 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
ebc41f9a RO |
435 | $(PLUGINCC) $(PLUGINCFLAGS) -fno-rtti -I. -I$(srcdir) $(INCINTL) -I$(srcdir)/m2 -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/../include -I$(srcdir)/../libcpp/include -Wall $(GMPINC) -Wno-literal-suffix -fPIC -c -o plugin/m2rte.o $(srcdir)/m2/plugin/m2rte.cc |
436 | $(PLUGINCC) $(PLUGINCFLAGS) $(PLUGINLDFLAGS) $(PLUGINLIBS) $(LIBINTL) -fno-rtti plugin/m2rte.o -shared -o $@ | |
46905fcd GM |
437 | else |
438 | m2.install-plugin: | |
439 | ||
25be11e9 | 440 | plugin/m2rte$(soext): |
46905fcd GM |
441 | |
442 | endif | |
1eee94d3 GM |
443 | |
444 | ||
445 | # Clean hooks: | |
446 | # A lot of the ancillary files are deleted by the main makefile. | |
447 | # We just have to delete files specific to us. | |
448 | ||
449 | m2.mostlyclean: | |
450 | -rm -f m2/*.o | |
451 | ||
452 | m2.clean: | |
453 | -rm -f m2/*.o | |
454 | -rm -f m2/gm2-libs/config.* | |
455 | -rm m2/gm2-libs/gm2-libs-host.h m2/gm2config.h | |
456 | ||
457 | m2.extraclean: | |
458 | m2.realclean: | |
459 | ||
1eee94d3 GM |
460 | quit: force |
461 | echo "calling exit" | |
462 | exit 1 | |
463 | ||
464 | # Rules to build the compiler, pge and mc. | |
465 | ||
466 | # MC_COPYRIGHT=--gpl-header --project="GNU Modula-2" | |
467 | MC_COPYRIGHT= | |
468 | ||
469 | MC_ARGS= --olang=c++ \ | |
470 | --h-file-prefix=$(SRC_PREFIX) \ | |
471 | -I$(srcdir)/m2/gm2-libs \ | |
472 | -I$(srcdir)/m2/gm2-compiler \ | |
473 | -I$(srcdir)/m2/gm2-libiberty \ | |
474 | -I$(srcdir)/m2/gm2-gcc \ | |
475 | --quiet \ | |
476 | $(MC_COPYRIGHT) \ | |
81d5ca0b GM |
477 | --gcc-config-system \ |
478 | $(host_mc_longreal) | |
1eee94d3 GM |
479 | |
480 | MCDEPS=m2/boot-bin/mc$(exeext) | |
481 | ||
482 | MC=m2/boot-bin/mc$(exeext) $(MC_ARGS) | |
483 | ||
484 | MC_LIBS=m2/mc-boot-ch/Glibc.o m2/mc-boot-ch/Gmcrts.o | |
485 | ||
486 | M2LINK=m2/boot-bin/mklink$(exeext) | |
5bb27a1b | 487 | GM2_O=-O0 |
1eee94d3 GM |
488 | GM2_O_S3=-O |
489 | GM2_OS=-Os | |
490 | GM2_G=-g -fm2-g | |
491 | GM2_CPP= | |
492 | # GM2_DEBUG_STRMEM=-fcpp | |
493 | GM2_DEBUG_STRMEM= | |
3af2af15 GM |
494 | GM2_FLAGS=-fsoft-check-all \ |
495 | -fno-return \ | |
9fadd8de | 496 | $(GM2_G) $(GM2_O) \ |
1eee94d3 | 497 | -funbounded-by-reference -fpim -fextended-opaque \ |
3af2af15 GM |
498 | -Wcase-enum -Wpedantic-cast -Wpedantic-param-names \ |
499 | -Wreturn-type -Wunused-variable -Wuninit-variable-checking \ | |
500 | -ffunction-sections -fdata-sections \ | |
501 | $(GM2_CPP) # -fauto-init | |
1eee94d3 | 502 | GM2_ISO_FLAGS=-fsoft-check-all $(GM2_G) $(GM2_O) \ |
3af2af15 | 503 | -fno-return \ |
1eee94d3 | 504 | -funbounded-by-reference -fiso -fextended-opaque \ |
3af2af15 GM |
505 | -Wcase-enum -Wpedantic-cast -Wpedantic-param-names -Wreturn-type \ |
506 | -Wunused-variable -Wuninit-variable-checking \ | |
507 | -ffunction-sections -fdata-sections \ | |
508 | $(GM2_CPP) | |
1eee94d3 GM |
509 | GM2_MIN_FLAGS=$(GM2_G) $(GM2_OS) \ |
510 | -funbounded-by-reference -fextended-opaque \ | |
511 | -Wpedantic-cast -Wpedantic-param-names -fno-exceptions \ | |
512 | -ffunction-sections -fdata-sections $(GM2_CPP) | |
513 | ||
b6cb10af MP |
514 | # ALL_LINKERFLAGS may include -pie (when GCC is configured with |
515 | # --enable-host-pie), so use -fPIE if needed. (It would not be | |
516 | # a good idea to override CFLAGS.) | |
517 | GM2_PICFLAGS = $(PICFLAG) | |
518 | ||
1eee94d3 GM |
519 | O2=-O2 -g |
520 | SO_O2=-O2 -g -fPIC | |
521 | SO=-O0 -g -fPIC | |
522 | ||
523 | # Language-specific object files for the gm2 compiler. | |
524 | ||
525 | GM2_C_OBJS = m2/gm2-lang.o \ | |
1eee94d3 GM |
526 | m2/m2pp.o \ |
527 | m2/gm2-gcc/m2assert.o \ | |
528 | m2/gm2-gcc/m2block.o \ | |
529 | m2/gm2-gcc/m2builtins.o \ | |
530 | m2/gm2-gcc/m2except.o \ | |
531 | m2/gm2-gcc/m2color.o \ | |
532 | m2/gm2-gcc/m2configure.o \ | |
533 | m2/gm2-gcc/m2convert.o \ | |
534 | m2/gm2-gcc/m2decl.o \ | |
535 | m2/gm2-gcc/m2expr.o \ | |
536 | m2/gm2-gcc/m2linemap.o \ | |
537 | m2/gm2-gcc/m2statement.o \ | |
538 | m2/gm2-gcc/m2type.o \ | |
539 | m2/gm2-gcc/m2tree.o \ | |
540 | m2/gm2-gcc/m2treelib.o \ | |
541 | m2/gm2-gcc/m2top.o \ | |
542 | m2/gm2-gcc/m2misc.o \ | |
543 | m2/gm2-gcc/init.o | |
544 | GM2_LIBS = m2/gm2-compiler/gm2.a \ | |
5bb27a1b | 545 | m2/gm2-libs/libgm2.a \ |
1eee94d3 GM |
546 | |
547 | GM2_LIBS_BOOT = m2/gm2-compiler-boot/gm2.a \ | |
548 | m2/gm2-libs-boot/libgm2.a \ | |
549 | $(GM2-BOOT-O) | |
550 | ||
01f6e8b0 GM |
551 | m2_OBJS = $(GM2_C_OBJS) m2/gm2-gcc/rtegraph.o \ |
552 | m2/gm2-compiler-boot/m2flex.o | |
00bfc503 | 553 | |
5b918b20 | 554 | cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) $(m2.prev) |
1eee94d3 GM |
555 | cp -p $< $@ |
556 | ||
79c73122 | 557 | m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o \ |
1eee94d3 | 558 | $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \ |
46905fcd | 559 | m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) |
8d2c5b61 | 560 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
561 | @$(call LINK_PROGRESS,$(INDEX.m2),start) |
562 | +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler/m2flex.o \ | |
563 | attribs.o \ | |
564 | $(GM2_LIBS) \ | |
573dbd51 | 565 | $(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o \ |
1eee94d3 GM |
566 | $(BACKENDLIBS) $(LIBSTDCXX) -lm |
567 | @$(call LINK_PROGRESS,$(INDEX.m2),end) | |
568 | ||
5b918b20 | 569 | m2/stage1/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \ |
79c73122 | 570 | $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \ |
1eee94d3 | 571 | $(GM2_LIBS_BOOT) $(MC_LIBS) \ |
46905fcd | 572 | m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) \ |
1eee94d3 | 573 | $(m2.prev) |
8d2c5b61 | 574 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
575 | @$(call LINK_PROGRESS,$(INDEX.m2),start) |
576 | +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler-boot/m2flex.o \ | |
577 | attribs.o \ | |
578 | $(GM2_LIBS_BOOT) $(MC_LIBS) \ | |
573dbd51 | 579 | m2/gm2-gcc/rtegraph.o \ |
1eee94d3 GM |
580 | $(BACKEND) $(LIBS) $(BACKENDLIBS) |
581 | @$(call LINK_PROGRESS,$(INDEX.m2),end) | |
582 | ||
583 | # Compiling object files from source files. | |
584 | ||
585 | GCC_HEADER_DEPENDENCIES_FOR_M2 = $(BUILD-BOOT-H) $(TIMEVAR_H) m2/gm2config.h $(CONFIG_H) \ | |
586 | $(TREE_H) $(RTL_H) $(TARGET_H) $(PLUGIN_HEADERS) \ | |
587 | $(BCONFIG_H) $(CORETYPES_H) $(SYSTEM_H) \ | |
588 | $(srcdir)/flags.h gtype-m2.h \ | |
589 | $(generated_files) insn-attr-common.h | |
590 | ||
591 | m2/gm2-gcc/%.o: $(srcdir)/m2/gm2-gcc/%.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) | |
ef6696af GM |
592 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
593 | $(COMPILER) $(CM2DEP) -c -g $(ALL_COMPILERFLAGS) \ | |
1eee94d3 | 594 | $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) |
ef6696af | 595 | $(POSTCOMPILE) |
1eee94d3 GM |
596 | |
597 | m2/gm2-gcc/m2configure.o: $(srcdir)/m2/gm2-gcc/m2configure.cc \ | |
598 | $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \ | |
599 | m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) \ | |
600 | $(generated_files) $(C_TREE_H) insn-attr-common.h | |
ef6696af GM |
601 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
602 | $(COMPILER) $(CM2DEP) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
1eee94d3 GM |
603 | $(DRIVER_DEFINES) \ |
604 | -DLIBSUBDIR=\"$(libsubdir)\" \ | |
605 | -DPREFIX=\"$(prefix)\" \ | |
606 | -c $(srcdir)/m2/gm2-gcc/m2configure.cc $(OUTPUT_OPTION) | |
ef6696af | 607 | $(POSTCOMPILE) |
1eee94d3 GM |
608 | |
609 | m2/gm2-lang.o: $(srcdir)/m2/gm2-lang.cc gt-m2-gm2-lang.h $(GCC_HEADER_DEPENDENCIES_FOR_M2) | |
ef6696af | 610 | $(COMPILER) $(CM2DEP) -c -g $(GM2GCC) $(ALL_COMPILERFLAGS) \ |
47b269ca | 611 | -DLIBSUBDIR=\"$(libsubdir)\" \ |
1eee94d3 | 612 | $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) |
ef6696af | 613 | $(POSTCOMPILE) |
1eee94d3 | 614 | |
1eee94d3 | 615 | m2/m2pp.o : $(srcdir)/m2/m2pp.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) |
ef6696af | 616 | $(COMPILER) $(CM2DEP) -c -g -DGM2 $(ALL_COMPILERFLAGS) \ |
1eee94d3 | 617 | $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) |
ef6696af | 618 | $(POSTCOMPILE) |
1eee94d3 GM |
619 | |
620 | m2/gm2-gcc/rtegraph.o: $(srcdir)/m2/gm2-gcc/rtegraph.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) \ | |
621 | gt-m2-rtegraph.h | |
ef6696af GM |
622 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
623 | $(COMPILER) $(CM2DEP) -c -g $(GM2GCC) $(ALL_COMPILERFLAGS) \ | |
1eee94d3 | 624 | $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION) |
ef6696af | 625 | $(POSTCOMPILE) |
1eee94d3 | 626 | |
1eee94d3 | 627 | m2/gm2-gcc/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-gcc/%.def $(MCDEPS) |
8d2c5b61 | 628 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
629 | $(MC) -o=$@ $(srcdir)/m2/gm2-gcc/$*.def |
630 | ||
c980eeb8 GM |
631 | ifeq ($(HAVE_PYTHON),yes) |
632 | check-format-error: | |
633 | $(PYTHON) $(srcdir)/m2/tools-src/checkmeta.py -s $(srcdir)/m2/gm2-compiler | |
634 | else | |
635 | check-format-error: | |
636 | endif | |
637 | ||
1eee94d3 GM |
638 | # The following tables define the source files which are translated into C using mc |
639 | # and defines the system interface C files. | |
640 | ||
641 | # Core library definition modules found in gm2-libs. | |
642 | ||
643 | GM2-LIBS-BOOT-DEFS = \ | |
644 | ASCII.def \ | |
645 | Args.def \ | |
646 | Assertion.def \ | |
647 | Break.def \ | |
648 | CmdArgs.def \ | |
649 | Debug.def \ | |
650 | DynamicStrings.def \ | |
651 | Environment.def \ | |
652 | FIO.def \ | |
653 | FormatStrings.def \ | |
654 | FpuIO.def \ | |
655 | IO.def \ | |
656 | Indexing.def \ | |
657 | M2Dependent.def \ | |
658 | M2EXCEPTION.def \ | |
1eee94d3 GM |
659 | M2RTS.def \ |
660 | NumberIO.def \ | |
661 | PushBackInput.def \ | |
662 | RTExceptions.def \ | |
663 | SArgs.def \ | |
664 | SEnvironment.def \ | |
665 | SFIO.def \ | |
666 | SYSTEM.def \ | |
667 | Scan.def \ | |
668 | StdIO.def \ | |
669 | Storage.def \ | |
670 | StrCase.def \ | |
671 | StrIO.def \ | |
672 | StrLib.def \ | |
673 | StringConvert.def \ | |
674 | SysExceptions.def \ | |
675 | SysStorage.def \ | |
676 | TimeString.def \ | |
677 | UnixArgs.def \ | |
678 | dtoa.def \ | |
679 | errno.def \ | |
680 | ldtoa.def \ | |
681 | libc.def \ | |
682 | libm.def \ | |
683 | termios.def \ | |
684 | wrapc.def \ | |
685 | ||
686 | # Core library implementation modules found in gm2-libs. | |
687 | ||
688 | GM2-LIBS-BOOT-MODS = \ | |
689 | ASCII.mod \ | |
690 | Args.mod \ | |
691 | Assertion.mod \ | |
692 | Break.mod \ | |
693 | CmdArgs.mod \ | |
694 | Debug.mod \ | |
695 | DynamicStrings.mod \ | |
696 | Environment.mod \ | |
697 | FIO.mod \ | |
698 | FormatStrings.mod \ | |
699 | FpuIO.mod \ | |
700 | IO.mod \ | |
701 | Indexing.mod \ | |
702 | M2Dependent.mod \ | |
703 | M2EXCEPTION.mod \ | |
704 | M2RTS.mod \ | |
705 | NumberIO.mod \ | |
706 | PushBackInput.mod \ | |
707 | RTExceptions.mod \ | |
708 | SArgs.mod \ | |
709 | SEnvironment.mod \ | |
710 | SFIO.mod \ | |
711 | Scan.mod \ | |
712 | Storage.mod \ | |
713 | StrCase.mod \ | |
714 | StrIO.mod \ | |
715 | StrLib.mod \ | |
716 | StringConvert.mod \ | |
717 | SysStorage.mod \ | |
718 | TimeString.mod \ | |
719 | ||
720 | # Hand translated C files and C files for definition module for "C" modules | |
721 | # found in gm2-libs-ch. | |
722 | ||
723 | GM2-LIBS-BOOT-C = \ | |
724 | StdIO.c \ | |
725 | SysExceptions.c \ | |
726 | choosetemp.c \ | |
727 | errno.c \ | |
728 | termios.c \ | |
729 | wrapc.c \ | |
730 | ||
731 | # C++ implemented modules found in gm2-libs-ch. | |
732 | ||
733 | GM2-LIBS-BOOT-CC = \ | |
734 | UnixArgs.cc \ | |
735 | dtoa.cc \ | |
736 | ldtoa.cc | |
737 | ||
738 | # Definition modules for the front end found in gm2-compiler. | |
739 | ||
740 | GM2-COMP-BOOT-DEFS = \ | |
741 | FifoQueue.def \ | |
742 | Lists.def \ | |
743 | M2ALU.def \ | |
744 | M2AsmUtil.def \ | |
745 | M2Base.def \ | |
746 | M2BasicBlock.def \ | |
747 | M2Batch.def \ | |
748 | M2Bitset.def \ | |
749 | M2CaseList.def \ | |
750 | M2Check.def \ | |
751 | M2Code.def \ | |
752 | M2ColorString.def \ | |
753 | M2Comp.def \ | |
754 | M2Const.def \ | |
755 | M2Debug.def \ | |
756 | M2DebugStack.def \ | |
757 | M2Defaults.def \ | |
758 | M2DriverOptions.def \ | |
05652ac4 GM |
759 | DynamicPath.def \ |
760 | PathName.def \ | |
1eee94d3 GM |
761 | M2Emit.def \ |
762 | M2Error.def \ | |
763 | M2EvalSym.def \ | |
764 | M2FileName.def \ | |
765 | M2GCCDeclare.def \ | |
766 | M2GenGCC.def \ | |
767 | M2Graph.def \ | |
768 | M2LexBuf.def \ | |
769 | M2MetaError.def \ | |
770 | M2Optimize.def \ | |
771 | M2Options.def \ | |
772 | M2Pass.def \ | |
773 | M2Preprocess.def \ | |
774 | M2Printf.def \ | |
775 | M2Quads.def \ | |
776 | M2Quiet.def \ | |
777 | M2Range.def \ | |
778 | M2Reserved.def \ | |
779 | M2SSA.def \ | |
780 | M2Scaffold.def \ | |
781 | M2Scope.def \ | |
782 | M2Search.def \ | |
783 | M2Size.def \ | |
784 | M2StackAddress.def \ | |
785 | M2StackWord.def \ | |
786 | M2Students.def \ | |
787 | M2Swig.def \ | |
b0762d4c | 788 | M2SymInit.def \ |
1eee94d3 GM |
789 | M2System.def \ |
790 | NameKey.def \ | |
791 | ObjectFiles.def \ | |
792 | Output.def \ | |
793 | P0SymBuild.def \ | |
794 | P0SyntaxCheck.def \ | |
795 | P1Build.def \ | |
796 | P1SymBuild.def \ | |
797 | P2Build.def \ | |
798 | P2SymBuild.def \ | |
799 | P3Build.def \ | |
800 | P3SymBuild.def \ | |
801 | PCBuild.def \ | |
802 | PCSymBuild.def \ | |
803 | PHBuild.def \ | |
804 | Sets.def \ | |
805 | SymbolConversion.def \ | |
806 | SymbolKey.def \ | |
807 | SymbolTable.def \ | |
808 | bnflex.def \ | |
809 | m2flex.def \ | |
810 | ||
811 | # Implementation modules for the front end found in gm2-compiler. | |
812 | ||
813 | GM2-COMP-BOOT-MODS = \ | |
814 | FifoQueue.mod \ | |
815 | Lists.mod \ | |
816 | Lists.mod \ | |
817 | M2ALU.mod \ | |
818 | M2AsmUtil.mod \ | |
819 | M2Base.mod \ | |
820 | M2BasicBlock.mod \ | |
821 | M2Batch.mod \ | |
822 | M2Bitset.mod \ | |
823 | M2CaseList.mod \ | |
824 | M2Check.mod \ | |
825 | M2Code.mod \ | |
826 | M2ColorString.mod \ | |
827 | M2Comp.mod \ | |
828 | M2Const.mod \ | |
829 | M2Debug.mod \ | |
830 | M2DebugStack.mod \ | |
831 | M2Defaults.mod \ | |
832 | M2DriverOptions.mod \ | |
05652ac4 GM |
833 | DynamicPath.mod \ |
834 | PathName.mod \ | |
1eee94d3 GM |
835 | M2Emit.mod \ |
836 | M2Error.mod \ | |
837 | M2FileName.mod \ | |
838 | M2GCCDeclare.mod \ | |
839 | M2GenGCC.mod \ | |
840 | M2Graph.mod \ | |
841 | M2LexBuf.mod \ | |
842 | M2MetaError.mod \ | |
843 | M2Optimize.mod \ | |
844 | M2Options.mod \ | |
845 | M2Pass.mod \ | |
846 | M2Preprocess.mod \ | |
847 | M2Printf.mod \ | |
848 | M2Quads.mod \ | |
849 | M2Quiet.mod \ | |
850 | M2Range.mod \ | |
851 | M2Reserved.mod \ | |
852 | M2SSA.mod \ | |
853 | M2Scaffold.mod \ | |
854 | M2Scope.mod \ | |
855 | M2Search.mod \ | |
856 | M2Size.mod \ | |
857 | M2StackAddress.mod \ | |
858 | M2StackWord.mod \ | |
859 | M2Students.mod \ | |
860 | M2Swig.mod \ | |
b0762d4c | 861 | M2SymInit.mod \ |
1eee94d3 GM |
862 | M2System.mod \ |
863 | NameKey.mod \ | |
864 | NameKey.mod \ | |
865 | ObjectFiles.mod \ | |
866 | Output.mod \ | |
867 | P0SymBuild.mod \ | |
868 | P1SymBuild.mod \ | |
869 | P2SymBuild.mod \ | |
870 | P3SymBuild.mod \ | |
871 | PCSymBuild.mod \ | |
872 | Sets.mod \ | |
873 | SymbolConversion.mod \ | |
874 | SymbolKey.mod \ | |
875 | SymbolKey.mod \ | |
876 | SymbolTable.mod \ | |
877 | bnflex.mod \ | |
878 | ||
879 | # The interface between the modula-2 front end and gimple/trees found in directory gm2-gcc. | |
880 | ||
881 | GM2-GCC-DEFS = \ | |
882 | m2block.def \ | |
883 | m2builtins.def \ | |
884 | m2color.def \ | |
885 | m2configure.def \ | |
886 | m2convert.def \ | |
887 | m2decl.def \ | |
888 | m2except.def \ | |
889 | m2except.def \ | |
890 | m2expr.def \ | |
891 | m2linemap.def \ | |
892 | m2misc.def \ | |
893 | m2statement.def \ | |
894 | m2top.def \ | |
895 | m2tree.def \ | |
896 | m2treelib.def \ | |
897 | m2type.def \ | |
898 | ||
899 | # The following lists define the source files used to build gm2 using Modula-2 | |
900 | # sources directly. | |
901 | # | |
902 | # cc1gm2$(exeext) uses these definition modules from the core libraries. | |
903 | ||
904 | GM2-LIBS-DEFS = \ | |
905 | ASCII.def \ | |
906 | Args.def \ | |
907 | Assertion.def \ | |
908 | Break.def \ | |
909 | Builtins.def \ | |
910 | COROUTINES.def \ | |
911 | CmdArgs.def \ | |
912 | Debug.def \ | |
913 | DynamicStrings.def \ | |
914 | Environment.def \ | |
915 | FIO.def \ | |
916 | FormatStrings.def \ | |
917 | FpuIO.def \ | |
918 | GetOpt.def \ | |
919 | IO.def \ | |
920 | Indexing.def \ | |
921 | LMathLib0.def \ | |
922 | LegacyReal.def \ | |
923 | M2Dependent.def \ | |
924 | M2EXCEPTION.def \ | |
1eee94d3 GM |
925 | M2RTS.def \ |
926 | MathLib0.def \ | |
927 | MemUtils.def \ | |
928 | NumberIO.def \ | |
929 | PushBackInput.def \ | |
930 | RTExceptions.def \ | |
931 | RTint.def \ | |
932 | SArgs.def \ | |
933 | SEnvironment.def \ | |
934 | SFIO.def \ | |
935 | SMathLib0.def \ | |
936 | SYSTEM.def \ | |
937 | Scan.def \ | |
938 | StdIO.def \ | |
939 | Storage.def \ | |
940 | StrCase.def \ | |
941 | StrIO.def \ | |
942 | StrLib.def \ | |
943 | StringConvert.def \ | |
944 | SysStorage.def \ | |
945 | TimeString.def \ | |
946 | UnixArgs.def \ | |
947 | cbuiltin.def \ | |
948 | dtoa.def \ | |
949 | ldtoa.def \ | |
950 | libc.def \ | |
951 | termios.def \ | |
952 | wrapc.def \ | |
953 | ||
954 | # cc1gm2$(exeext) uses these implementation modules from the core libraries. | |
955 | ||
956 | GM2-LIBS-MODS = \ | |
957 | ASCII.mod \ | |
958 | Args.mod \ | |
959 | Assertion.mod \ | |
960 | Break.mod \ | |
961 | Builtins.mod \ | |
962 | COROUTINES.mod \ | |
963 | CmdArgs.mod \ | |
964 | Debug.mod \ | |
965 | DynamicStrings.mod \ | |
966 | Environment.mod \ | |
967 | FIO.mod \ | |
968 | FormatStrings.mod \ | |
969 | FpuIO.mod \ | |
970 | GetOpt.mod \ | |
971 | IO.mod \ | |
972 | Indexing.mod \ | |
973 | LMathLib0.mod \ | |
974 | LegacyReal.mod \ | |
975 | M2Dependent.mod \ | |
976 | M2EXCEPTION.mod \ | |
977 | M2RTS.mod \ | |
978 | MathLib0.mod \ | |
979 | MemUtils.mod \ | |
980 | NumberIO.mod \ | |
981 | PushBackInput.mod \ | |
982 | RTExceptions.mod \ | |
983 | RTint.mod \ | |
984 | SArgs.mod \ | |
985 | SEnvironment.mod \ | |
986 | SFIO.mod \ | |
987 | SMathLib0.mod \ | |
988 | SYSTEM.mod \ | |
989 | Scan.mod \ | |
990 | StdIO.mod \ | |
991 | Storage.mod \ | |
992 | StrCase.mod \ | |
993 | StrIO.mod \ | |
994 | StrLib.mod \ | |
995 | StringConvert.mod \ | |
996 | SysStorage.mod \ | |
997 | TimeString.mod \ | |
998 | ||
999 | # cc1gm2$(exeext) uses these C modules from the core libraries. | |
1000 | ||
1001 | GM2-LIBS-C = \ | |
1002 | Selective.c \ | |
1003 | SysExceptions.c \ | |
1004 | cgetopt.c \ | |
1005 | choosetemp.c \ | |
1006 | errno.c \ | |
1007 | host.c \ | |
1008 | termios.c \ | |
1009 | wrapc.c \ | |
1010 | ||
1011 | # cc1gm2$(exeext) uses these C++ modules from the core libraries. | |
1012 | ||
1013 | GM2-LIBS-CC = \ | |
1014 | UnixArgs.cc \ | |
1015 | dtoa.cc \ | |
1016 | ldtoa.cc \ | |
1017 | ||
1018 | # cc1gm2$(exeext) uses these definition modules found in the gm2-compiler directory. | |
1019 | ||
1020 | GM2-COMP-DEFS = \ | |
1021 | FifoQueue.def \ | |
1022 | Lists.def \ | |
1023 | M2ALU.def \ | |
1024 | M2AsmUtil.def \ | |
1025 | M2Base.def \ | |
1026 | M2BasicBlock.def \ | |
1027 | M2Batch.def \ | |
1028 | M2Bitset.def \ | |
1029 | M2CaseList.def \ | |
1030 | M2Check.def \ | |
1031 | M2Code.def \ | |
1032 | M2ColorString.def \ | |
1033 | M2Comp.def \ | |
1034 | M2Const.def \ | |
1035 | M2Debug.def \ | |
1036 | M2DebugStack.def \ | |
1037 | M2Defaults.def \ | |
1038 | M2DriverOptions.def \ | |
05652ac4 GM |
1039 | DynamicPath.def \ |
1040 | PathName.def \ | |
1eee94d3 GM |
1041 | M2Emit.def \ |
1042 | M2Error.def \ | |
1043 | M2FileName.def \ | |
1044 | M2GCCDeclare.def \ | |
1045 | M2GenGCC.def \ | |
1046 | M2Graph.def \ | |
1047 | M2LexBuf.def \ | |
1048 | M2MetaError.def \ | |
1049 | M2Optimize.def \ | |
1050 | M2Options.def \ | |
1051 | M2Pass.def \ | |
1052 | M2Preprocess.def \ | |
1053 | M2Printf.def \ | |
1054 | M2Quads.def \ | |
1055 | M2Quiet.def \ | |
1056 | M2Range.def \ | |
1057 | M2Reserved.def \ | |
1058 | M2SSA.def \ | |
1059 | M2Scaffold.def \ | |
1060 | M2Scope.def \ | |
1061 | M2Search.def \ | |
1062 | M2Size.def \ | |
1063 | M2StackAddress.def \ | |
1064 | M2StackWord.def \ | |
1065 | M2Students.def \ | |
1066 | M2Swig.def \ | |
b0762d4c | 1067 | M2SymInit.def \ |
1eee94d3 GM |
1068 | M2System.def \ |
1069 | NameKey.def \ | |
1070 | ObjectFiles.def \ | |
1071 | P0SymBuild.def \ | |
1072 | P0SyntaxCheck.def \ | |
1073 | P1Build.def \ | |
1074 | P1SymBuild.def \ | |
1075 | P2Build.def \ | |
1076 | P2SymBuild.def \ | |
1077 | P3Build.def \ | |
1078 | P3SymBuild.def \ | |
1079 | PCBuild.def \ | |
1080 | PCSymBuild.def \ | |
1081 | PHBuild.def \ | |
1082 | Sets.def \ | |
1083 | SymbolConversion.def \ | |
1084 | SymbolKey.def \ | |
1085 | SymbolTable.def \ | |
1086 | bnflex.def \ | |
1087 | ||
1088 | # cc1gm2$(exeext) uses these implementation modules found in the gm2-compiler directory. | |
1089 | ||
1090 | GM2-COMP-MODS = \ | |
1091 | FifoQueue.mod \ | |
1092 | Lists.mod \ | |
1093 | M2ALU.mod \ | |
1094 | M2AsmUtil.mod \ | |
1095 | M2Base.mod \ | |
1096 | M2BasicBlock.mod \ | |
1097 | M2Batch.mod \ | |
1098 | M2Bitset.mod \ | |
1099 | M2CaseList.mod \ | |
1100 | M2Check.mod \ | |
1101 | M2Code.mod \ | |
1102 | M2ColorString.mod \ | |
1103 | M2Comp.mod \ | |
1104 | M2Const.mod \ | |
1105 | M2Debug.mod \ | |
1106 | M2DebugStack.mod \ | |
1107 | M2Defaults.mod \ | |
1108 | M2DriverOptions.mod \ | |
05652ac4 GM |
1109 | DynamicPath.mod \ |
1110 | PathName.mod \ | |
1eee94d3 GM |
1111 | M2Emit.mod \ |
1112 | M2Error.mod \ | |
1113 | M2FileName.mod \ | |
1114 | M2GCCDeclare.mod \ | |
1115 | M2GenGCC.mod \ | |
1116 | M2Graph.mod \ | |
1117 | M2LexBuf.mod \ | |
1118 | M2MetaError.mod \ | |
1119 | M2Optimize.mod \ | |
1120 | M2Options.mod \ | |
1121 | M2Pass.mod \ | |
1122 | M2Preprocess.mod \ | |
1123 | M2Printf.mod \ | |
1124 | M2Quads.mod \ | |
1125 | M2Quiet.mod \ | |
1126 | M2Range.mod \ | |
1127 | M2Reserved.mod \ | |
1128 | M2SSA.mod \ | |
1129 | M2Scaffold.mod \ | |
1130 | M2Scope.mod \ | |
1131 | M2Search.mod \ | |
1132 | M2Size.mod \ | |
1133 | M2StackAddress.mod \ | |
1134 | M2StackWord.mod \ | |
1135 | M2Students.mod \ | |
1136 | M2Swig.mod \ | |
b0762d4c | 1137 | M2SymInit.mod \ |
1eee94d3 GM |
1138 | M2System.mod \ |
1139 | NameKey.mod \ | |
1140 | ObjectFiles.mod \ | |
1141 | Output.mod \ | |
1142 | P0SymBuild.mod \ | |
1143 | P1SymBuild.mod \ | |
1144 | P2SymBuild.mod \ | |
1145 | P3SymBuild.mod \ | |
1146 | PCSymBuild.mod \ | |
1147 | Sets.mod \ | |
1148 | SymbolConversion.mod \ | |
1149 | SymbolKey.mod \ | |
1150 | SymbolTable.mod \ | |
1151 | bnflex.mod \ | |
1152 | ||
1153 | # Implementation modules created by the parser generator pge from .bnf files. | |
1154 | ||
1155 | GM2-AUTO-MODS = \ | |
1156 | P2Build.mod \ | |
1157 | P3Build.mod \ | |
1158 | PHBuild.mod \ | |
1159 | PCBuild.mod \ | |
1160 | P1Build.mod \ | |
1161 | P0SyntaxCheck.mod \ | |
1162 | ||
1163 | # LIBIBERTY interface definition modules | |
1164 | ||
1165 | GM2-LIBIBERTY-DEFS = \ | |
1166 | choosetemp.def \ | |
1167 | pexecute.def | |
1168 | ||
1169 | BUILD-LIBS-BOOT-H = $(GM2-LIBS-BOOT-DEFS:%.def=m2/gm2-libs-boot/$(SRC_PREFIX)%.h) | |
1170 | ||
1171 | BUILD-LIBS-BOOT = $(BUILD-LIBS-BOOT-H) \ | |
1172 | $(GM2-LIBS-BOOT-MODS:%.mod=m2/gm2-libs-boot/%.o) \ | |
1173 | $(GM2-LIBS-BOOT-CC:%.cc=m2/gm2-libs-boot/%.o) \ | |
1174 | $(GM2-LIBS-BOOT-C:%.c=m2/gm2-libs-boot/%.o) | |
1175 | ||
1176 | BUILD-COMPILER-BOOT-H = $(GM2-COMP-BOOT-DEFS:%.def=m2/gm2-compiler-boot/$(SRC_PREFIX)%.h) \ | |
1177 | $(GM2-LIBIBERTY-DEFS:%.def=m2/gm2-libiberty/$(SRC_PREFIX)%.h) \ | |
1178 | $(GM2-GCC-DEFS:%.def=m2/gm2-gcc/$(SRC_PREFIX)%.h) | |
1179 | ||
1180 | BUILD-COMPILER-BOOT = $(BUILD-COMPILER-BOOT-H) \ | |
1181 | $(GM2-COMP-BOOT-DEFS:%.def=m2/gm2-compiler-boot/$(SRC_PREFIX)%.h) \ | |
1182 | $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) \ | |
1183 | $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \ | |
1184 | m2/gm2-compiler-boot/m2flex.o | |
1185 | ||
1186 | BUILD-BOOT-H = m2/boot-bin/mc$(exeext) \ | |
1187 | $(BUILD-LIBS-BOOT-H) $(BUILD-COMPILER-BOOT-H) $(TARGET_H) $(PLUGIN_HEADERS) | |
1188 | ||
5bb27a1b GM |
1189 | BUILD-LIBS = $(BUILD-LIBS-BOOT-H) \ |
1190 | $(GM2-LIBS-MODS:%.mod=m2/gm2-libs/%.o) \ | |
1191 | $(GM2-LIBS-CC:%.cc=m2/gm2-libs/%.o) \ | |
1192 | $(GM2-LIBS-C:%.c=m2/gm2-libs/%.o) | |
1193 | ||
1eee94d3 GM |
1194 | # Core library definition modules used by the modula-2 to C++ translator. |
1195 | ||
1196 | MC-LIB-DEFS = \ | |
1197 | ASCII.def \ | |
1198 | Args.def \ | |
1199 | Assertion.def \ | |
1200 | Break.def \ | |
1201 | COROUTINES.def \ | |
1202 | CmdArgs.def \ | |
1203 | Debug.def \ | |
1204 | DynamicStrings.def \ | |
1205 | Environment.def \ | |
1206 | FIO.def \ | |
1207 | FormatStrings.def \ | |
1208 | FpuIO.def \ | |
1209 | IO.def \ | |
1210 | M2Dependent.def \ | |
1211 | M2EXCEPTION.def \ | |
1eee94d3 GM |
1212 | M2RTS.def \ |
1213 | MemUtils.def \ | |
1214 | NumberIO.def \ | |
1215 | PushBackInput.def \ | |
1216 | RTExceptions.def \ | |
1217 | RTco.def \ | |
9fadd8de | 1218 | RTentity.def \ |
1eee94d3 GM |
1219 | RTint.def \ |
1220 | SArgs.def \ | |
1221 | SFIO.def \ | |
1222 | SYSTEM.def \ | |
1223 | Selective.def \ | |
1224 | StdIO.def \ | |
1225 | Storage.def \ | |
1226 | StrCase.def \ | |
1227 | StrIO.def \ | |
1228 | StrLib.def \ | |
1229 | StringConvert.def \ | |
1230 | SysExceptions.def \ | |
1231 | SysStorage.def \ | |
1232 | TimeString.def \ | |
1233 | UnixArgs.def \ | |
1234 | dtoa.def \ | |
1235 | errno.def \ | |
1236 | ldtoa.def \ | |
1237 | libc.def \ | |
1238 | libm.def \ | |
1239 | termios.def \ | |
1240 | wrapc.def \ | |
1241 | ||
1242 | # Core library implementation modules used by the modula-2 to C++ translator. | |
1243 | ||
1244 | MC-LIB-MODS = \ | |
1245 | ASCII.mod \ | |
1246 | Args.mod \ | |
1247 | Assertion.mod \ | |
1248 | Break.mod \ | |
1249 | CmdArgs.mod \ | |
1250 | Debug.mod \ | |
1251 | DynamicStrings.mod \ | |
1252 | Environment.mod \ | |
1253 | FIO.mod \ | |
1254 | FormatStrings.mod \ | |
1255 | FpuIO.mod \ | |
1256 | IO.mod \ | |
1257 | M2Dependent.mod \ | |
1258 | M2EXCEPTION.mod \ | |
1259 | M2RTS.mod \ | |
1260 | MemUtils.mod \ | |
1261 | NumberIO.mod \ | |
1262 | PushBackInput.mod \ | |
1263 | RTExceptions.mod \ | |
1264 | RTint.mod \ | |
1265 | SArgs.mod \ | |
1266 | SFIO.mod \ | |
1267 | StdIO.mod \ | |
1268 | Storage.mod \ | |
1269 | StrCase.mod \ | |
1270 | StrIO.mod \ | |
1271 | StrLib.mod \ | |
1272 | StringConvert.mod \ | |
1273 | SysStorage.mod \ | |
1274 | TimeString.mod \ | |
1275 | ||
ab61100f | 1276 | MC-LIB-BOOT-CC = $(MC-LIB-MODS:%.mod=%.cc) |
1eee94d3 GM |
1277 | |
1278 | # Definition modules for the modula-2 to C++ translator found in mc. | |
1279 | ||
1280 | MC-DEFS = \ | |
1281 | Indexing.def \ | |
1282 | alists.def \ | |
1283 | decl.def \ | |
1284 | keyc.def \ | |
1285 | lists.def \ | |
1286 | mcComment.def \ | |
1287 | mcComp.def \ | |
1288 | mcDebug.def \ | |
1289 | mcError.def \ | |
1290 | mcFileName.def \ | |
1291 | mcLexBuf.def \ | |
1292 | mcMetaError.def \ | |
1293 | mcOptions.def \ | |
1294 | mcPreprocess.def \ | |
1295 | mcPretty.def \ | |
1296 | mcPrintf.def \ | |
1297 | mcQuiet.def \ | |
1298 | mcReserved.def \ | |
1299 | mcSearch.def \ | |
1300 | mcStack.def \ | |
1301 | mcStream.def \ | |
1302 | mcflex.def \ | |
1303 | mcp1.def \ | |
1304 | mcp2.def \ | |
1305 | mcp3.def \ | |
1306 | mcp4.def \ | |
1307 | mcp5.def \ | |
1308 | nameKey.def \ | |
1309 | symbolKey.def \ | |
1310 | varargs.def \ | |
1311 | wlists.def \ | |
1312 | ||
1313 | # Implementation modules for the modula-2 to C++ translator found in mc. | |
1314 | ||
1315 | MC-MODS = \ | |
1316 | Indexing.mod \ | |
1317 | alists.mod \ | |
1318 | decl.mod \ | |
1319 | keyc.mod \ | |
1320 | lists.mod \ | |
1321 | mcComment.mod \ | |
1322 | mcComp.mod \ | |
1323 | mcDebug.mod \ | |
1324 | mcError.mod \ | |
1325 | mcFileName.mod \ | |
1326 | mcLexBuf.mod \ | |
1327 | mcMetaError.mod \ | |
1328 | mcOptions.mod \ | |
1329 | mcPreprocess.mod \ | |
1330 | mcPretty.mod \ | |
1331 | mcPrintf.mod \ | |
1332 | mcQuiet.mod \ | |
1333 | mcReserved.mod \ | |
1334 | mcSearch.mod \ | |
1335 | mcStack.mod \ | |
1336 | mcStream.mod \ | |
1337 | nameKey.mod \ | |
1338 | symbolKey.mod \ | |
1339 | top.mod \ | |
1340 | varargs.mod \ | |
1341 | wlists.mod \ | |
1342 | ||
1343 | # Parser files generated by pge from .bnf files. | |
1344 | ||
1345 | MC-AUTO-MODS = \ | |
1346 | mcp1.mod \ | |
1347 | mcp2.mod \ | |
1348 | mcp3.mod \ | |
1349 | mcp4.mod \ | |
1350 | mcp5.mod | |
1351 | ||
ab61100f | 1352 | MC-BOOT-CC = $(MC-MODS:%.mod=%.cc) $(MC-AUTO-MODS:%.mod=%.cc) |
1eee94d3 GM |
1353 | |
1354 | # C interface files for mc. | |
1355 | ||
1356 | MC-INTERFACE-C = \ | |
1357 | M2LINK.c \ | |
1358 | SYSTEM.c \ | |
1359 | Selective.c \ | |
1360 | SysExceptions.c \ | |
1361 | abort.c \ | |
1362 | errno.c \ | |
1363 | libc.c \ | |
1364 | mcrts.c \ | |
1365 | termios.c \ | |
1366 | wrapc.c \ | |
1367 | ||
1368 | # C++ interface files for mc. | |
1369 | ||
1370 | MC-INTERFACE-CC = \ | |
1371 | UnixArgs.cc \ | |
1372 | dtoa.cc \ | |
1373 | ldtoa.cc \ | |
1374 | ||
1375 | BUILD-MC-BOOT-H = $(MC-LIB-DEFS:%.def=m2/mc-boot-gen/$(SRC_PREFIX)%.h) \ | |
1376 | $(MC-DEFS:%.def=m2/mc-boot-gen/$(SRC_PREFIX)%.h) | |
1377 | ||
ab61100f GM |
1378 | BUILD-MC-BOOT-CC = $(MC-LIB-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.cc) \ |
1379 | $(MC-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.cc) | |
1eee94d3 | 1380 | |
ab61100f | 1381 | BUILD-MC-BOOT-AUTO-CC = $(MC-AUTO-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.cc) |
1eee94d3 | 1382 | |
ab61100f GM |
1383 | BUILD-MC-BOOT-O = $(MC-LIB-BOOT-CC:%.cc=m2/mc-boot/$(SRC_PREFIX)%.o) \ |
1384 | $(MC-BOOT-CC:%.cc=m2/mc-boot/$(SRC_PREFIX)%.o) | |
1eee94d3 GM |
1385 | |
1386 | BUILD-MC-INTERFACE-O = $(MC-INTERFACE-C:%.c=m2/mc-boot-ch/$(SRC_PREFIX)%.o) \ | |
1387 | $(MC-INTERFACE-CC:%.cc=m2/mc-boot-ch/$(SRC_PREFIX)%.o) | |
1388 | ||
1389 | GM2GCC = -I$(srcdir)/m2 -Im2 -I$(srcdir)/m2/gm2-gcc -Im2/gm2-gcc | |
1390 | ||
1391 | MCINCLUDES= -I$(srcdir)/m2/mc-boot-ch | |
1392 | LOCAL_INCLUDES = -I. -I$(srcdir)/../include -I$(srcdir) | |
1393 | ||
1394 | GCC_COLOR=m2/gm2-gcc/m2color.o diagnostic-color.o | |
1395 | ||
1396 | m2/boot-bin/mc$(exeext): $(BUILD-MC-BOOT-O) $(BUILD-MC-INTERFACE-O) \ | |
1397 | m2/mc-boot/main.o mcflex.o m2/gm2-libs-boot/RTcodummy.o | |
1398 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-MC-BOOT-O) \ | |
1399 | $(BUILD-MC-INTERFACE-O) m2/mc-boot/main.o \ | |
1400 | mcflex.o m2/gm2-libs-boot/RTcodummy.o -lm | |
1401 | ||
ab61100f | 1402 | m2/mc-boot/$(SRC_PREFIX)%.o: m2/mc-boot/$(SRC_PREFIX)%.cc m2/gm2-libs/gm2-libs-host.h |
ef6696af GM |
1403 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1404 | $(CXX) $(CM2DEP) $(CXXFLAGS) $(GM2_PICFLAGS) -g -c -I. -I$(srcdir)/m2/mc-boot-ch -I$(srcdir)/m2/mc-boot -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) $< -o $@ | |
1405 | $(POSTCOMPILE) | |
1eee94d3 GM |
1406 | |
1407 | m2/mc-boot-ch/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1408 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1409 | $(CXX) $(CM2DEP) $(CXXFLAGS) $(GM2_PICFLAGS) -DHAVE_CONFIG_H -g -c -I. -Im2/gm2-libs -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) -Im2/gm2-libs $< -o $@ | |
1410 | $(POSTCOMPILE) | |
1eee94d3 GM |
1411 | |
1412 | m2/mc-boot-ch/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.cc m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1413 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1414 | $(CXX) $(CM2DEP) $(CXXFLAGS) $(GM2_PICFLAGS) -DHAVE_CONFIG_H -g -c -I. -Im2/gm2-libs -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) -Im2/gm2-libs $< -o $@ | |
1415 | $(POSTCOMPILE) | |
1eee94d3 GM |
1416 | |
1417 | m2/mc-boot/main.o: $(M2LINK) $(srcdir)/m2/init/mcinit | |
ef6696af | 1418 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
ab61100f | 1419 | unset CC ; $(M2LINK) -s --langc++ --exit --name m2/mc-boot/main.cc $(srcdir)/m2/init/mcinit |
ef6696af GM |
1420 | $(CXX) $(CM2DEP) $(CXXFLAGS) $(GM2_PICFLAGS) -g -c -I. -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) m2/mc-boot/main.cc -o $@ |
1421 | $(POSTCOMPILE) | |
1eee94d3 | 1422 | |
e9a39ad7 | 1423 | mcflex.o: mcflex.c m2/gm2-libs/gm2-libs-host.h |
ef6696af GM |
1424 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1425 | $(CC) $(CM2DEP) $(CFLAGS) $(GM2_PICFLAGS) -I$(srcdir)/m2/mc -g -c $< -o $@ # remember that mcReserved.h is copied into m2/mc | |
1426 | $(POSTCOMPILE) | |
1eee94d3 GM |
1427 | |
1428 | mcflex.c: $(srcdir)/m2/mc/mc.flex | |
1429 | flex -t $< > $@ | |
1430 | ||
62ed1066 | 1431 | m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) $(BUILD-BOOT-H) |
ef6696af | 1432 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
62ed1066 | 1433 | $(MC) --suppress-noreturn -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod |
ef6696af GM |
1434 | $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/M2RTS.c -o $@ |
1435 | $(POSTCOMPILE) | |
62ed1066 | 1436 | |
1eee94d3 | 1437 | m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs-boot/%.mod $(MCDEPS) $(BUILD-BOOT-H) |
ef6696af | 1438 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1439 | $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs-boot/$*.mod |
ef6696af GM |
1440 | $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) $(MCINCLUDES) m2/gm2-libs-boot/$*.c -o $@ |
1441 | $(POSTCOMPILE) | |
1eee94d3 GM |
1442 | |
1443 | m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1444 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1445 | $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs/$*.mod |
ef6696af GM |
1446 | $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/$*.c -o $@ |
1447 | $(POSTCOMPILE) | |
1eee94d3 GM |
1448 | |
1449 | m2/gm2-libs-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS) | |
8d2c5b61 | 1450 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1451 | $(MC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def |
1452 | ||
1453 | m2/gm2-libs-boot/RTcodummy.o: $(srcdir)/m2/gm2-libs-ch/RTcodummy.c m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1454 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1455 | $(CXX) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1456 | $(POSTCOMPILE) | |
1eee94d3 GM |
1457 | |
1458 | m2/gm2-libs-boot/RTintdummy.o: $(srcdir)/m2/gm2-libs-ch/RTintdummy.c m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1459 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1460 | $(CXX) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1461 | $(POSTCOMPILE) | |
1eee94d3 GM |
1462 | |
1463 | m2/gm2-libs-boot/wrapc.o: $(srcdir)/m2/gm2-libs-ch/wrapc.c m2/gm2-libs-boot/$(SRC_PREFIX)wrapc.h m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1464 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1465 | $(CXX) $(CM2DEP) -c -DHAVE_CONFIG_H $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@ | |
1466 | $(POSTCOMPILE) | |
1eee94d3 | 1467 | |
1eee94d3 | 1468 | m2/gm2-libs-boot/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.cc m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h m2/gm2-libs/gm2-libs-host.h |
ef6696af GM |
1469 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1470 | $(CXX) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1471 | $(POSTCOMPILE) | |
1eee94d3 GM |
1472 | |
1473 | m2/gm2-libs-boot/choosetemp.o: m2/gm2-libs-ch/choosetemp.c m2/gm2-libiberty/Gchoosetemp.h m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1474 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1475 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty -I$(srcdir)/m2/gm2-libiberty/ $(INCLUDES) $< -o $@ | |
1476 | $(POSTCOMPILE) | |
1eee94d3 GM |
1477 | |
1478 | m2/gm2-libs-boot/errno.o: $(srcdir)/m2/gm2-libs-ch/errno.c m2/gm2-libs-boot/$(SRC_PREFIX)errno.h m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1479 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1480 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1481 | $(POSTCOMPILE) | |
1eee94d3 GM |
1482 | |
1483 | m2/gm2-libs-boot/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.cc m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1484 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1485 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1486 | $(POSTCOMPILE) | |
1eee94d3 GM |
1487 | |
1488 | m2/gm2-libs-boot/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.cc m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1489 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1490 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1491 | $(POSTCOMPILE) | |
1eee94d3 GM |
1492 | |
1493 | m2/gm2-libs-boot/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c $(BUILD-LIBS-BOOT-H) m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1494 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1495 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1496 | $(POSTCOMPILE) | |
1eee94d3 GM |
1497 | |
1498 | m2/gm2-libs-boot/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c \ | |
1499 | m2/gm2-libs-boot/$(SRC_PREFIX)SysExceptions.h m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1500 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1501 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1502 | $(POSTCOMPILE) | |
1eee94d3 GM |
1503 | |
1504 | m2/gm2-libs-boot/SysStorage.o: $(srcdir)/m2/gm2-libs/SysStorage.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1505 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1506 | $(MC) -o=m2/gm2-libs-boot/SysStorage.c $(srcdir)/m2/gm2-libs/SysStorage.mod |
ef6696af | 1507 | $(COMPILER) $(CM2DEP) -DIN_GCC -c $(CFLAGS) $(GM2_PICFLAGS) \ |
1eee94d3 GM |
1508 | -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) \ |
1509 | m2/gm2-libs-boot/SysStorage.c -o m2/gm2-libs-boot/SysStorage.o | |
ef6696af | 1510 | $(POSTCOMPILE) |
1eee94d3 GM |
1511 | |
1512 | m2/gm2-compiler-boot/M2GCCDeclare.o: $(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1513 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1514 | $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2GCCDeclare.c $< |
ef6696af | 1515 | $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ |
1eee94d3 GM |
1516 | -I. -I$(srcdir)/../include -I$(srcdir) \ |
1517 | -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \ | |
1518 | -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/M2GCCDeclare.c -o $@ | |
ef6696af | 1519 | $(POSTCOMPILE) |
1eee94d3 GM |
1520 | |
1521 | m2/gm2-compiler-boot/M2Error.o: $(srcdir)/m2/gm2-compiler/M2Error.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1522 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1523 | $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2Error.c $< |
ef6696af | 1524 | $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ |
1eee94d3 GM |
1525 | -I. -I$(srcdir)/../include -I$(srcdir) \ |
1526 | -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \ | |
1527 | -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/M2Error.c -o $@ | |
ef6696af | 1528 | $(POSTCOMPILE) |
1eee94d3 GM |
1529 | |
1530 | m2/gm2-compiler-boot/%.o: $(srcdir)/m2/gm2-compiler/%.mod $(BUILD-BOOT-H) $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1531 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1532 | $(MC) -o=m2/gm2-compiler-boot/$*.c $(srcdir)/m2/gm2-compiler/$*.mod |
ef6696af | 1533 | $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ |
1eee94d3 GM |
1534 | -I. -I$(srcdir)/../include -I$(srcdir) \ |
1535 | -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -Im2/gm2-libiberty \ | |
1536 | -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/$*.c -o $@ | |
ef6696af | 1537 | $(POSTCOMPILE) |
1eee94d3 GM |
1538 | |
1539 | m2/gm2-compiler-boot/%.o: m2/gm2-compiler-boot/%.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1540 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1541 | $(MC) -o=m2/gm2-compiler-boot/$*.c m2/gm2-compiler-boot/$*.mod |
ef6696af | 1542 | $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ |
1eee94d3 GM |
1543 | -I. -I$(srcdir)/../include -I$(srcdir) \ |
1544 | -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \ | |
1545 | -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/$*.c -o $@ | |
ef6696af | 1546 | $(POSTCOMPILE) |
1eee94d3 GM |
1547 | |
1548 | m2/gm2-compiler-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-compiler/%.def $(MCDEPS) | |
8d2c5b61 | 1549 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1550 | $(MC) -o=$@ $(srcdir)/m2/gm2-compiler/$*.def |
1551 | ||
1552 | m2/gm2-compiler-boot/m2flex.o: m2/gm2-compiler/m2flex.c $(BUILD-BOOT-H) $(TIMEVAR_H) \ | |
1553 | $(BUILD-LIBS-BOOT-H) m2/gm2-compiler-boot/$(SRC_PREFIX)NameKey.h \ | |
1554 | $(CONFIG_H) m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) | |
ef6696af GM |
1555 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1556 | $(COMPILER) $(CM2DEP) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
1eee94d3 GM |
1557 | $(GM2GCC) $(INCLUDES) -I$(srcdir)/m2 \ |
1558 | -Im2 -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@ | |
ef6696af | 1559 | $(POSTCOMPILE) |
1eee94d3 GM |
1560 | |
1561 | m2/gm2-compiler/m2flex.c: $(srcdir)/m2/m2.flex $(TIMEVAR_H) insn-attr-common.h | |
8d2c5b61 | 1562 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1563 | flex -t $< | sed -e 's/ malloc/ xmalloc/' | sed -e 's/ realloc/ xrealloc/' > $@ |
1564 | ||
1565 | m2/gm2-libiberty/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libiberty/%.def $(MCDEPS) | |
8d2c5b61 | 1566 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1567 | $(MC) -o=$@ $(srcdir)/m2/gm2-libiberty/$*.def |
1568 | ||
1569 | # The rules to build objects in gm2-compiler and gm2-libs directories. | |
1570 | ||
1571 | m2/gm2-compiler/%.o: $(srcdir)/m2/gm2-compiler/%.mod | |
ef6696af | 1572 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1573 | $(GM2_1) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@ |
ef6696af | 1574 | $(POSTCOMPILE) |
1eee94d3 GM |
1575 | |
1576 | m2/gm2-compiler/m2flex.o: m2/gm2-compiler/m2flex.c m2/gm2-libs/gm2-libs-host.h $(TIMEVAR_H) | |
ef6696af GM |
1577 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1578 | $(COMPILER) $(CM2DEP) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ | |
1eee94d3 | 1579 | $(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@ |
ef6696af | 1580 | $(POSTCOMPILE) |
1eee94d3 GM |
1581 | |
1582 | m2/gm2-compiler/%.o: m2/gm2-compiler/%.mod | |
ef6696af | 1583 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1584 | $(GM2_1) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@ |
ef6696af | 1585 | $(POSTCOMPILE) |
1eee94d3 GM |
1586 | |
1587 | m2/gm2-libs-iso/%.o: $(srcdir)/m2/gm2-libs-iso/%.c m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1588 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1589 | $(CXX) $(CM2DEP) -DBUILD_GM2_LIBS_TARGET -DBUILD_GM2_LIBS -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1590 | $(POSTCOMPILE) | |
1eee94d3 GM |
1591 | |
1592 | m2/gm2-libs-iso/%.o: $(srcdir)/m2/gm2-libs-iso/%.mod | |
ef6696af | 1593 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1eee94d3 | 1594 | $(GM2_1) $(GM2_ISO_FLAGS) -c -B./ -Im2/gm2-libs-iso:$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libs $< -o $@ |
ef6696af | 1595 | $(POSTCOMPILE) |
1eee94d3 GM |
1596 | |
1597 | ||
1598 | # We build the cc1gm2$(exeext) from the boot stage and then proceed to build it | |
1599 | # again using itself. | |
1600 | ||
1601 | m2/gm2-libs/gm2-libs-host.h: | |
8d2c5b61 | 1602 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1603 | echo "Configuring to build libraries using native compiler" ; \ |
1604 | NEW_SRCDIR=`${srcdir}/m2/tools-src/calcpath ../../ ${srcdir} m2/gm2-libs` ; \ | |
1605 | export NEW_SRCDIR ; \ | |
1606 | cd m2/gm2-libs ; \ | |
1607 | $(SHELL) -c '$${NEW_SRCDIR}/config-host \ | |
1608 | --srcdir=$${NEW_SRCDIR} \ | |
1609 | --target=$(target) \ | |
1610 | --program-suffix=$(exeext)' | |
1611 | ||
1612 | # Autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a | |
1613 | # cross compiler and the ../Makefile.in above appends this to INTERNAL_CFLAGS. | |
1614 | ||
66132b1f GM |
1615 | m2/gm2config.h: m2/gm2config.aci |
1616 | grep -v define\ PACKAGE_ $< > $@ | |
1617 | ||
1618 | m2/gm2config.aci: | |
1eee94d3 GM |
1619 | NEW_SRCDIR=`${srcdir}/m2/tools-src/calcpath ../ ${srcdir} m2` ; \ |
1620 | export NEW_SRCDIR ; \ | |
1621 | cd m2 ; \ | |
1622 | if echo $(INTERNAL_CFLAGS) | grep \\-DCROSS_DIRECTORY_STRUCTURE; then \ | |
1623 | AR=$(echo $(AR_FOR_TARGET) | sed -e "s/^ //") ; \ | |
1624 | export AR ; \ | |
1625 | RANLIB=$(echo $(RANLIB_FOR_TARGET) | sed -e "s/^ //") ; \ | |
1626 | export RANLIB ; \ | |
1627 | $(SHELL) -c '$${NEW_SRCDIR}/configure --srcdir=$${NEW_SRCDIR} \ | |
1628 | --target=$(target) --program-suffix=$(exeext) \ | |
1629 | --includedir=$(SYSTEM_HEADER_DIR) --libdir=$(libdir) \ | |
1630 | --libexecdir=$(libexecdir)' ; \ | |
1631 | else \ | |
1632 | $(SHELL) -c '$${NEW_SRCDIR}/configure --srcdir=$(NEW_SRCDIR) \ | |
1633 | --target=$(target) --program-suffix=$(exeext)' ; \ | |
1634 | fi | |
1635 | ||
1636 | $(objdir)/m2/gm2-libs-min/SYSTEM.def: $(GM2_PROG_DEP) | |
8d2c5b61 | 1637 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1638 | $(SHELL) $(srcdir)/m2/tools-src/makeSystem -fpim \ |
1639 | $(srcdir)/m2/gm2-libs-min/SYSTEM.def \ | |
1640 | $(srcdir)/m2/gm2-libs-min/SYSTEM.mod \ | |
f235d695 | 1641 | -I$(srcdir)/m2/gm2-libs-min -I$(srcdir)/m2/gm2-libs \ |
1eee94d3 GM |
1642 | "$(GM2_FOR_TARGET)" $@ |
1643 | ||
1644 | $(objdir)/m2/gm2-libs/SYSTEM.def: $(GM2_PROG_DEP) | |
8d2c5b61 | 1645 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1646 | echo "GM2_FOR_TARGET $(GM2_FOR_TARGET)" |
1647 | echo "GCC_FOR_TARGET $(GCC_FOR_TARGET)" | |
1648 | $(SHELL) $(srcdir)/m2/tools-src/makeSystem -fpim \ | |
1649 | $(srcdir)/m2/gm2-libs/SYSTEM.def \ | |
1650 | $(srcdir)/m2/gm2-libs/SYSTEM.mod \ | |
1651 | -I$(srcdir)/m2/gm2-libs \ | |
1652 | "$(GM2_FOR_TARGET)" $@ | |
1653 | ||
1654 | $(objdir)/m2/gm2-libs-iso/SYSTEM.def: $(GM2_PROG_DEP) | |
8d2c5b61 | 1655 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1656 | $(SHELL) $(srcdir)/m2/tools-src/makeSystem -fiso \ |
1657 | $(srcdir)/m2/gm2-libs-iso/SYSTEM.def \ | |
1658 | $(srcdir)/m2/gm2-libs-iso/SYSTEM.mod \ | |
f235d695 | 1659 | -I$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libs \ |
1eee94d3 GM |
1660 | "$(GM2_FOR_TARGET)" $@ |
1661 | ||
1662 | $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def: $(GM2_PROG_DEP) | |
8d2c5b61 | 1663 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1664 | $(SHELL) $(srcdir)/m2/tools-src/makeSystem -fpim \ |
1665 | $(srcdir)/m2/gm2-libs-coroutines/SYSTEM.def \ | |
1666 | $(srcdir)/m2/gm2-libs-coroutines/SYSTEM.mod \ | |
f235d695 | 1667 | -I$(srcdir)/m2/gm2-libs-coroutines -I$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libs \ |
1eee94d3 GM |
1668 | "$(GM2_FOR_TARGET)" $@ |
1669 | ||
1670 | build-compiler: $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \ | |
1671 | $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o) \ | |
1672 | m2/gm2-compiler/m2flex.o | |
1673 | ||
1674 | m2/gm2-compiler/gm2.a: build-compiler gm2$(exeext) | |
8d2c5b61 | 1675 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1676 | $(AR_FOR_TARGET) cr $@ $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \ |
1677 | $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o) | |
1678 | $(RANLIB) $@ | |
1679 | ||
5bb27a1b GM |
1680 | m2/gm2-libs/libgm2.a: build-compiler gm2$(exeext) $(BUILD-LIBS) |
1681 | -test -d $(@D) || $(mkinstalldirs) $(@D) | |
1682 | $(AR) cr $@ $(GM2-LIBS-MODS:%.mod=m2/gm2-libs/%.o) \ | |
1683 | $(GM2-LIBS-CC:%.cc=m2/gm2-libs/%.o) \ | |
1684 | $(GM2-LIBS-C:%.c=m2/gm2-libs/%.o) | |
1685 | $(RANLIB) $@ | |
1686 | ||
1687 | m2/gm2-libs/%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H) | |
ef6696af | 1688 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
5bb27a1b | 1689 | $(GM2_1) -c $(GM2_FLAGS) -Im2/gm2-libs -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-libs-iso $< -o $@ |
ef6696af | 1690 | $(POSTCOMPILE) |
5bb27a1b GM |
1691 | |
1692 | m2/gm2-libs/%.o: $(srcdir)/m2/gm2-libs-ch/%.c m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1693 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1694 | $(CXX) $(CM2DEP) -DBUILD_GM2_LIBS -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1695 | $(POSTCOMPILE) | |
5bb27a1b GM |
1696 | |
1697 | m2/gm2-libs/%.o: $(srcdir)/m2/gm2-libs-ch/%.cc m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1698 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1699 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@ | |
1700 | $(POSTCOMPILE) | |
5bb27a1b GM |
1701 | |
1702 | m2/gm2-libs/choosetemp.o: m2/gm2-libs-ch/choosetemp.c m2/gm2-libiberty/Gchoosetemp.h m2/gm2-libs/gm2-libs-host.h | |
ef6696af GM |
1703 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1704 | $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty -I$(srcdir)/m2/gm2-libiberty/ $(INCLUDES) $< -o $@ | |
1705 | $(POSTCOMPILE) | |
5bb27a1b | 1706 | |
1eee94d3 | 1707 | m2/gm2-libs-boot/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-BOOT) |
8d2c5b61 | 1708 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1709 | $(AR) cr $@ $(GM2-LIBS-BOOT-MODS:%.mod=m2/gm2-libs-boot/%.o) \ |
1710 | $(GM2-LIBS-BOOT-CC:%.cc=m2/gm2-libs-boot/%.o) \ | |
1711 | $(GM2-LIBS-BOOT-C:%.c=m2/gm2-libs-boot/%.o) | |
1712 | $(RANLIB) $@ | |
1713 | ||
1714 | m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext) m2/boot-bin/mklink$(exeext) \ | |
1715 | $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT) | |
8d2c5b61 | 1716 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1717 | $(AR) cr $@ $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \ |
1718 | $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) | |
1719 | $(RANLIB) $@ | |
1720 | ||
1721 | m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext) | |
1722 | ||
1723 | m2/boot-bin/mklink$(exeext): $(srcdir)/m2/tools-src/mklink.c | |
ef6696af GM |
1724 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1725 | $(CXX) $(CM2DEP) $(CFLAGS) $(LDFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) $< -o $@ | |
1726 | $(POSTCOMPILE) | |
1eee94d3 GM |
1727 | |
1728 | m2/gm2-compiler-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-compiler-boot/%.def $(MCDEPS) | |
8d2c5b61 | 1729 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1730 | $(MC) --quiet -o=$@ $(srcdir)/m2/gm2-compiler-boot/$*.def |
1731 | ||
1732 | m2/gm2-compiler/%.mod: $(srcdir)/m2/gm2-compiler/%.bnf $(PGE) | |
8d2c5b61 | 1733 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1734 | $(PGE) -k -l $< -o $@ |
1735 | ||
1736 | m2/gm2-compiler-boot/%.mod: $(srcdir)/m2/gm2-compiler/%.bnf $(PGE) | |
8d2c5b61 | 1737 | -test -d $(@D) || $(mkinstalldirs) $(@D) |
1eee94d3 GM |
1738 | $(PGE) -k -l $< -o $@ |
1739 | ||
1740 | check-m2: check-gm2 | |
1741 | check_m2: check-gm2 | |
1742 | check_gm2: check-gm2 | |
1743 | check-modula2: check-gm2 | |
1744 | check_modula2: check-gm2 | |
1745 | check-modula-2: check-gm2 | |
1746 | check_modula-2: check-gm2 | |
1747 | check_modula_2: check-gm2 | |
1748 | ||
1749 | lang_checks += check-gm2 | |
1750 | lang_checks_parallelized += check-gm2 | |
1751 | # For description see the check_$lang_parallelize comment in gcc/Makefile.in. | |
1752 | check_gm2_parallelize = 10000 | |
1753 | ||
1754 | check-gm2-local: $(GM2TESTSUITEDIR)/site.exp | |
1755 | -(rootme=`${PWD_COMMAND}`; export rootme; \ | |
1756 | srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \ | |
1757 | cd $(TESTSUITEDIR); \ | |
1758 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
1759 | if [ -f $${rootme}/../expect/expect ] ; then \ | |
1760 | TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \ | |
1761 | export TCL_LIBRARY ; fi ; \ | |
1762 | $(RUNTEST) --tool gm2 --directory testsuite/m2/pim/pass) | |
1763 | ||
1764 | BUILD-PGE-O = \ | |
1765 | m2/pge-boot/GArgs.o \ | |
1766 | m2/pge-boot/GASCII.o \ | |
1767 | m2/pge-boot/GAssertion.o \ | |
1768 | m2/pge-boot/Gbnflex.o \ | |
1769 | m2/pge-boot/GDebug.o \ | |
1770 | m2/pge-boot/GDynamicStrings.o \ | |
1771 | m2/pge-boot/GFIO.o \ | |
1772 | m2/pge-boot/GIndexing.o \ | |
1773 | m2/pge-boot/GIO.o \ | |
1774 | m2/pge-boot/GLists.o \ | |
1775 | m2/pge-boot/GM2Dependent.o \ | |
1776 | m2/pge-boot/GM2EXCEPTION.o \ | |
1777 | m2/pge-boot/GM2RTS.o \ | |
1778 | m2/pge-boot/GNameKey.o \ | |
1779 | m2/pge-boot/GNumberIO.o \ | |
1780 | m2/pge-boot/GOutput.o \ | |
1781 | m2/pge-boot/Gpge.o \ | |
1782 | m2/pge-boot/GPushBackInput.o \ | |
1783 | m2/pge-boot/GRTExceptions.o \ | |
1784 | m2/pge-boot/GSFIO.o \ | |
1785 | m2/pge-boot/GStdIO.o \ | |
1786 | m2/pge-boot/GStorage.o \ | |
1787 | m2/pge-boot/GStrCase.o \ | |
1788 | m2/pge-boot/GStrIO.o \ | |
1789 | m2/pge-boot/GStrLib.o \ | |
1790 | m2/pge-boot/GSymbolKey.o \ | |
1791 | m2/pge-boot/GSysStorage.o \ | |
1792 | m2/pge-boot/Glibc.o \ | |
1793 | m2/pge-boot/Gerrno.o \ | |
1794 | m2/pge-boot/GUnixArgs.o \ | |
1eee94d3 GM |
1795 | m2/pge-boot/Gtermios.o \ |
1796 | m2/pge-boot/GSysExceptions.o \ | |
1797 | m2/pge-boot/Gabort.o \ | |
1798 | m2/pge-boot/Gmcrts.o \ | |
1799 | m2/pge-boot/main.o | |
1800 | ||
1801 | ifeq ($(M2_MAINTAINER),yes) | |
1802 | include m2/Make-maintainer | |
1803 | else | |
cb93c5f8 | 1804 | m2/pge-boot/%.o: m2/pge-boot/%.c m2/gm2-libs/gm2-libs-host.h m2/gm2config.h |
ef6696af GM |
1805 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1806 | $(CXX) $(CM2DEP) $(CFLAGS) $(GM2_PICFLAGS) $(INCLUDES) -I$(srcdir)/m2/pge-boot -Im2/gm2-libs -g -c $< -o $@ | |
1807 | $(POSTCOMPILE) | |
1eee94d3 | 1808 | |
cb93c5f8 | 1809 | m2/pge-boot/%.o: m2/pge-boot/%.cc m2/gm2-libs/gm2-libs-host.h m2/gm2config.h |
ef6696af GM |
1810 | -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) |
1811 | $(CXX) $(CM2DEP) $(CXXFLAGS) $(GM2_PICFLAGS) $(INCLUDES) -I$(srcdir)/m2/pge-boot -Im2/gm2-libs -g -c $< -o $@ | |
1812 | $(POSTCOMPILE) | |
1eee94d3 GM |
1813 | |
1814 | $(PGE): $(BUILD-PGE-O) | |
1815 | +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PGE-O) -lm | |
1816 | ||
1817 | endif |