]> gcc.gnu.org Git - gcc.git/blob - gcc/m2/Make-lang.in
Year date changes for Modula-2 source tree.
[gcc.git] / gcc / m2 / Make-lang.in
1 # Top level -*- makefile -*- fragment for GNU M2.
2
3 # Copyright (C) 2000-2022 Free Software Foundation, Inc.
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 # QUIAT=@
22 GM2_MAKE_DEBUG=
23
24 # Actual names to use when installing a native compiler.
25 GM2_INSTALL_NAME = $(shell echo gm2|sed '$(program_transform_name)')
26 GM2_TARGET_INSTALL_NAME = $(target_noncanonical)-$(shell echo gm2|sed '$(program_transform_name)')
27
28 # Actual names to use when installing a cross-compiler.
29 GM2_CROSS_NAME = `echo gm2|sed '$(program_transform_cross_name)'`
30
31 CPLUS = g++
32 GM2_1 = ./gm2 -B./stage1/m2 -g -fm2-g
33 XGCC = ./xgcc -B./
34 GM2_2 = ./gm2 -B./stage2/m2 -g -fm2-g
35 HOSTCC = gcc
36 CFLAGS=-g ## remove this
37 LDLAGS=-g ## remove this
38
39 # Define the name of target independent tools to be installed in $(bindir)
40 # Names are subject to change
41
42 # The tools directly available to the user are built in gm2tools, gm2m is
43 # an internal tool and therefore built here.
44
45 GM2_LINK_TOOLS_INSTALL =
46 # GM2_LINK_TOOLS_INSTALL = gm2m$(exeext) # gm2m is not installed as it is under development.
47
48 GM2_LINK_TOOLS = gm2m$(exeext) gm2l$(exeext) gm2lcc$(exeext) \
49 gm2lgen$(exeext) gm2lorder$(exeext)
50
51 GM2_LINK_TOOLS_BOOT = stage1/m2/gm2lcc$(exeext) stage1/m2/gm2l$(exeext) \
52 stage1/m2/gm2lgen$(exeext) stage1/m2/gm2lorder$(exeext)
53
54 ifeq ($(CC1ONLY),yes)
55 GCC_TOOLS_FOR_GM2 = \
56 $(GCC_PASSES) $(GCC_PARTS) \
57 stage1/m2/gcc$(exeext) \
58 stage1/m2/cc1$(exeext) \
59 stage1/m2/cpp$(exeext)
60 else
61 GCC_TOOLS_FOR_GM2 = \
62 $(GCC_PASSES) $(GCC_PARTS) \
63 stage1/m2/gcc$(exeext) \
64 stage1/m2/cc1$(exeext) \
65 stage1/m2/cc1plus$(exeext) \
66 stage1/m2/cpp$(exeext)
67 endif
68
69 CPP_GM2=-fpermissive -DIN_GCC -g
70
71 TEXISRC = $(objdir)/m2/images/gnu.eps \
72 $(srcdir)/doc/gm2.texi \
73 m2/gm2-libs.texi \
74 m2/gm2-ebnf.texi \
75 m2/SYSTEM-pim.texi \
76 m2/SYSTEM-iso.texi \
77 m2/Builtins.texi \
78 m2/version.texi
79
80
81 # Define the names for selecting GNU Modula-2 in LANGUAGES.
82 m2 modula-2 modula2: gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) \
83 $(GCC_TOOLS_FOR_GM2)
84 m2.serial = cc1gm2$(exeext)
85
86 # Tell GNU make to ignore these if they exist.
87 .PHONY: m2 modula-2 modula2
88
89 GM2_PROG_DEP=gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext)
90
91 TEXI2HTML=python3 $(srcdir)/m2/www/tools/texi2tr/src/texi2tr.py
92
93 include m2/config-make
94 LIBSTDCXX=../$(TARGET_SUBDIR)/libstdc++-v3/src/.libs/libstdc++.a
95
96 SRC_PREFIX=G
97
98 m2/gm2spec.o: $(srcdir)/m2/gm2spec.c $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \
99 m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) \
100 $(generated_files) $(C_TREE_H)
101 (SHLIB_LINK='$(SHLIB_LINK)' \
102 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
103 $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
104 $(DRIVER_DEFINES) \
105 -DLIBSUBDIR=\"$(libsubdir)\" \
106 -DPREFIX=\"$(prefix)\" \
107 -c $(srcdir)/m2/gm2spec.c $(OUTPUT_OPTION))
108
109 m2/gm2version.c: gm2version-check; @true
110
111 gm2version-check:
112 sh $(srcdir)/m2/tools-src/makeversion -p $(srcdir) m2
113 $(STAMP) gm2version-check
114
115 gm2version.o: m2/gm2version.c
116 (SHLIB_LINK='$(SHLIB_LINK)' \
117 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
118 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
119 -DLIBSUBDIR=\"$(libsubdir)\" \
120 $(INCLUDES) m2/gm2version.c $(OUTPUT_OPTION))
121
122 # Create the compiler driver for M2.
123 CFLAGS-m2/m2/gm2spec.o += $(DRIVER_DEFINES)
124
125 GM2_OBJS = $(GCC_OBJS) m2/gm2version.o \
126 prefix.o intl.o m2/gm2spec.o
127
128 # Create the compiler driver for gm2.
129 gm2$(exeext): $(GM2_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) \
130 m2/gm2config.h
131 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
132 $(GM2_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
133 $(EXTRA_GCC_LIBS) $(LIBS)
134
135 # Create a version of the gm2 driver which calls the cross-compiler.
136 gm2-cross$(exeext): gm2$(exeext)
137 -rm -f gm2-cross$(exeext)
138 cp gm2$(exeext) gm2-cross$(exeext)
139
140 po-generated:
141
142 #
143 # directories for the public definition, implementation and object libraries
144 #
145 GM2_LIB_DIR_LOG= $(DESTDIR)$(libsubdir)/m2/logitech
146 GM2_LIB_DIR_PCO= $(DESTDIR)$(libsubdir)/m2/pim-coroutine
147 GM2_LIB_DIR_ISO= $(DESTDIR)$(libsubdir)/m2/iso
148 GM2_LIB_DIR_MIN= $(DESTDIR)$(libsubdir)/m2/min
149
150 # Build hooks:
151
152 m2.all.cross: gm2-cross$(exeext) $(GM2_LINK_TOOLS) plugin/m2rte$(exeext).so
153
154 m2.start.encap: gm2$(exeext) $(GM2_LINK_TOOLS) plugin/m2rte$(exeext).so
155 m2.rest.encap:
156
157 m2.info: doc/m2.info
158
159 m2.man: doc/m2.1
160
161 m2.install-man: $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext)
162
163 $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext): doc/m2.1 installdirs
164 -rm -f $@
165 -$(INSTALL_DATA) $< $@
166 -chmod a-x $@
167
168 m2.dvi: $(TEXISRC)
169 $(TEXI2DVI) -I $(objdir)/m2 -I $(srcdir)/doc/include $(srcdir)/doc/gm2.texi -o $@
170
171 m2.html: $(TEXISRC)
172 (cd m2/www ; make m2.html)
173
174 m2.ps: m2.dvi
175 dvips -o $@ $<
176
177 m2.pdf: m2.ps
178 gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $<
179
180 .INTERMEDIATE: gm2.pod
181
182 m2.pod: doc/gm2.texi $(TEXISRC)
183 -$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@
184
185 doc/m2.info: $(TEXISRC)
186 if test "x$(BUILD_INFO)" = xinfo; then \
187 rm -f doc/m2.info*; \
188 $(MAKEINFO) --no-headers -I$(objdir)/m2 -I$(srcdir)/doc/include \
189 -o $@ $(srcdir)/doc/gm2.texi ; \
190 else true; fi
191
192 $(objdir)/m2/images/gnu.eps: $(srcdir)/m2/images/gnupng
193 test -d m2/images || mkdir -p m2/images
194 if [ -f $(srcdir)/m2/images/gnu.eps ] ; then \
195 cp $(srcdir)/m2/images/gnu.eps $@ ; \
196 else \
197 pngtopnm $< | pnmtops -noturn > $@ ; \
198 fi
199
200 m2/gm2-libs.texi: gm2-libs.texi-check; @true
201
202 gm2-libs.texi-check: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/Builtins.texi $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def m2/gm2-ebnf.texi
203 python3 $(srcdir)/m2/tools-src/def2texi.py -uLibraries -s$(srcdir)/m2 -b$(objdir)/m2 > $(objdir)/m2/gm2-libs.texi
204 $(STAMP) gm2-libs.texi-check
205
206 m2/gm2-ebnf.texi: gm2-ebnf.texi-check; @true
207
208 gm2-ebnf.texi-check: m2/gm2-auto m2/ppg$(exeext) $(srcdir)/m2/bnf/m2.bnf
209 ./m2/ppg$(exeext) -c -p -t -f $(srcdir)/m2/bnf/m2.bnf > m2/gm2-ebnf.texi
210 $(STAMP) gm2-ebnf.texi-check
211
212 m2/SYSTEM-pim.texi: SYSTEM-pim-texi-check; @true
213
214 SYSTEM-pim-texi-check: $(objdir)/m2/gm2-libs/SYSTEM.def
215 python3 $(srcdir)/m2/tools-src/def2texi.py -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs/SYSTEM.def > $(objdir)/m2/SYSTEM-pim.texi
216 $(STAMP) SYSTEM-pim-texi-check
217
218 m2/SYSTEM-iso.texi: SYSTEM-iso.texi-check; @true
219
220 SYSTEM-iso.texi-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def
221 python3 $(srcdir)/m2/tools-src/def2texi.py -b$(objdir)/m2 -f$(objdir)/m2/gm2-libs-iso/SYSTEM.def > $(objdir)/m2/SYSTEM-iso.texi
222 $(STAMP) SYSTEM-iso.texi-check
223
224 m2/Builtins.texi: Builtins.texi-check; @true
225
226 Builtins.texi-check: m2/gm2-libs/Builtins.def
227 python3 $(srcdir)/m2/tools-src/def2texi.py -b./ -f$(srcdir)/m2/gm2-libs/Builtins.def > $(objdir)/m2/Builtins.texi
228 $(STAMP) Builtins.texi-check
229
230 m2/version.texi: gm2-version.texi-check; @true
231
232 gm2-version.texi-check:
233 sh $(srcdir)/m2/tools-src/makeversion -t $(srcdir) m2
234 $(STAMP) gm2-version.texi-check
235
236 $(objdir)/m2/gm2-ici:
237 test -d $@ || mkdir $@
238
239 $(objdir)/m2/gm2-ici-boot:
240 test -d $@ || mkdir $@
241
242 $(objdir)/m2/gm2-compiler-boot:
243 test -d $@ || mkdir $@
244
245 $(objdir)/m2/gm2-ppg-boot:
246 test -d $@ || mkdir $@
247
248 $(objdir)/m2/gm2-pg-boot:
249 test -d $@ || mkdir $@
250
251 $(objdir)/m2/gm2-pge-boot:
252 test -d $@ || mkdir $@
253
254 $(objdir)/m2/gm2-libs-boot:
255 test -d $@ || mkdir $@
256
257 $(objdir)/m2/gm2-libiberty:
258 test -d $@ || mkdir $@
259
260 $(objdir)/m2/gm2-auto:
261 test -d $@ || mkdir $@
262
263 $(objdir)/m2/gm2-gcc:
264 test -d $@ || mkdir $@
265
266 $(objdir)/m2/gm2-compiler:
267 test -d $@ || mkdir $@
268
269 $(objdir)/m2/gm2-libs:
270 test -d $@ || mkdir $@
271
272 $(objdir)/m2/gm2-libs-iso:
273 test -d $@ || mkdir $@
274
275 $(objdir)/m2/gm2-libs-min:
276 test -d $@ || mkdir $@
277
278 $(objdir)/m2/gm2-compiler-paranoid:
279 test -d $@ || mkdir $@
280
281 $(objdir)/m2/gm2-libs-paranoid:
282 test -d $@ || mkdir $@
283
284 $(objdir)/m2/gm2-compiler-verify:
285 test -d $@ || mkdir $@
286
287 $(objdir)/m2/boot-bin:
288 test -d $@ || mkdir $@
289
290 $(objdir)/m2/gm2-libs-pim:
291 test -d $@ || mkdir $@
292
293 $(objdir)/m2/gm2-libs-coroutines:
294 test -d $@ || mkdir $@
295
296 stage1/m2:
297 -test -d $@ || mkdir -p stage1/m2
298
299 stage2/m2:
300 -test -d $@ || mkdir -p stage2/m2
301
302 stage3/m2:
303 -test -d $@ || mkdir -p stage3/m2
304
305 stage4/m2:
306 -test -d $@ || mkdir -p stage4/m2
307
308 # No gm2-specific selftests
309 selftest-m2:
310
311 # Install hooks:
312 # cc1gm2 is installed elsewhere as part of $(COMPILERS).
313 # $(COMPILERS) is defined in `config-lang.in'
314
315 $(GM2_LIB_DIR_PIM):
316 $(mkinstalldirs) $(GM2_LIB_DIR_PIM)
317
318 $(GM2_LIB_DIR_ISO):
319 $(mkinstalldirs) $(GM2_LIB_DIR_ISO)
320
321 $(GM2_LIB_DIR_MIN):
322 $(mkinstalldirs) $(GM2_LIB_DIR_MIN)
323
324 $(GM2_LIB_DIR_LOG):
325 $(mkinstalldirs) $(GM2_LIB_DIR_LOG)
326
327 $(GM2_LIB_DIR_PCO):
328 $(mkinstalldirs) $(GM2_LIB_DIR_PCO)
329
330 m2.install-common: installdirs
331 -rm -f $(DESTDIR)$(bindir)/$(GM2_INSTALL_NAME)$(exeext)
332 $(INSTALL_PROGRAM) gm2$(exeext) $(DESTDIR)$(bindir)/$(GM2_INSTALL_NAME)$(exeext)
333 -if test -f cc1gm2$(exeext); then \
334 if test -f gm2-cross$(exeext); then \
335 :; \
336 else \
337 rm -f $(DESTDIR)$(bindir)/$(GM2_TARGET_INSTALL_NAME)$(exeext); \
338 ( cd $(DESTDIR)$(bindir) && \
339 $(LN) $(GM2_INSTALL_NAME)$(exeext) $(GM2_TARGET_INSTALL_NAME)$(exeext) ); \
340 fi; \
341 fi
342 -for tool in cc1gm2$(exeext) $(GM2_LINK_TOOLS_INSTALL); do \
343 if [ -f $$tool ]; then \
344 rm -f $(DESTDIR)$(libexecsubdir)/$$tool; \
345 $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(libexecsubdir)/$$tool; \
346 chmod a+x $(DESTDIR)$(libexecsubdir)/$$tool; \
347 else \
348 echo "cannot find $$tool" ; \
349 fi ; \
350 done
351
352 m2.install-info: installdirs
353 if [ -d gm2$(exeext) ] ; then \
354 if [ -f $(objdir)/doc/gm2.info ]; then \
355 rm -f $(DESTDIR)$(infodir)/gm2.info*; \
356 for f in $(objdir)/doc/gm2.info*; do \
357 realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
358 rm -f $(DESTDIR)$(infodir)/`basename $$realfile`; \
359 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/`basename $$realfile`; \
360 done; \
361 chmod a-x $(DESTDIR)$(infodir)/gm2.info*; \
362 else true; fi; \
363 else true; fi
364 -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/gm2.info ]; then \
365 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
366 install-info --dir-file=$(infodir)/dir $(DESTDIR)$(infodir)/gm2.info; \
367 else true; fi; \
368 else true; fi
369
370 m2.install-normal: m2.install-common m2.install-info m2.install-man
371
372 # This target will install GM2 into an existing GCC installation,
373 # without overwriting existing files.
374 # The semicolon is to prevent the install.sh -> install default rule
375 # from doing anything. Having it run true helps avoid problems and
376 # noise from versions of make which don't like to have null commands.
377 m2.install: m2.install-normal; @true
378
379 gm2.install-with-gcc: $(INSTALL_HEADERS) gm2.install $(INSTALL_LIBGCC)
380 for file in $(GCC_PASSES); do \
381 if [ x"$$file" != x"xgcc$(exeext)" ]; then \
382 rm -f $(DESTDIR)$(libsubdir)/$$file; \
383 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libsubdir)/$$file || exit 1; \
384 fi; \
385 done; exit 0
386
387 m2.uninstall:
388 -rm -rf $(bindir)/$(GM2_INSTALL_NAME)
389 -rm -rf $(bindir)/$(GM2_CROSS_NAME)
390
391 m2.install-plugin: installdirs
392 $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
393 $(INSTALL_PROGRAM) plugin/m2rte$(exeext).so $(DESTDIR)$(plugin_resourcesdir)/m2rte$(exeext).so
394 chmod a+x $(DESTDIR)$(plugin_resourcesdir)/m2rte$(exeext).so
395
396 plugin/m2rte$(exeext).so: $(srcdir)/m2/plugin/m2rte.c $(TARGET_H) $(PLUGIN_HEADERS) \
397 $(srcdir)/flags.h gtype-m2.h m2/gm2config.h
398 test -d plugin || mkdir plugin
399 $(PLUGINCC) $(PLUGINCFLAGS) -fno-rtti -I. -I$(srcdir) -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.c
400 $(PLUGINCC) $(PLUGINCFLAGS) $(PLUGINLIBS) -fno-rtti plugin/m2rte.o -shared -o $@
401
402
403 # Clean hooks:
404 # A lot of the ancillary files are deleted by the main makefile.
405 # We just have to delete files specific to us.
406
407 m2.mostlyclean:
408 -rm -f m2/*.o
409
410 m2.clean:
411 -rm -f m2/*.o
412 -rm -f m2/gm2-libs/config.*
413 -rm m2/gm2-libs/gm2-libs-host.h m2/gm2config.h
414 -rm -f m2/gm2-libs/autoscan.log
415 -rm -fr m2/stage?
416 -rm m2/include
417 -rm -f m2/*.o m2/*~
418 -rm -f m2/linkcommand m2/mod_init.c
419 -rm -f m2/gm2-libs-boot/*.[aoch] m2/gm2-compiler-boot/*.[aoch] m2/gm2-libs/*.[oa] m2/gm2-compiler/*.[oa]
420 -rm -f m2/*/*~ m2/*~
421 -rm -f m2/gm2-libs-paranoid/* m2/gm2-compiler-paranoid/* m2/gm2-compiler-verify/*
422 -rm -f m2/gm2-compiler/mod_init.c
423 -rm -f m2/*.lst m2/$(basename $(GM2-TOOLS-MOD)) m2/gm2m
424 -rm -f -r m2/boot-bin
425 -rm -f m2/boot-bin/mklink$(exeext)
426 -rm -f m2/boot-bin/mc$(exeext)
427 -rm -f m2/pg-e$(exeext) m2/pge$(exeext)
428 -rm -f m2/gm2-auto/*.c m2/gm2-auto/*~ m2/gm2-auto/pginit
429 -rm -f m2/gm2-libiberty/*.h m2/gm2-libiberty/*~
430 -rm -f m2/gm2-auto/pg.o
431 -rm -f m2/gm2.cp m2/gm2.fn m2/gm2.pg m2/gm2.toc m2/gm2.tp m2/gm2.vr m2/gm2.ky
432 -rm -f m2/gm2-compiler/M2Version.mod
433 -rm -f m2/gm2-compiler/gm2l.mod m2/gm2-compiler/P0SyntaxCheck.mod
434 -rm -f m2/gm2-compiler/P1Build.mod m2/gm2-compiler/P2Build.mod m2/gm2-compiler/P3Build.mod
435 -rm -f m2/gm2-compiler/PHBuild.mod m2/gm2-compiler/PCBuild.mod
436 -rm -f m2/gm2-compiler-boot/gm2l.mod m2/gm2-compiler-boot/P0SyntaxCheck.mod
437 -rm -f m2/gm2-compiler-boot/P1Build.mod m2/gm2-compiler-boot/P2Build.mod m2/gm2-compiler-boot/P3Build.mod
438 -rm -f m2/gm2-compiler-boot/PHBuild.mod m2/gm2-compiler-boot/PCBuild.mod
439
440 m2.extraclean:
441 m2.realclean:
442
443 # Stage hooks:
444
445 m2.stage1: stage1-start
446 -mv m2/*$(objext) stage1/m2
447
448 m2.stage2: stage2-start
449 -mv m2/*$(objext) stage2/m2
450
451 m2.stage3: stage3-start
452 -mv m2/*$(objext) stage3/m2
453
454 m2.stage4: stage4-start
455 -mv m2/*$(objext) stage4/m2
456
457 quit: force
458 echo "calling exit"
459 exit 1
460
461 #
462 # Rules to build the compiler and tools
463 #
464 # MC_COPYRIGHT=--gpl-header --project="GNU Modula-2"
465 MC_COPYRIGHT=
466
467 MC_ARGS= --olang=c++ \
468 --h-file-prefix=$(SRC_PREFIX) \
469 -I$(srcdir)/m2/gm2-libs \
470 -I$(srcdir)/m2/gm2-compiler \
471 -I$(srcdir)/m2/gm2-libiberty \
472 -I$(srcdir)/m2/gm2-gcc \
473 --quiet \
474 $(MC_COPYRIGHT) \
475 --gcc-config-system
476
477 MCDEPS=m2/boot-bin/mc$(exeext)
478
479 MC=m2/boot-bin/mc$(exeext) $(MC_ARGS)
480
481 MC_LIBS=m2/mc-boot-ch/Glibc.o m2/mc-boot-ch/Gmcrts.o
482
483 M2LINK=m2/boot-bin/mklink$(exeext)
484 GM2_O=
485 GM2_O_S3=-O
486 GM2_OS=-Os
487 GM2_G=-g -fm2-g
488 GM2_CPP=
489 # GM2_DEBUG_STRMEM=-fcpp
490 GM2_DEBUG_STRMEM=
491 GM2_FLAGS=-Wunused-variable -fsoft-check-all $(GM2_G) $(GM2_O) \
492 -funbounded-by-reference -fpim -fextended-opaque \
493 -Wpedantic-cast -Wpedantic-param-names -ffunction-sections \
494 -fdata-sections $(GM2_CPP) # -fauto-init
495 GM2_ISO_FLAGS=-fsoft-check-all $(GM2_G) $(GM2_O) \
496 -funbounded-by-reference -fiso -fextended-opaque \
497 -Wpedantic-cast -Wpedantic-param-names -ffunction-sections \
498 -fdata-sections $(GM2_CPP)
499 GM2_MIN_FLAGS=$(GM2_G) $(GM2_OS) \
500 -funbounded-by-reference -fextended-opaque \
501 -Wpedantic-cast -Wpedantic-param-names -fno-exceptions \
502 -ffunction-sections -fdata-sections $(GM2_CPP)
503
504 O2=-O2 -g
505 SO_O2=-O2 -g -fPIC
506 SO=-O0 -g -fPIC
507
508 # Language-specific object files for the gm2 compiler.
509
510 GM2_C_OBJS = m2/gm2-lang.o \
511 m2/stor-layout.o \
512 m2/m2pp.o \
513 m2/gm2-gcc/m2assert.o \
514 m2/gm2-gcc/m2block.o \
515 m2/gm2-gcc/m2builtins.o \
516 m2/gm2-gcc/m2except.o \
517 m2/gm2-gcc/m2convert.o \
518 m2/gm2-gcc/m2color.o \
519 m2/gm2-gcc/m2decl.o \
520 m2/gm2-gcc/m2expr.o \
521 m2/gm2-gcc/m2linemap.o \
522 m2/gm2-gcc/m2statement.o \
523 m2/gm2-gcc/m2type.o \
524 m2/gm2-gcc/m2tree.o \
525 m2/gm2-gcc/m2treelib.o \
526 m2/gm2-gcc/m2top.o \
527 m2/gm2-gcc/m2misc.o \
528 m2/gm2-gcc/init.o
529 GM2_LIBS = m2/gm2-compiler/gm2.a ../$(target_subdir)/libgm2/libm2pim/.libs/libm2pim.a m2/gm2-libs-boot/choosetemp.o
530
531 GM2_LIBS_BOOT = m2/gm2-compiler-boot/gm2.a \
532 m2/gm2-libs-boot/libgm2.a
533 GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
534 m2/gm2-libs-paranoid/libgm2.a # build it again using GM2_LIBS
535
536 gm2.paranoid: stage3/m2/cc1gm2$(exeext) gm2.verifyparanoid
537
538 cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) $(m2.prev)
539 cp -p $< $@
540
541 gm2lcc$(exeext): stage1/m2/gm2lcc$(exeext)
542 cp -p $< $@
543
544 gm2l$(exeext): stage1/m2/gm2l$(exeext)
545 cp -p $< $@
546
547 gm2lgen$(exeext): stage1/m2/gm2lgen$(exeext)
548 cp -p $< $@
549
550 gm2lorder$(exeext): stage1/m2/gm2lorder$(exeext)
551 cp -p $< $@
552
553 gm2m$(exeext): stage1/m2/gm2m$(exeext)
554 cp -p $< $@
555
556 stage3/m2/cc1gm2$(exeext): stage2/m2/cc1gm2$(exeext) m2/gm2-compiler-paranoid/m2flex.o \
557 $(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS_PARANOID) \
558 m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so
559 @$(call LINK_PROGRESS,$(INDEX.m2),start)
560 +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler-paranoid/m2flex.o \
561 attribs.o \
562 $(GM2_LIBS_PARANOID) \
563 $(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o \
564 $(BACKENDLIBS) $(LIBSTDCXX) -lm
565 @$(call LINK_PROGRESS,$(INDEX.m2),end)
566
567 stage2/m2/cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o $(P) \
568 $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \
569 m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so
570 @$(call LINK_PROGRESS,$(INDEX.m2),start)
571 +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler/m2flex.o \
572 attribs.o \
573 $(GM2_LIBS) \
574 $(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o \
575 $(BACKENDLIBS) $(LIBSTDCXX) -lm
576 @$(call LINK_PROGRESS,$(INDEX.m2),end)
577
578 stage1/m2/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \
579 $(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \
580 $(GM2_LIBS_BOOT) $(MC_LIBS) \
581 m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so $(m2.prev)
582 @$(call LINK_PROGRESS,$(INDEX.m2),start)
583 +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler-boot/m2flex.o \
584 attribs.o \
585 $(GM2_LIBS_BOOT) $(MC_LIBS) m2/gm2-gcc/rtegraph.o \
586 $(BACKEND) $(LIBS) $(BACKENDLIBS)
587 @$(call LINK_PROGRESS,$(INDEX.m2),end)
588
589 # Compiling object files from source files.
590
591 gm2-gcc/m2builtins.o : $(srcdir)/m2/gm2-gcc/m2builtins.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) \
592 $(PLUGIN_HEADERS) $(srcdir)/flags.h gtype-m2.h gt-m2-m2builtins.h \
593 m2/gm2config.h $(generated_files)
594
595 gm2-gcc/m2except.o : $(srcdir)/m2/gm2-gcc/m2except.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) $(PLUGIN_HEADERS) \
596 $(srcdir)/flags.h gtype-m2.h gt-m2-m2except.h m2/gm2config.h $(generated_files)
597
598 m2/gm2-gcc/%.o: $(srcdir)/m2/gm2-gcc/%.c $(BUILD-BOOT-H) $(TIMEVAR_H) m2/gm2config.h $(CONFIG_H) \
599 $(TREE_H) $(RTL_H) $(TARGET_H) $(PLUGIN_HEADERS) \
600 $(srcdir)/flags.h gtype-m2.h m2/gm2config.h \
601 $(generated_files)
602 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
603
604 m2/gm2-lang.o: $(srcdir)/m2/gm2-lang.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) $(PLUGIN_HEADERS) \
605 $(srcdir)/flags.h m2/gm2config.h gt-m2-gm2-lang.h $(generated_files)
606 $(COMPILER) -c -g -I$(GM2GCC) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
607
608 m2/stor-layout.o: $(srcdir)/stor-layout.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) \
609 $(PLUGIN_HEADERS) $(srcdir)/flags.h m2/gm2config.h $(generated_files)
610 $(COMPILER) -c -DSET_WORD_SIZE=INT_TYPE_SIZE $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
611
612 m2/m2pp.o : $(srcdir)/m2/m2pp.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) $(PLUGIN_HEADERS) \
613 $(srcdir)/flags.h gtype-m2.h m2/gm2config.h $(generated_files)
614 $(COMPILER) -c -g -DGM2 $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
615
616 m2/gm2-gcc/rtegraph.o: $(srcdir)/m2/gm2-gcc/rtegraph.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(TARGET_H) \
617 $(PLUGIN_HEADERS) $(srcdir)/flags.h gtype-m2.h gt-m2-rtegraph.h m2/gm2config.h \
618 $(generated_files)
619 $(COMPILER) -c -g -I$(GM2GCC) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
620
621 c-family/m2pp.o : $(srcdir)/m2/m2pp.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/flags.h gtype-m2.h \
622 m2/gm2config.h $(generated_files)
623 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
624
625 m2/gm2-gcc/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-gcc/%.def $(MCDEPS)
626 $(MC) -o=$@ $(srcdir)/m2/gm2-gcc/$*.def
627
628 #
629 # the following tables define the source files which are translated into C using mc
630 # and defines the system interface C files.
631 #
632
633 GM2-LIBS-BOOT-DEFS = ASCII.def IO.def Args.def M2RTS.def \
634 Assertion.def NumberIO.def Break.def SYSTEM.def \
635 CmdArgs.def Scan.def StrCase.def \
636 FIO.def StrIO.def StrLib.def TimeString.def \
637 UnixArgs.def wrapc.def Environment.def \
638 FpuIO.def Debug.def SysStorage.def DynamicStrings.def \
639 SFIO.def SArgs.def StdIO.def \
640 FormatStrings.def PushBackInput.def Storage.def SEnvironment.def \
641 StringConvert.def M2EXCEPTION.def RTExceptions.def \
642 dtoa.def ldtoa.def termios.def errno.def \
643 SysExceptions.def Indexing.def libc.def \
644 libm.def
645
646 GM2-LIBS-BOOT-MODS = ASCII.mod IO.mod Args.mod Assertion.mod \
647 NumberIO.mod Break.mod CmdArgs.mod Scan.mod \
648 StrCase.mod FIO.mod StrIO.mod \
649 TimeString.mod StrLib.mod Environment.mod \
650 FpuIO.mod Debug.mod SysStorage.mod Storage.mod \
651 DynamicStrings.mod \
652 SFIO.mod M2RTS.mod SArgs.mod \
653 FormatStrings.mod PushBackInput.mod \
654 SEnvironment.mod StringConvert.mod \
655 M2EXCEPTION.mod RTExceptions.mod \
656 Indexing.mod
657
658 GM2-LIBS-BOOT-C = wrapc.c UnixArgs.c StdIO.c \
659 choosetemp.c dtoa.c ldtoa.c termios.c \
660 errno.c SysExceptions.c
661
662 GM2-COMP-BOOT-DEFS = FifoQueue.def M2Debug.def M2Optimize.def M2Defaults.def \
663 M2Options.def P3SymBuild.def M2ALU.def M2Depth.def \
664 M2Pass.def P0SymBuild.def P1SymBuild.def M2AsmUtil.def \
665 M2EvalSym.def \
666 M2Quads.def M2FileName.def M2StackWord.def M2StackAddress.def \
667 M2Base.def M2Reserved.def SymbolKey.def M2BasicBlock.def\
668 M2Search.def M2Batch.def M2System.def P2SymBuild.def \
669 M2Code.def M2Comp.def m2flex.def NameKey.def \
670 M2LexBuf.def M2Version.def M2Error.def \
671 M2Students.def \
672 M2GenGCC.def M2GCCDeclare.def \
673 M2Configure.def SymbolTable.def Lists.def SymbolConversion.def \
674 P0SyntaxCheck.def \
675 P1Build.def P2Build.def P3Build.def PHBuild.def \
676 M2Printf.def bnflex.def M2Quiet.def M2Preprocess.def \
677 M2Bitset.def M2Size.def \
678 M2Scope.def M2Range.def M2Swig.def \
679 M2MetaError.def Sets.def M2CaseList.def PCSymBuild.def \
680 PCBuild.def M2Const.def M2DebugStack.def \
681 M2DriverOptions.def ObjectFiles.def \
682 M2ColorString.def M2Emit.def M2Check.def \
683 M2SSA.def Output.def
684
685 GM2-COMP-BOOT-MODS = FifoQueue.mod M2LexBuf.mod \
686 M2AsmUtil.mod M2Optimize.mod M2StackWord.mod \
687 M2Options.mod M2Pass.mod M2Batch.mod M2Quads.mod \
688 M2Comp.mod M2Reserved.mod M2Configure.mod M2StackAddress.mod \
689 M2Debug.mod M2Defaults.mod M2Depth.mod NameKey.mod \
690 M2FileName.mod P0SymBuild.mod P1SymBuild.mod P2SymBuild.mod \
691 P3SymBuild.mod \
692 SymbolKey.mod SymbolTable.mod gm2lcc.mod \
693 gm2lgen.mod gm2lorder.mod M2Error.mod \
694 M2Students.mod \
695 M2BasicBlock.mod M2Code.mod M2GenGCC.mod M2GCCDeclare.mod \
696 SymbolConversion.mod M2Base.mod \
697 M2ALU.mod M2System.mod Lists.mod \
698 M2Printf.mod bnflex.mod M2Quiet.mod M2Search.mod \
699 M2Preprocess.mod M2Bitset.mod \
700 M2Size.mod M2Scope.mod M2Range.mod \
701 M2Swig.mod M2MetaError.mod Sets.mod M2CaseList.mod \
702 PCSymBuild.mod M2Const.mod M2DebugStack.mod \
703 M2DriverOptions.mod \
704 SymbolKey.mod NameKey.mod Lists.mod ObjectFiles.mod \
705 M2ColorString.mod M2Emit.mod M2Check.mod \
706 M2SSA.mod Output.mod
707
708 GM2-GCC-DEFS = m2builtins.def m2except.def m2convert.def m2decl.def \
709 m2except.def m2expr.def m2misc.def m2block.def \
710 m2statement.def m2top.def m2tree.def m2treelib.def \
711 m2type.def m2linemap.def m2color.def
712
713 #
714 # the following tables define the source files used to build gm2 using only Modula-2
715 # sources (except for interfacing to libc and gcc).
716 #
717 # It is these files which are the source to cc1gm2$(exeext) at the end of stage1
718 #
719
720 GM2-LIBS-DEFS = ASCII.def IO.def Args.def M2RTS.def \
721 Assertion.def NumberIO.def Break.def SYSTEM.def \
722 CmdArgs.def Scan.def StrCase.def \
723 FIO.def StrIO.def StrLib.def TimeString.def \
724 UnixArgs.def wrapc.def Environment.def \
725 FpuIO.def Debug.def SysStorage.def \
726 Storage.def StdIO.def libc.def SEnvironment.def\
727 DynamicStrings.def SFIO.def SArgs.def \
728 PushBackInput.def StringConvert.def FormatStrings.def \
729 Builtins.def cbuiltin.def MathLib0.def M2EXCEPTION.def \
730 RTExceptions.def SMathLib0.def dtoa.def ldtoa.def \
731 termios.def RTint.def COROUTINES.def Indexing.def \
732 LMathLib0.def LegacyReal.def MemUtils.def GetOpt.def
733
734 GM2-LIBS-MODS = ASCII.mod IO.mod Args.mod M2RTS.mod \
735 Assertion.mod NumberIO.mod Break.mod SYSTEM.mod \
736 CmdArgs.mod Scan.mod StrCase.mod \
737 FIO.mod StrIO.mod StrLib.mod TimeString.mod \
738 Environment.mod \
739 FpuIO.mod Debug.mod SysStorage.mod \
740 Storage.mod StdIO.mod SEnvironment.mod\
741 DynamicStrings.mod SFIO.mod SArgs.mod \
742 PushBackInput.mod StringConvert.mod FormatStrings.mod \
743 Builtins.mod MathLib0.mod M2EXCEPTION.mod \
744 RTExceptions.mod SMathLib0.mod RTint.mod COROUTINES.mod \
745 Indexing.mod LMathLib0.mod LegacyReal.mod MemUtils.mod \
746 GetOpt.mod
747
748 GM2-LIBS-C = wrapc.c UnixArgs.c Selective.c choosetemp.c \
749 errno.c dtoa.c ldtoa.c \
750 termios.c SysExceptions.c host.c cgetopt.c
751
752 GM2-COMP-DEFS = FifoQueue.def M2Debug.def M2Optimize.def M2Defaults.def \
753 M2Options.def P3SymBuild.def M2ALU.def M2Depth.def \
754 M2Pass.def P0SymBuild.def P1SymBuild.def M2AsmUtil.def \
755 M2Quads.def \
756 M2StackWord.def M2FileName.def M2Base.def M2Reserved.def \
757 SymbolKey.def M2BasicBlock.def M2Search.def M2Batch.def \
758 M2System.def P2SymBuild.def M2Code.def M2Comp.def \
759 NameKey.def M2Version.def M2Error.def M2StackAddress.def \
760 M2Students.def M2GenGCC.def \
761 M2GCCDeclare.def M2Configure.def SymbolTable.def Lists.def \
762 P0SyntaxCheck.def bnflex.def P1Build.def P2Build.def \
763 P3Build.def PHBuild.def SymbolConversion.def \
764 M2Preprocess.def M2Printf.def M2LexBuf.def M2Quiet.def \
765 M2Bitset.def M2Size.def M2Scope.def M2Range.def \
766 M2Swig.def M2MetaError.def Sets.def M2CaseList.def \
767 PCSymBuild.def PCBuild.def M2Const.def M2DebugStack.def \
768 M2DriverOptions.def ObjectFiles.def M2ColorString.def \
769 M2Emit.def M2Check.def M2SSA.def
770
771 GM2-COMP-MODS = FifoQueue.mod M2AsmUtil.mod M2Optimize.mod \
772 M2StackWord.mod M2Options.mod M2Pass.mod M2Batch.mod \
773 M2Quads.mod M2Comp.mod M2Reserved.mod M2Configure.mod \
774 M2Debug.mod M2Defaults.mod M2Depth.mod NameKey.mod \
775 M2FileName.mod P0SymBuild.mod P1SymBuild.mod P2SymBuild.mod \
776 P3SymBuild.mod \
777 SymbolKey.mod SymbolTable.mod gm2lcc.mod \
778 gm2lgen.mod gm2lorder.mod M2Error.mod \
779 M2Students.mod M2StackAddress.mod \
780 M2BasicBlock.mod M2Code.mod M2GenGCC.mod M2GCCDeclare.mod\
781 M2ALU.mod M2System.mod M2Base.mod Lists.mod \
782 M2Search.mod bnflex.mod \
783 SymbolConversion.mod \
784 M2Preprocess.mod M2Printf.mod M2LexBuf.mod M2Quiet.mod \
785 M2Bitset.mod M2Size.mod M2Scope.mod M2Range.mod \
786 M2Swig.mod M2MetaError.mod Sets.mod M2CaseList.mod \
787 PCSymBuild.mod M2Const.mod M2DebugStack.mod \
788 M2DriverOptions.mod ObjectFiles.mod M2ColorString.mod \
789 M2Emit.mod M2Check.mod M2SSA.mod Output.mod
790
791 GM2-TOOLS-MOD = gm2l.mod gm2lcc.mod gm2lgen.mod gm2lorder.mod \
792 gm2m.mod ppg.mod
793
794 GM2-AUTO-MODS = P2Build.mod P3Build.mod PHBuild.mod PCBuild.mod \
795 P1Build.mod gm2l.mod gm2m.mod P0SyntaxCheck.mod
796
797 GM2-LIBIBERTY-DEFS = choosetemp.def pexecute.def
798
799 #
800 # GM2-VERIFY-MODS is a list of modules which have no __DATE__ stamp inside them
801 # and thus they can be built by the different versions of gm2.
802 # This list is used for testing only.
803 #
804
805 GM2-VERIFY-MODS = FifoQueue.mod M2AsmUtil.mod M2Optimize.mod \
806 M2StackWord.mod M2Pass.mod M2Batch.mod \
807 M2Quads.mod M2Comp.mod M2Reserved.mod M2Configure.mod \
808 M2Debug.mod M2Defaults.mod M2Depth.mod NameKey.mod \
809 M2FileName.mod P0SymBuild.mod P1SymBuild.mod P2SymBuild.mod \
810 P3SymBuild.mod \
811 SymbolKey.mod SymbolTable.mod gm2lcc.mod \
812 gm2lgen.mod gm2lorder.mod M2Error.mod M2StackAddress.mod \
813 M2Students.mod \
814 M2BasicBlock.mod M2Code.mod M2GenGCC.mod M2GCCDeclare.mod\
815 M2ALU.mod M2System.mod M2Base.mod Lists.mod \
816 M2Search.mod bnflex.mod ppg.mod Output.mod \
817 SymbolConversion.mod \
818 M2Preprocess.mod M2Printf.mod M2LexBuf.mod M2Quiet.mod \
819 M2Bitset.mod M2Size.mod CLexBuf.mod M2Scope.mod \
820 M2Range.mod M2Swig.mod M2MetaError.mod Sets.mod \
821 M2CaseList.mod PCSymBuild.mod M2Const.mod \
822 M2DebugStack.mod ObjectFiles.mod M2ColorString.mod M2Emit.mod
823
824 GM2-VERIFY-AUTO = P1Build.mod P2Build.mod PCBuild.mod P3Build.mod \
825 PHBuild.mod gm2l.mod gm2m.mod pg.mod \
826 P0SyntaxCheck.mod
827
828
829 #
830 # the ISO implementation modules
831 #
832
833 GM2-LIBS-ISO-MODS = ChanConsts.mod CharClass.mod ClientSocket.mod \
834 ComplexMath.mod \
835 ConvStringReal.mod ConvStringLong.mod \
836 ConvTypes.mod \
837 COROUTINES.mod \
838 EXCEPTIONS.mod \
839 GeneralUserExceptions.mod \
840 IOChan.mod \
841 IOConsts.mod IOLink.mod IOResult.mod \
842 LongComplexMath.mod \
843 LongConv.mod LongIO.mod \
844 LongMath.mod LongStr.mod \
845 LowLong.mod LowReal.mod LowShort.mod \
846 M2EXCEPTION.mod M2RTS.mod \
847 Processes.mod ProgramArgs.mod \
848 RandomNumber.mod \
849 RawIO.mod \
850 RealConv.mod RealIO.mod \
851 RealMath.mod RealStr.mod \
852 RndFile.mod \
853 RTdata.mod RTentity.mod \
854 RTgen.mod RTgenif.mod RTio.mod \
855 RTfio.mod \
856 Semaphores.mod \
857 SeqFile.mod ServerSocket.mod \
858 ShortComplexMath.mod \
859 SimpleCipher.mod \
860 StdChans.mod SIOResult.mod \
861 SLongIO.mod SRawIO.mod SRealIO.mod \
862 STextIO.mod Storage.mod StreamFile.mod \
863 Strings.mod StringChan.mod SWholeIO.mod \
864 \
865 SShortIO.mod SShortWholeIO.mod \
866 SLongWholeIO.mod ShortWholeIO.mod \
867 ShortIO.mod LongWholeIO.mod \
868 \
869 SysClock.mod \
870 SYSTEM.mod TERMINATION.mod TextIO.mod \
871 TermFile.mod \
872 WholeConv.mod WholeIO.mod WholeStr.mod
873
874 GM2-LIBS-ISO-C = ErrnoCategory.c wrapsock.c wraptime.c \
875 RTco.c
876
877 GM2-LIBS-PIM-MODS = \
878 CardinalIO.mod Display.mod InOut.mod \
879 Keyboard.mod RealInOut.mod Termbase.mod Terminal.mod \
880 Delay.mod ErrorCode.mod FileSystem.mod \
881 DebugTrace.mod Conversions.mod \
882 DebugPMD.mod LongIO.mod RealConversions.mod \
883 FloatingUtilities.mod Strings.mod \
884 Random.mod TimeDate.mod BitWordOps.mod \
885 BitByteOps.mod BitBlockOps.mod \
886 BlockOps.mod
887
888 GM2-LIBS-PIM-COR-MODS = \
889 Debug.mod SYSTEM.mod TimerHandler.mod \
890 Executive.mod
891
892 GM2-LIBS-MIN-DEFS = M2RTS.def SYSTEM.def
893 GM2-LIBS-MIN-MODS = M2RTS.mod SYSTEM.mod
894 GM2-LIBS-MIN-C = libc.c
895
896
897 BUILD-LIBS-BOOT-H = $(GM2-LIBS-BOOT-DEFS:%.def=m2/gm2-libs-boot/$(SRC_PREFIX)%.h)
898
899 BUILD-LIBS-BOOT = $(BUILD-LIBS-BOOT-H) \
900 $(GM2-LIBS-BOOT-MODS:%.mod=m2/gm2-libs-boot/%.o) \
901 $(GM2-LIBS-BOOT-C:%.c=m2/gm2-libs-boot/%.o)
902
903 BUILD-COMPILER-BOOT-H = $(GM2-COMP-BOOT-DEFS:%.def=m2/gm2-compiler-boot/$(SRC_PREFIX)%.h) \
904 $(GM2-LIBIBERTY-DEFS:%.def=m2/gm2-libiberty/$(SRC_PREFIX)%.h) \
905 $(GM2-GCC-DEFS:%.def=m2/gm2-gcc/$(SRC_PREFIX)%.h)
906
907 BUILD-COMPILER-BOOT = $(BUILD-COMPILER-BOOT-H) \
908 $(GM2-COMP-BOOT-DEFS:%.def=m2/gm2-compiler-boot/$(SRC_PREFIX)%.h) \
909 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
910 $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
911 m2/gm2-compiler-boot/m2flex.o \
912 m2/gm2-compiler-boot/M2Version.o
913
914 BUILD-BOOT-H = m2/boot-bin/mc$(exeext) \
915 $(BUILD-LIBS-BOOT-H) $(BUILD-COMPILER-BOOT-H) $(TARGET_H) $(PLUGIN_HEADERS)
916
917 GM2GCC = -I$(srcdir)/m2 -Im2 -I$(srcdir)/m2/gm2-gcc -Im2/gm2-gcc
918
919 MCINCLUDES= -I$(srcdir)/m2/mc-boot-ch
920 LOCAL_INCLUDES = -I. -I$(srcdir)/../include -I$(srcdir)
921
922 GCC_COLOR=m2/gm2-gcc/m2color.o diagnostic-color.o
923
924 m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs-boot/%.mod $(MCDEPS) $(BUILD-BOOT-H)
925 $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs-boot/$*.mod
926 $(COMPILER) -c $(CPP_GM2) $(CFLAGS) $(MCINCLUDES) m2/gm2-libs-boot/$*.c -o $@
927
928 m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
929 $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs/$*.mod
930 $(COMPILER) -c $(CPP_GM2) $(CFLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/$*.c -o $@
931
932 m2/gm2-libs-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
933 $(MC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
934
935 m2/gm2-libs-boot/RTcodummy.o: $(srcdir)/m2/gm2-libs-ch/RTcodummy.c m2/gm2-libs/gm2-libs-host.h
936 $(CC) -c -DIN_GCC $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
937
938 m2/gm2-libs-boot/RTintdummy.o: $(srcdir)/m2/gm2-libs-ch/RTintdummy.c m2/gm2-libs/gm2-libs-host.h
939 $(CC) -c -DIN_GCC $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
940
941 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
942 $(CC) -c -DHAVE_CONFIG_H $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
943
944 m2/gm2-libs-boot/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.c m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h m2/gm2-libs/gm2-libs-host.h
945 $(CC) -c -DIN_GCC $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
946
947 m2/gm2-libs-boot/choosetemp.o: m2/gm2-libs-ch/choosetemp.c m2/gm2-libiberty/Gchoosetemp.h m2/gm2-libs/gm2-libs-host.h
948 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty -I$(srcdir)/m2/gm2-libiberty/ $(INCLUDES) $< -o $@
949
950 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
951 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
952
953 m2/gm2-libs-boot/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.c m2/gm2-libs/gm2-libs-host.h
954 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
955
956 m2/gm2-libs-boot/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.c m2/gm2-libs/gm2-libs-host.h
957 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
958
959 m2/gm2-libs-boot/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c m2/gm2-libs-boot/$(SRC_PREFIX)termios.h m2/gm2-libs/gm2-libs-host.h
960 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
961
962 m2/gm2-libs-boot/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c \
963 m2/gm2-libs-boot/$(SRC_PREFIX)SysExceptions.h m2/gm2-libs/gm2-libs-host.h
964 $(CC) -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
965
966 m2/gm2-libs-boot/SysStorage.o: $(srcdir)/m2/gm2-libs/SysStorage.mod $(MCDEPS) $(BUILD-BOOT-H)
967 $(MC) -o=m2/gm2-libs-boot/SysStorage.c $(srcdir)/m2/gm2-libs/SysStorage.mod
968 $(COMPILER) -DIN_GCC -c -fpermissive $(CFLAGS) \
969 -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(MCINCLUDES) $(INCLUDES) \
970 m2/gm2-libs-boot/SysStorage.c -o m2/gm2-libs-boot/SysStorage.o
971
972 m2/gm2-compiler-boot/M2GCCDeclare.o: $(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod $(MCDEPS) $(BUILD-BOOT-H)
973 $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2GCCDeclare.c $<
974 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
975 -I. -I$(srcdir)/../include -I$(srcdir) \
976 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
977 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/M2GCCDeclare.c -o $@
978
979 m2/gm2-compiler-boot/M2Error.o: $(srcdir)/m2/gm2-compiler/M2Error.mod $(MCDEPS) $(BUILD-BOOT-H)
980 $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2Error.c $<
981 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
982 -I. -I$(srcdir)/../include -I$(srcdir) \
983 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
984 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/M2Error.c -o $@
985
986 m2/gm2-compiler-boot/%.o: $(srcdir)/m2/gm2-compiler/%.mod $(BUILD-BOOT-H) $(MCDEPS)
987 $(MC) -o=m2/gm2-compiler-boot/$*.c $(srcdir)/m2/gm2-compiler/$*.mod
988 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
989 -I. -I$(srcdir)/../include -I$(srcdir) \
990 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -Im2/gm2-libiberty \
991 $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/$*.c -o $@
992
993 m2/gm2-compiler-boot/P0SyntaxCheck.o: $(objdir)/m2/gm2-compiler-boot/P0SyntaxCheck.mod $(MCDEPS) $(BUILD-BOOT-H)
994 $(MC) -o=m2/gm2-compiler-boot/P0SyntaxCheck.c m2/gm2-compiler-boot/P0SyntaxCheck.mod
995 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
996 -I. -I$(srcdir)/../include -I$(srcdir) \
997 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
998 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/P0SyntaxCheck.c -o $@
999
1000 m2/gm2-compiler-boot/P1Build.o: $(objdir)/m2/gm2-compiler-boot/P1Build.mod $(MCDEPS) $(BUILD-BOOT-H)
1001 $(MC) -o=m2/gm2-compiler-boot/P1Build.c m2/gm2-compiler-boot/P1Build.mod
1002 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1003 -I. -I$(srcdir)/../include -I$(srcdir) \
1004 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1005 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/P1Build.c -o $@
1006
1007 m2/gm2-compiler-boot/P2Build.o: $(objdir)/m2/gm2-compiler-boot/P2Build.mod $(MCDEPS) $(BUILD-BOOT-H)
1008 $(MC) -o=m2/gm2-compiler-boot/P2Build.c m2/gm2-compiler-boot/P2Build.mod
1009 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1010 -I. -I$(srcdir)/../include -I$(srcdir) \
1011 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1012 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/P2Build.c -o $@
1013
1014 m2/gm2-compiler-boot/PCBuild.o: $(objdir)/m2/gm2-compiler-boot/PCBuild.mod $(MCDEPS) $(BUILD-BOOT-H)
1015 $(MC) -o=m2/gm2-compiler-boot/PCBuild.c m2/gm2-compiler-boot/PCBuild.mod
1016 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1017 -I. -I$(srcdir)/../include -I$(srcdir) \
1018 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1019 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/PCBuild.c -o $@
1020
1021 m2/gm2-compiler-boot/P3Build.o: $(objdir)/m2/gm2-compiler-boot/P3Build.mod $(MCDEPS) $(BUILD-BOOT-H)
1022 $(MC) -o=m2/gm2-compiler-boot/P3Build.c m2/gm2-compiler-boot/P3Build.mod
1023 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1024 -I. -I$(srcdir)/../include -I$(srcdir) \
1025 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1026 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/P3Build.c -o $@
1027
1028 m2/gm2-compiler-boot/PHBuild.o: $(objdir)/m2/gm2-compiler-boot/PHBuild.mod $(MCDEPS) $(BUILD-BOOT-H)
1029 $(MC) -o=m2/gm2-compiler-boot/PHBuild.c m2/gm2-compiler-boot/PHBuild.mod
1030 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1031 -I. -I$(srcdir)/../include -I$(srcdir) \
1032 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1033 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/PHBuild.c -o $@
1034
1035 m2/gm2-compiler-boot/gm2l.o: $(objdir)/m2/gm2-compiler-boot/gm2l.mod $(MCDEPS) $(BUILD-BOOT-H)
1036 $(MC) -o=m2/gm2-compiler-boot/gm2l.c m2/gm2-compiler-boot/gm2l.mod
1037 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1038 -I. -I$(srcdir)/../include -I$(srcdir) \
1039 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1040 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/gm2l.c -o $@
1041
1042 m2/gm2-compiler-boot/gm2m.o: $(objdir)/m2/gm2-compiler-boot/gm2m.mod $(MCDEPS) $(BUILD-BOOT-H)
1043 $(MC) -o=m2/gm2-compiler-boot/gm2m.c m2/gm2-compiler-boot/gm2m.mod
1044 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1045 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1046 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/gm2m.c -o $@
1047
1048 m2/gm2-compiler-boot/gm2lcc.o: $(srcdir)/m2/gm2-compiler/gm2lcc.mod $(MCDEPS) $(BUILD-BOOT-H)
1049 $(MC) -o=m2/gm2-compiler-boot/gm2lcc.c $(srcdir)/m2/gm2-compiler/gm2lcc.mod
1050 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1051 -I. -I$(srcdir)/../include -I$(srcdir) \
1052 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1053 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/gm2lcc.c -o $@
1054
1055 m2/gm2-compiler-boot/gm2lgen.o: $(srcdir)/m2/gm2-compiler/gm2lgen.mod $(MCDEPS) $(BUILD-BOOT-H)
1056 $(MC) -o=m2/gm2-compiler-boot/gm2lgen.c $(srcdir)/m2/gm2-compiler/gm2lgen.mod
1057 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS)\
1058 -I. -I$(srcdir)/../include -I$(srcdir) \
1059 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot $(GM2GCC) \
1060 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/gm2lgen.c -o $@
1061
1062 m2/gm2-compiler-boot/gm2lorder.o: $(srcdir)/m2/gm2-compiler/gm2lorder.mod $(MCDEPS) $(BUILD-BOOT-H)
1063 $(MC) --gcc-config-system -o=m2/gm2-compiler-boot/gm2lorder.c $(srcdir)/m2/gm2-compiler/gm2lorder.mod
1064 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1065 -I. -I$(srcdir)/../include -I$(srcdir) \
1066 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1067 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-compiler-boot/gm2lorder.c -o $@
1068
1069 m2/gm2-compiler-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-compiler/%.def $(MCDEPS)
1070 $(MC) -o=$@ $(srcdir)/m2/gm2-compiler/$*.def
1071
1072 m2/gm2-ici-boot/M2Emit.o: $(srcdir)/m2/gm2-ici/M2Emit.mod $(MCDEPS) $(BUILD-BOOT-H)
1073 $(MC) -o=m2/gm2-ici-boot/M2Emit.c $(srcdir)/m2/gm2-ici/M2Emit.mod
1074 $(COMPILER) -c -fpermissive $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \
1075 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \
1076 -I$(srcdir)/m2/gm2-libiberty $(MCINCLUDES) $(INCLUDES) m2/gm2-ici-boot/M2Emit.c -o $@
1077
1078 m2/gm2-ici/m2flex.o: m2/gm2-compiler/m2flex.c $(BUILD-BOOT-H) $(TIMEVAR_H)
1079 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1080 -DGM2TOOLS $(GM2GCC) $(INCLUDES) -I$(srcdir)/m2 \
1081 -Im2 -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1082
1083 m2/gm2-ici-boot/m2linemap.o: $(srcdir)/m2/gm2-ici/m2linemap.c $(BUILD-BOOT-H) $(TIMEVAR_H)
1084 $(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
1085
1086 m2/gm2-ici/m2linemap.o: $(srcdir)/m2/gm2-ici/m2linemap.c $(BUILD-BOOT-H) $(TIMEVAR_H)
1087 $(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
1088
1089 m2/gm2-compiler-boot/m2flex.o: m2/gm2-compiler/m2flex.c $(BUILD-BOOT-H) $(TIMEVAR_H) \
1090 $(BUILD-LIBS-BOOT-H) m2/gm2-compiler-boot/$(SRC_PREFIX)NameKey.h \
1091 $(CONFIG_H) m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS)
1092 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1093 $(GM2GCC) $(INCLUDES) -I$(srcdir)/m2 \
1094 -Im2 -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1095
1096 m2/gm2-compiler-boot/cflex.o: m2/gm2-compiler/cflex.c m2/gm2-compiler-boot/$(SRC_PREFIX)CLexBuf.h \
1097 $(BUILD-BOOT-H)
1098 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1099 $(GM2GCC) $(INCLUDES) -I$(srcdir)/m2 \
1100 -Im2 -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1101
1102 m2/gm2-compiler/m2flex.c: $(srcdir)/m2/m2.flex $(TIMEVAR_H)
1103 flex -t $< | sed -e 's/ malloc/ xmalloc/' | sed -e 's/ realloc/ xrealloc/' > $@
1104
1105 m2/gm2-compiler/cflex.c: $(srcdir)/m2/c.flex
1106 flex -t $< | sed -e 's/ malloc/ xmalloc/' | sed -e 's/ realloc/ xrealloc/' > $@
1107
1108 m2/gm2-libiberty/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libiberty/%.def $(MCDEPS)
1109 $(MC) -o=$@ $(srcdir)/m2/gm2-libiberty/$*.def
1110
1111 m2/gm2-compiler-boot/M2Version.o: m2/gm2-compiler-boot/M2Version.mod $(MCDEPS) $(BUILD-BOOT-H)
1112 $(MC) -o=m2/gm2-compiler-boot/M2Version.c $<
1113 $(COMPILER) -c $(ALL_CPPFLAGS) $(GM2GCC) -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -Im2/gm2-libiberty $(INCLUDES) m2/gm2-compiler-boot/M2Version.c -o $@
1114
1115 m2/gm2-compiler-boot/M2Version.mod: M2Version-check; @true
1116
1117 M2Version-check:
1118 sh $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler-boot
1119 $(STAMP) M2Version-check
1120
1121 #
1122 # now for the rules which build objects in the gm2-compiler gm2-libs directories
1123 #
1124
1125 m2/gm2-libiberty/xlibc.o: $(srcdir)/m2/gm2-libs-ch/xlibc.c m2/gm2-libs/gm2-libs-host.h
1126 $(COMPILER) -DBUILD_GM2_LIBS -c $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs -Im2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1127
1128 m2/gm2-libiberty/tool.o: $(srcdir)/m2/gm2-libs-ch/tools.c m2/gm2-libs/gm2-libs-host.h
1129 $(COMPILER) -DBUILD_GM2_LIBS -c $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs -Im2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1130
1131 m2/gm2-compiler/M2Options.o: $(srcdir)/m2/gm2-compiler/M2Options.mod
1132 $(GM2_1) $(GM2_FLAGS) -c -B./ -I$(srcdir)/m2/gm2-compiler -Im2/gm2-libs:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-gcc $(GM2_DEBUG_STRMEM) $< -o $@
1133
1134 m2/gm2-compiler/M2Search.o: $(srcdir)/m2/gm2-compiler/M2Search.mod
1135 $(GM2_1) $(GM2_FLAGS) -c -B./ -I$(srcdir)/m2/gm2-compiler -Im2/gm2-libs:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-gcc $(GM2_DEBUG_STRMEM) $< -o $@
1136
1137 m2/gm2-compiler/M2Quads.o: $(srcdir)/m2/gm2-compiler/M2Quads.mod
1138 $(GM2_1) $(GM2_FLAGS) -c -B./ -I$(srcdir)/m2/gm2-compiler -Im2/gm2-libs:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-gcc $(GM2_DEBUG_STRMEM) $< -o $@
1139
1140 m2/gm2-compiler/%.o: $(srcdir)/m2/gm2-compiler/%.mod
1141 $(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 $@
1142
1143 m2/gm2-compiler/m2flex.o: m2/gm2-compiler/m2flex.c m2/gm2-libs/gm2-libs-host.h $(TIMEVAR_H)
1144 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1145 $(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1146
1147 m2/gm2-compiler/cflex.o: m2/gm2-compiler/cflex.c m2/gm2-compiler-boot/$(SRC_PREFIX)CLexBuf.h \
1148 m2/gm2-compiler-boot/$(SRC_PREFIX)cflex.h m2/gm2-libs/gm2-libs-host.h
1149 $(COMPILER) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1150 $(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1151
1152 m2/gm2-compiler/gm2l.o: $(objdir)/m2/gm2-compiler/gm2l.mod
1153 $(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 $@
1154
1155 m2/gm2-compiler/gm2m.o: $(objdir)/m2/gm2-compiler/gm2m.mod
1156 $(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 $@
1157
1158 m2/gm2-compiler/P0SyntaxCheck.o: $(objdir)/m2/gm2-compiler/P0SyntaxCheck.mod
1159 $(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 $@
1160
1161 m2/gm2-compiler/P1Build.o: $(objdir)/m2/gm2-compiler/P1Build.mod
1162 $(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 $@
1163
1164 m2/gm2-compiler/P2Build.o: $(objdir)/m2/gm2-compiler/P2Build.mod
1165 $(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 $@
1166
1167 m2/gm2-compiler/PCBuild.o: $(objdir)/m2/gm2-compiler/PCBuild.mod
1168 $(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 $@
1169
1170 m2/gm2-compiler/P3Build.o: $(objdir)/m2/gm2-compiler/P3Build.mod
1171 $(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 $@
1172
1173 m2/gm2-compiler/PHBuild.o: $(objdir)/m2/gm2-compiler/PHBuild.mod
1174 $(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 $@
1175
1176 m2/gm2-compiler/M2Version.o: m2/gm2-compiler/M2Version.mod
1177 $(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 $@
1178
1179 m2/gm2-compiler/M2Version.mod:
1180 sh $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler
1181
1182 m2/gm2-libs-iso/%.o: $(srcdir)/m2/gm2-libs-iso/%.c m2/gm2-libs/gm2-libs-host.h
1183 $(CC) -DBUILD_GM2_LIBS_TARGET -DBUILD_GM2_LIBS -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1184
1185 m2/gm2-libs-iso/%.o: $(srcdir)/m2/gm2-libs-iso/%.mod
1186 $(GM2_1) $(GM2_ISO_FLAGS) -c -B./ -Im2/gm2-libs-iso:$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libs $< -o $@
1187
1188
1189 # We build the cc1gm2$(exeext) from the boot stage and then proceed to build it
1190 # again using itself.
1191
1192 m2/gm2-libs/gm2-libs-host.h:
1193 echo "Configuring to build libraries using native compiler" ; \
1194 NEW_SRCDIR=`${srcdir}/m2/tools-src/calcpath ../../ ${srcdir} m2/gm2-libs` ; \
1195 export NEW_SRCDIR ; \
1196 cd m2/gm2-libs ; \
1197 $(SHELL) -c '$${NEW_SRCDIR}/config-host \
1198 --srcdir=$${NEW_SRCDIR} \
1199 --target=$(target) \
1200 --program-suffix=$(exeext)'
1201
1202 # Autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
1203 # cross compiler and the ../Makefile.in above appends this to INTERNAL_CFLAGS.
1204
1205 m2/gm2config.h:
1206 NEW_SRCDIR=`${srcdir}/m2/tools-src/calcpath ../ ${srcdir} m2` ; \
1207 export NEW_SRCDIR ; \
1208 cd m2 ; \
1209 if echo $(INTERNAL_CFLAGS) | grep \\-DCROSS_DIRECTORY_STRUCTURE; then \
1210 AR=$(echo $(AR_FOR_TARGET) | sed -e "s/^ //") ; \
1211 export AR ; \
1212 RANLIB=$(echo $(RANLIB_FOR_TARGET) | sed -e "s/^ //") ; \
1213 export RANLIB ; \
1214 $(SHELL) -c '$${NEW_SRCDIR}/configure --srcdir=$${NEW_SRCDIR} \
1215 --target=$(target) --program-suffix=$(exeext) \
1216 --includedir=$(SYSTEM_HEADER_DIR) --libdir=$(libdir) \
1217 --libexecdir=$(libexecdir)' ; \
1218 else \
1219 $(SHELL) -c '$${NEW_SRCDIR}/configure --srcdir=$(NEW_SRCDIR) \
1220 --target=$(target) --program-suffix=$(exeext)' ; \
1221 fi
1222
1223 $(objdir)/m2/gm2-libs-min/SYSTEM.def: $(GM2_PROG_DEP)
1224 sh $(srcdir)/m2/tools-src/makeSystem -fpim \
1225 $(srcdir)/m2/gm2-libs-min/SYSTEM.def \
1226 $(srcdir)/m2/gm2-libs-min/SYSTEM.mod \
1227 -I$(srcdir)/m2/gm2-libs-min:$(srcdir)/m2/gm2-libs \
1228 "$(GM2_FOR_TARGET)" $@
1229
1230 $(objdir)/m2/gm2-libs/SYSTEM.def: $(GM2_PROG_DEP)
1231 echo "GM2_FOR_TARGET $(GM2_FOR_TARGET)"
1232 echo "GCC_FOR_TARGET $(GCC_FOR_TARGET)"
1233 sh $(srcdir)/m2/tools-src/makeSystem -fpim \
1234 $(srcdir)/m2/gm2-libs/SYSTEM.def \
1235 $(srcdir)/m2/gm2-libs/SYSTEM.mod \
1236 -I$(srcdir)/m2/gm2-libs \
1237 "$(GM2_FOR_TARGET)" $@
1238
1239 $(objdir)/m2/gm2-libs-iso/SYSTEM.def: $(GM2_PROG_DEP)
1240 sh $(srcdir)/m2/tools-src/makeSystem -fiso \
1241 $(srcdir)/m2/gm2-libs-iso/SYSTEM.def \
1242 $(srcdir)/m2/gm2-libs-iso/SYSTEM.mod \
1243 -I$(srcdir)/m2/gm2-libs-iso:$(srcdir)/m2/gm2-libs \
1244 "$(GM2_FOR_TARGET)" $@
1245
1246 $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def: $(GM2_PROG_DEP)
1247 sh $(srcdir)/m2/tools-src/makeSystem -fpim \
1248 $(srcdir)/m2/gm2-libs-coroutines/SYSTEM.def \
1249 $(srcdir)/m2/gm2-libs-coroutines/SYSTEM.mod \
1250 -I$(srcdir)/m2/gm2-libs-coroutines:$(srcdir)/m2/gm2-libs-iso:$(srcdir)/m2/gm2-libs \
1251 "$(GM2_FOR_TARGET)" $@
1252
1253 ifeq ($(MINLIB),yes)
1254 build-system: $(objdir)/m2/gm2-libs-min/SYSTEM.def
1255 else
1256 build-system: $(objdir)/m2/gm2-libs-min/SYSTEM.def \
1257 $(objdir)/m2/gm2-libs/SYSTEM.def \
1258 $(objdir)/m2/gm2-libs-iso/SYSTEM.def \
1259 $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def
1260 endif
1261
1262 build-compiler: $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \
1263 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o) \
1264 m2/gm2-compiler/M2Version.o \
1265 m2/gm2-compiler/m2flex.o
1266
1267 m2/gm2-compiler/gm2.a: build-compiler gm2$(exeext)
1268 $(AR_FOR_TARGET) cr $@ $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \
1269 m2/gm2-compiler/M2Version.o \
1270 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o)
1271 $(RANLIB) $@
1272
1273 m2/gm2-libs-boot/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-BOOT)
1274 $(AR) cr $@ $(GM2-LIBS-BOOT-MODS:%.mod=m2/gm2-libs-boot/%.o) \
1275 $(GM2-LIBS-BOOT-C:%.c=m2/gm2-libs-boot/%.o)
1276 $(RANLIB) $@
1277
1278 m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext) m2/boot-bin/mklink$(exeext) \
1279 $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT)
1280 $(AR) cr $@ $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
1281 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
1282 m2/gm2-compiler-boot/M2Version.o
1283 $(RANLIB) $@
1284
1285 m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext)
1286
1287 m2/boot-bin/mklink$(exeext): $(srcdir)/m2/tools-src/mklink.c
1288 $(CXX) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) $< -o $@
1289
1290 m2/gm2-auto/pg.o: m2/gm2-auto/pg.mod $(MCDEPS)
1291 $(MC) --quiet -o=m2/gm2-auto/pg.c m2/gm2-auto/pg.mod
1292 $(COMPILER) -c $(CFLAGS) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) m2/gm2-auto/pg.c -o $@
1293
1294 m2/gm2-auto/pge.o: m2/gm2-auto/pge.mod $(MCDEPS)
1295 $(MC) --quiet -o=m2/gm2-auto/pge.c m2/gm2-auto/pge.mod
1296 $(COMPILER) -c $(CFLAGS) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) m2/gm2-auto/pge.c -o $@
1297
1298 m2/gm2-auto/%.o: m2/gm2-auto/%.mod $(MCDEPS)
1299 $(MC) --quiet -o=m2/gm2-auto/$*.c m2/gm2-auto/$*.mod
1300 $(COMPILER) -c $(CFLAGS) -I. -I$(srcdir)/../include -I$(srcdir) -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) m2/gm2-auto/$*.c -o $@
1301
1302 m2/gm2-compiler-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-compiler-boot/%.def $(MCDEPS)
1303 $(MC) --quiet -o=$@ $(srcdir)/m2/gm2-compiler-boot/$*.def
1304
1305
1306 # Rules for mc
1307
1308 # The default rule used generate mc, eventually it will be replaced by mc-bootstrap.
1309
1310 # PGE is only needed by 'make mc-maintainer' when regenerating the C version of mc from the
1311 # source of mc written in m2.
1312 # This reference is to an out of build tree copy of pge, as the in build tree is built by mc.
1313
1314 PGE=${HOME}/GM2/graft-combine/build-gaius-enabled/gcc/m2/pge
1315 BOOTGM2=gm2
1316
1317 MCOPTIONS=-g -c -fsources -fsoft-check-all -fm2-g # -fauto-init
1318 MCLINK=-g # use -g -fmodules -c if you are debugging and wish to see missing modules.
1319
1320 # this is only needed in maintainer mode by 'make mc-maintainer' when regenerating the C version of mc.
1321
1322 GM2SYS=${HOME}/opt/lib/gcc/x86_64-pc-linux-gnu/12.0.0/m2/m2pim
1323 GM2PATH=$(srcdir)/m2/mc:$(GM2SYS):$(srcdir)/m2:m2/gm2-auto:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso
1324
1325 mc: mc-clean mc-devel
1326
1327
1328 #
1329 # mc-autogen - converts itself into C
1330 #
1331
1332 mc-push: force
1333 cp -p m2/mc-boot-gen/*.c $(srcdir)/m2/mc-boot/
1334 cp -p m2/mc-boot-gen/*.h $(srcdir)/m2/mc-boot/
1335
1336 mc-clean: force
1337 $(RM) m2/mc-boot-gen/*.[ch] m2/boot-bin/* m2/mc-boot/* m2/mc-boot-ch/*
1338
1339 mc-maintainer: mc-clean mc-autogen mc-push mc-clean mc-bootstrap
1340
1341 mc-clean-libs: force
1342 $(RM) m2/gm2-libs-boot/*
1343
1344 mc-continue: mc-clean mc-bootstrap mc-clean-libs mc-fresh $(BUILD-MC-INTERFACE-O) $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT)
1345
1346 mc-fresh: force
1347 $(RM) m2/gm2-auto/* m2/gm2-compiler-boot/* m2/gm2-libs-boot/*
1348
1349 mc-help: force
1350 @echo "mc-maintainer produces a new mc C version in the source tree (takes longer)"
1351 @echo "mc-continue builds the mc from the C version and attempts to build gm2 libraries and gm2 compiler"
1352 @echo "mc-verify builds mc from Modula-2 sources and mc from C sources and run both on all sources diffing the output"
1353 @echo "mc builds mc from Modula-2 sources, quickly"
1354 @echo "m2/pge build the parser generator (needed by mc-maintainer)"
1355
1356 mc-verify: mc-clean mc-bootstrap mc
1357 mv mc m2/boot-bin/mc.m2
1358 @echo "verifying the two generations of mc"
1359 for i in $(GM2-VERIFY-MODS) ; do \
1360 echo -n "$$i " ; \
1361 m2/boot-bin/mc $(MC_ARGS) -o=mcout.c $(srcdir)/m2/gm2-compiler/$$i > /dev/null ; \
1362 echo -n "[1]" ; \
1363 m2/boot-bin/mc.m2 $(MC_ARGS) -o=mcout.m2 $(srcdir)/m2/gm2-compiler/$$i > /dev/null ; \
1364 echo -n "[2]" ; \
1365 $(RM) $$i.mc-diff ; \
1366 if [ -f mcout.c -a -f mcout.m2 ] ; then \
1367 if diff mcout.c mcout.m2 > /dev/null ; then \
1368 echo "[passed]" ; \
1369 else \
1370 echo "[*** failed ***]" ; \
1371 diff mcout.c mcout.m2 > $$i.mc-diff ; \
1372 fi \
1373 fi ; \
1374 $(RM) mcout.c mcout.m2 ; \
1375 done
1376
1377 mc-stage2: force
1378 m2/boot-bin/mc$(exeext) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=m2/mc-boot-gen/GmcStream.c $(srcdir)/m2/mc/mcStream.mod
1379 m2/boot-bin/mc$(exeext) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=m2/mc-boot-gen/Gdecl.c $(srcdir)/m2/mc/decl.mod
1380 if diff m2/mc-boot-gen/Gdecl.c $(srcdir)/m2/mc-boot/Gdecl.c ; then echo "passed" ; else echo "failed" ; fi
1381
1382
1383
1384 #
1385 # mc-devel - compiles mc using gm2
1386 #
1387
1388 mc-devel: m2/boot-bin/mc-devel$(exeext)
1389
1390 m2/boot-bin/mc-devel$(exeext): $(objdir)/m2/gm2-auto/mcp1.mod \
1391 $(objdir)/m2/gm2-auto/mcp2.mod \
1392 $(objdir)/m2/gm2-auto/mcp3.mod \
1393 $(objdir)/m2/gm2-auto/mcp4.mod \
1394 $(objdir)/m2/gm2-auto/mcp5.mod \
1395 mcflex.c
1396 $(HOSTCC) -I$(srcdir)/m2/mc -c -g mcflex.c
1397 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/decl.mod
1398 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcStream.mod
1399 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPretty.mod
1400 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/top.mod
1401 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcStack.mod
1402 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/varargs.mod
1403 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcMetaError.mod
1404 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcOptions.mod
1405 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcComp.mod
1406 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/gm2-auto/mcp1.mod
1407 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/gm2-auto/mcp2.mod
1408 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/gm2-auto/mcp3.mod
1409 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/gm2-auto/mcp4.mod
1410 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/gm2-auto/mcp5.mod
1411 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/wlists.mod
1412 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/alists.mod
1413 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/symbolKey.mod
1414 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcReserved.mod
1415 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/nameKey.mod
1416 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcSearch.mod
1417 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcFileName.mod
1418 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcLexBuf.mod
1419 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcQuiet.mod
1420 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcError.mod
1421 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcDebug.mod
1422 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPrintf.mod
1423 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/Indexing.mod
1424 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPreprocess.mod
1425 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/keyc.mod
1426 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcComment.mod
1427 cp $(srcdir)/m2/init/mcinit top.lst
1428 $(BOOTGM2) $(MCLINK) -I. -fonlylink -I$(GM2PATH) -fuselist $(srcdir)/m2/mc/top.mod -o mc m2/gm2-libs-boot/RTcodummy.o
1429
1430 m2/boot-bin/mc-opt$(exeext): $(objdir)/m2/gm2-auto/mcp1.mod \
1431 $(objdir)/m2/gm2-auto/mcp2.mod \
1432 $(objdir)/m2/gm2-auto/mcp3.mod \
1433 $(objdir)/m2/gm2-auto/mcp4.mod \
1434 $(objdir)/m2/gm2-auto/mcp5.mod \
1435 mcflex.c
1436 g++ -I$(srcdir)/m2/mc -c -g mcflex.c
1437 $(BOOTGM2) -fsources -fm2-whole-program -g -I$(srcdir)/m2/mc:$(objdir)/m2/gm2-auto:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/mc $(srcdir)/m2/mc/top.mod
1438
1439 m2/mc/decl.o: $(srcdir)/m2/mc/decl.mod
1440 $(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) -o $@ $(srcdir)/m2/mc/decl.mod
1441
1442 mcflex.o: mcflex.c
1443 $(CC) -I$(srcdir)/m2/mc -g -c $< -o $@ # remember that mcReserved.h is copied into m2/mc
1444
1445 mcflex.c: $(srcdir)/m2/mc/mc.flex
1446 flex -t $< > $@
1447
1448 $(objdir)/m2/gm2-auto/mcp1.mod: $(srcdir)/m2/bnf/mc-1.bnf
1449 $(PGE) -l $< -o $@
1450
1451 $(objdir)/m2/gm2-auto/mcp2.mod: $(srcdir)/m2/bnf/mc-2.bnf
1452 $(PGE) -l $< -o $@
1453
1454 $(objdir)/m2/gm2-auto/mcp3.mod: $(srcdir)/m2/bnf/mc-3.bnf
1455 $(PGE) -l $< -o $@
1456
1457 $(objdir)/m2/gm2-auto/mcp4.mod: $(srcdir)/m2/bnf/mc-4.bnf
1458 $(PGE) -l $< -o $@
1459
1460 $(objdir)/m2/gm2-auto/mcp5.mod: $(srcdir)/m2/bnf/mc-5.bnf
1461 $(PGE) -l $< -o $@
1462
1463 gm2-bootstrap: mc-devel
1464 for i in $(srcdir)/m2/gm2-libs/*.def ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs $$i ; done
1465 for i in $(srcdir)/m2/gm2-compiler/*.def ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-gcc $$i ; done
1466 for i in $(srcdir)/m2/gm2-libs/*.mod ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-gcc $$i ; done
1467
1468 MC-LIB-DEFS = Args.def ASCII.def Assertion.def Break.def \
1469 CmdArgs.def Debug.def \
1470 dtoa.def DynamicStrings.def Environment.def \
1471 errno.def FIO.def FormatStrings.def FpuIO.def \
1472 IO.def ldtoa.def libc.def \
1473 libm.def M2EXCEPTION.def M2RTS.def \
1474 MemUtils.def NumberIO.def PushBackInput.def \
1475 RTExceptions.def RTint.def SArgs.def \
1476 SFIO.def StdIO.def Storage.def StrCase.def \
1477 StringConvert.def StrIO.def StrLib.def \
1478 SysExceptions.def SysStorage.def \
1479 SYSTEM.def TimeString.def \
1480 UnixArgs.def wrapc.def \
1481 RTco.def \
1482 COROUTINES.def Selective.def termios.def
1483
1484 MC-LIB-MODS = Args.mod ASCII.mod Assertion.mod Break.mod \
1485 CmdArgs.mod Debug.mod \
1486 DynamicStrings.mod Environment.mod \
1487 FIO.mod FormatStrings.mod FpuIO.mod \
1488 IO.mod \
1489 RTExceptions.mod RTint.mod \
1490 M2EXCEPTION.mod M2RTS.mod \
1491 MemUtils.mod NumberIO.mod PushBackInput.mod \
1492 SArgs.mod \
1493 SFIO.mod StdIO.mod Storage.mod StrCase.mod \
1494 StringConvert.mod StrIO.mod StrLib.mod \
1495 SysStorage.mod \
1496 TimeString.mod
1497
1498 MC-LIB-BOOT-C = $(MC-LIB-MODS:%.mod=%.c)
1499
1500 MC-DEFS = alists.def decl.def Indexing.def keyc.def lists.def \
1501 mcComp.def mcComment.def \
1502 mcDebug.def mcError.def mcFileName.def \
1503 mcflex.def mcLexBuf.def mcMetaError.def mcOptions.def \
1504 mcp1.def mcp2.def mcp3.def mcp4.def mcp5.def \
1505 mcPreprocess.def \
1506 mcPretty.def mcPrintf.def mcQuiet.def mcReserved.def \
1507 mcSearch.def mcStack.def mcStream.def \
1508 nameKey.def symbolKey.def \
1509 varargs.def wlists.def
1510
1511 MC-MODS = alists.mod decl.mod Indexing.mod keyc.mod lists.mod \
1512 mcComp.mod mcComment.mod \
1513 mcDebug.mod mcError.mod mcFileName.mod \
1514 mcLexBuf.mod mcMetaError.mod mcOptions.mod \
1515 mcPreprocess.mod \
1516 mcPretty.mod mcPrintf.mod mcQuiet.mod mcReserved.mod \
1517 mcSearch.mod mcStack.mod mcStream.mod \
1518 nameKey.mod symbolKey.mod \
1519 varargs.mod wlists.mod top.mod
1520
1521 MC-AUTO-MODS = mcp1.mod mcp2.mod mcp3.mod mcp4.mod mcp5.mod
1522
1523 MC-BOOT-C = $(MC-MODS:%.mod=%.c) $(MC-AUTO-MODS:%.mod=%.c)
1524
1525 MC-INTERFACE-C = libc.c mcrts.c UnixArgs.c Selective.c termios.c \
1526 SysExceptions.c ldtoa.c dtoa.c wrapc.c \
1527 SYSTEM.c errno.c
1528
1529 BUILD-MC-BOOT-H = $(MC-LIB-DEFS:%.def=m2/mc-boot-gen/$(SRC_PREFIX)%.h) \
1530 $(MC-DEFS:%.def=m2/mc-boot-gen/$(SRC_PREFIX)%.h)
1531
1532 BUILD-MC-BOOT-C = $(MC-LIB-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.c) \
1533 $(MC-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.c)
1534
1535 BUILD-MC-BOOT-AUTO-C = $(MC-AUTO-MODS:%.mod=m2/mc-boot-gen/$(SRC_PREFIX)%.c)
1536
1537 BUILD-MC-BOOT-O = $(MC-LIB-BOOT-C:%.c=m2/mc-boot/$(SRC_PREFIX)%.o) \
1538 $(MC-BOOT-C:%.c=m2/mc-boot/$(SRC_PREFIX)%.o)
1539
1540 BUILD-MC-INTERFACE-O = $(MC-INTERFACE-C:%.c=m2/mc-boot-ch/$(SRC_PREFIX)%.o)
1541
1542
1543 $(objdir)/plugin:
1544 test -d $@ || mkdir -p $@
1545
1546 $(objdir)/m2/mc-boot:
1547 test -d $@ || mkdir -p $@
1548
1549 $(objdir)/m2/mc-boot-ch:
1550 test -d $@ || mkdir -p $@
1551
1552 $(objdir)/m2/mc-boot-gen:
1553 test -d $@ || mkdir -p $@
1554
1555 mc-autogen: mc-clean mc-devel \
1556 $(BUILD-MC-BOOT-H) $(BUILD-MC-BOOT-C) \
1557 $(BUILD-MC-BOOT-AUTO-C)
1558 for i in m2/mc-boot-gen/*.c ; do $(HOSTCC) -g -c -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/mc-boot-gen/ $$i -o m2/mc-boot-gen/$(shell basename $$i .c).o ; done
1559 @echo -n "built "
1560 @cd m2/mc-boot-gen ; ls *.o | wc -l
1561 @echo -n "out of "
1562 @cd m2/mc-boot-gen ; ls *.c | wc -l
1563 @echo "modules"
1564
1565 # EXTENDED_OPAQUE = --extended-opaque
1566 EXTENDED_OPAQUE =
1567 MC_OPTIONS = $(MC_COPYRIGHT) --gcc-config-system
1568
1569 m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/mc/%.def
1570 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1571
1572 m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def
1573 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1574
1575 m2/mc-boot-gen/$(SRC_PREFIX)decl.c: $(srcdir)/m2/mc/decl.mod
1576 ./mc $(MC_OPTIONS) --extended-opaque -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1577
1578 m2/mc-boot-gen/$(SRC_PREFIX)%.c: $(srcdir)/m2/mc/%.mod
1579 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1580
1581 m2/mc-boot-gen/$(SRC_PREFIX)%.c: $(srcdir)/m2/gm2-libs/%.mod
1582 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1583
1584 m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs-iso/%.def
1585 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1586
1587 m2/mc-boot-gen/$(SRC_PREFIX)%.c: m2/gm2-auto/%.mod
1588 ./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
1589
1590 m2/mc-boot/$(SRC_PREFIX)%.o: m2/mc-boot/$(SRC_PREFIX)%.c
1591 $(HOSTCC) -g -c -I. -I$(srcdir)/m2/mc-boot-ch -I$(srcdir)/../include -I$(srcdir) $< -o $@
1592
1593 m2/mc-boot-ch/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h
1594 $(HOSTCC) -DHAVE_CONFIG_H -g -c -I. -Im2/gm2-libs -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-libs $< -o $@
1595
1596 # mc-bootstrap compiles mc using the C version previously generated by mc-autogen.
1597 # These autogenerated files will be checked into git by the maintainer.
1598
1599 mc-bootstrap: mc-clean m2/boot-bin/mc$(exeext)
1600
1601 m2/boot-bin/mc$(exeext): $(BUILD-MC-BOOT-O) $(BUILD-MC-INTERFACE-O) m2/mc-boot/main.o mcflex.o m2/gm2-libs-boot/RTcodummy.o
1602 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-MC-BOOT-O) \
1603 $(BUILD-MC-INTERFACE-O) m2/mc-boot/main.o mcflex.o m2/gm2-libs-boot/RTcodummy.o -lm
1604
1605 m2/mc-boot/main.o: $(M2LINK) $(srcdir)/m2/init/mcinit
1606 unset CC ; $(M2LINK) -s --gcc --exit --name mainmcinit.c $(srcdir)/m2/init/mcinit
1607 mv mainmcinit.c m2/mc-boot/main.c
1608 $(HOSTCC) -g -c -I. -I$(srcdir)/../include -I$(srcdir) m2/mc-boot/main.c -o $@
1609
1610 # The rules which build objects in the gm2-compiler-paranoid gm2-libs-paranoid directories.
1611
1612 m2/gm2-libs-paranoid/%.o: m2/gm2-libs-ch/%.c
1613 $(XGCC) -c -g $(GM2_O_S3) $(GM2_O) -I./ -Im2/gm2-libs -Wall $(INCLUDES) $< -o $@
1614
1615 m2/gm2-libs-paranoid/%.o: $(srcdir)/m2/gm2-libs/%.mod
1616 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libiberty $< -o $@
1617
1618 m2/gm2-compiler-paranoid/%.o: $(srcdir)/m2/gm2-compiler/%.mod
1619 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1620
1621 m2/gm2-compiler-paranoid/%.o: m2/gm2-compiler-paranoid/%.mod
1622 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1623
1624 m2/gm2-compiler-paranoid/gm2l.o: $(objdir)/m2/gm2-compiler-paranoid/gm2l.mod
1625 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1626
1627 m2/gm2-compiler-paranoid/gm2m.o: $(objdir)/m2/gm2-compiler-paranoid/gm2m.mod
1628 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1629
1630 m2/gm2-compiler-paranoid/P0SyntaxCheck.o: $(objdir)/m2/gm2-compiler-paranoid/P0SyntaxCheck.mod
1631 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1632
1633 m2/gm2-compiler-paranoid/P1Build.o: $(objdir)/m2/gm2-compiler-paranoid/P1Build.mod
1634 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1635
1636 m2/gm2-compiler-paranoid/P2Build.o: $(objdir)/m2/gm2-compiler-paranoid/P2Build.mod
1637 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1638
1639 m2/gm2-compiler-paranoid/P3Build.o: $(objdir)/m2/gm2-compiler-paranoid/P3Build.mod
1640 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1641
1642 m2/gm2-compiler-paranoid/PHBuild.o: $(objdir)/m2/gm2-compiler-paranoid/PHBuild.mod
1643 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1644
1645 m2/gm2-compiler-paranoid/PCBuild.o: $(objdir)/m2/gm2-compiler-paranoid/PCBuild.mod
1646 $(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
1647
1648 m2/gm2-libs-paranoid/host.o: $(srcdir)/m2/gm2-libs-ch/host.c m2/gm2-libs/gm2-libs-host.h
1649 $(CC) -c $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $< -o $@
1650
1651 m2/gm2-libs-paranoid/wrapc.o: $(srcdir)/m2/gm2-libs-ch/wrapc.c m2/gm2-libs-boot/$(SRC_PREFIX)wrapc.h m2/gm2-libs/gm2-libs-host.h
1652 $(CC) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1653
1654 m2/gm2-libs-paranoid/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.c \
1655 m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h
1656 $(CC) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1657
1658 m2/gm2-libs-paranoid/errno.o: $(srcdir)/m2/gm2-libs-ch/errno.c \
1659 m2/gm2-libs-boot/$(SRC_PREFIX)errno.h
1660 $(CC) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1661
1662 m2/gm2-libs-paranoid/Selective.o: $(srcdir)/m2/gm2-libs-ch/Selective.c \
1663 m2/gm2-libs-boot/$(SRC_PREFIX)Selective.h
1664 $(COMPILER) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1665
1666 m2/gm2-libs-paranoid/choosetemp.o: $(srcdir)/m2/gm2-libs-ch/choosetemp.c \
1667 m2/gm2-libiberty/$(SRC_PREFIX)choosetemp.h
1668 $(CC) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty $(INCLUDES) $< -o $@
1669
1670 m2/gm2-libs-paranoid/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c \
1671 m2/gm2-libs-boot/$(SRC_PREFIX)SysExceptions.h
1672 $(CC) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
1673
1674 m2/gm2-compiler-paranoid/m2flex.o: m2/gm2-compiler/m2flex.c $(TIMEVAR_H)
1675 $(COMPILER) -c $(GM2_O_S3) -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1676 $(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
1677
1678 m2/gm2-libs-paranoid/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.c \
1679 m2/gm2-libs-boot/$(SRC_PREFIX)dtoa.h \
1680 m2/gm2-libs/gm2-libs-host.h
1681 $(CC) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
1682
1683 m2/gm2-libs-paranoid/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.c \
1684 m2/gm2-libs-boot/$(SRC_PREFIX)ldtoa.h \
1685 m2/gm2-libs/gm2-libs-host.h
1686 $(CC) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
1687
1688 m2/gm2-libs-paranoid/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c \
1689 m2/gm2-libs-boot/$(SRC_PREFIX)termios.h \
1690 m2/gm2-libs/gm2-libs-host.h
1691 $(CC) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
1692
1693
1694 # The rules which build the paranoid version of gm2.
1695
1696 BUILD-LIBS-PARANOID-H = $(GM2-LIBS-BOOT-DEFS:%.def=m2/gm2-libs-boot/$(SRC_PREFIX)%.h)
1697
1698 BUILD-LIBS-PARANOID = $(BUILD-LIBS-PARANOID-H) \
1699 $(GM2-LIBS-MODS:%.mod=m2/gm2-libs-paranoid/%.o) \
1700 $(GM2-LIBS-C:%.c=m2/gm2-libs-paranoid/%.o)
1701
1702 m2/gm2-libs-paranoid/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-PARANOID)
1703 $(AR) cr $@ $(GM2-LIBS-MODS:%.mod=m2/gm2-libs-paranoid/%.o) \
1704 $(GM2-LIBS-C:%.c=m2/gm2-libs-paranoid/%.o)
1705 $(RANLIB) $@
1706
1707 m2/gm2-compiler-paranoid/gm2.a: \
1708 $(GM2-COMP-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
1709 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
1710 m2/gm2-compiler-paranoid/M2Version.o \
1711 m2/gm2-compiler-paranoid/m2flex.o
1712 $(AR) cr $@ $(GM2-COMP-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
1713 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
1714 m2/gm2-compiler-paranoid/M2Version.o
1715 $(RANLIB) $@
1716
1717 m2/gm2-compiler-paranoid/M2Version.mod:
1718 sh $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler-paranoid
1719
1720 m2/gm2-compiler-paranoid/M2Version.o: m2/gm2-compiler-paranoid/M2Version.mod
1721 $(GM2_2) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc $< -o $@
1722
1723 # The linkage tools and general Modula-2 tools.
1724
1725 stage1/m2/gcc$(exeext): xgcc$(exeext)
1726 cp -p $< $@
1727
1728 stage1/m2/cc1$(exeext): cc1$(exeext)
1729 cp -p $< $@
1730
1731 stage1/m2/cpp$(exeext): cpp$(exeext)
1732 cp -p $< $@
1733
1734 stage1/m2/cc1plus$(exeext): cc1plus$(exeext)
1735 cp -p $< $@
1736
1737 stage1/m2/gm2l$(exeext): \
1738 m2/boot-bin/mklink$(exeext) m2/boot-bin/mc$(exeext) \
1739 m2/gm2-ici-boot/M2Emit.o \
1740 m2/gm2-libs-boot/libgm2.a m2/gm2-compiler-boot/gm2l.o \
1741 m2/gm2-ici/m2flex.o \
1742 $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS)
1743 unset CC ; $(M2LINK) -s --g++ --exit --name gm2l_init.c $(srcdir)/m2/init/gm2linit
1744 mv gm2l_init.c m2/gm2-compiler-boot/gm2l_init.c
1745 $(COMPILER) -c -g m2/gm2-compiler-boot/gm2l_init.c -o m2/gm2-compiler-boot/gm2l_init.o
1746 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1747 m2/gm2-compiler-boot/gm2l_init.o \
1748 m2/gm2-ici/m2flex.o \
1749 m2/gm2-ici-boot/M2Emit.o \
1750 m2/gm2-ici-boot/m2linemap.o \
1751 m2/gm2-compiler-boot/gm2l.o $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS) -lm
1752
1753 stage1/m2/gm2lcc$(exeext): \
1754 m2/boot-bin/mklink$(exeext) m2/boot-bin/mc$(exeext) \
1755 m2/gm2-ici-boot/M2Emit.o \
1756 m2/gm2-ici/m2flex.o \
1757 m2/gm2-ici-boot/m2linemap.o \
1758 m2/gm2-libs-boot/libgm2.a m2/gm2-compiler-boot/gm2lcc.o \
1759 $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS)
1760 unset CC ; $(M2LINK) -s --g++ --exit --name gm2lcc_init.c $(srcdir)/m2/init/gm2lccinit
1761 mv gm2lcc_init.c m2/gm2-compiler-boot/gm2lcc_init.c
1762 $(COMPILER) -c -g m2/gm2-compiler-boot/gm2lcc_init.c -o m2/gm2-compiler-boot/gm2lcc_init.o
1763 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1764 m2/gm2-compiler-boot/gm2lcc_init.o \
1765 m2/gm2-ici-boot/M2Emit.o \
1766 m2/gm2-ici/m2flex.o \
1767 m2/gm2-ici-boot/m2linemap.o \
1768 m2/gm2-compiler-boot/gm2lcc.o $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS) -lm
1769
1770 stage1/m2/gm2lgen$(exeext): \
1771 m2/boot-bin/mklink$(exeext) m2/boot-bin/mc$(exeext) \
1772 m2/gm2-ici-boot/M2Emit.o \
1773 m2/gm2-ici/m2flex.o \
1774 m2/gm2-ici-boot/m2linemap.o \
1775 m2/gm2-libs-boot/libgm2.a m2/gm2-compiler-boot/gm2lgen.o \
1776 $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS)
1777 unset CC ; $(M2LINK) -s --g++ --exit --name gm2lgen_init.c $(srcdir)/m2/init/gm2lgeninit
1778 mv gm2lgen_init.c m2/gm2-compiler-boot/gm2lgen_init.c
1779 $(COMPILER) -c -g m2/gm2-compiler-boot/gm2lgen_init.c -o m2/gm2-compiler-boot/gm2lgen_init.o
1780 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1781 m2/gm2-compiler-boot/gm2lgen_init.o \
1782 m2/gm2-ici-boot/M2Emit.o \
1783 m2/gm2-ici/m2flex.o \
1784 m2/gm2-ici-boot/m2linemap.o \
1785 m2/gm2-compiler-boot/gm2lgen.o $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS) -lm
1786
1787 stage1/m2/gm2lorder$(exeext): \
1788 m2/boot-bin/mklink$(exeext) m2/boot-bin/mc$(exeext) \
1789 m2/gm2-libs-boot/libgm2.a m2/gm2-compiler-boot/gm2lorder.o \
1790 m2/gm2-ici-boot/M2Emit.o \
1791 m2/gm2-ici/m2flex.o \
1792 m2/gm2-ici-boot/m2linemap.o \
1793 $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS)
1794 unset CC ; $(M2LINK) -s --g++ --exit --name gm2lorder_init.c $(srcdir)/m2/init/gm2lorderinit
1795 mv gm2lorder_init.c m2/gm2-compiler-boot/gm2lorder_init.c
1796 $(COMPILER) -c -g m2/gm2-compiler-boot/gm2lorder_init.c -o m2/gm2-compiler-boot/gm2lorder_init.o
1797 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1798 m2/gm2-compiler-boot/gm2lorder_init.o \
1799 m2/gm2-ici-boot/M2Emit.o \
1800 m2/gm2-ici/m2flex.o \
1801 m2/gm2-ici-boot/m2linemap.o \
1802 m2/gm2-compiler-boot/gm2lorder.o $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS) -lm
1803
1804 stage1/m2/gm2m$(exeext): \
1805 m2/boot-bin/mklink$(exeext) m2/boot-bin/mc$(exeext) \
1806 m2/gm2-libs-boot/libgm2.a m2/gm2-compiler-boot/gm2m.o \
1807 m2/gm2-ici-boot/M2Emit.o \
1808 m2/gm2-ici/m2flex.o \
1809 m2/gm2-ici-boot/m2linemap.o \
1810 $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS)
1811 unset CC ; $(M2LINK) -s --g++ --exit --name gm2m_init.c $(srcdir)/m2/init/gm2minit
1812 mv gm2m_init.c m2/gm2-compiler-boot/gm2m_init.c
1813 $(COMPILER) -c -g m2/gm2-compiler-boot/gm2m_init.c -o m2/gm2-compiler-boot/gm2m_init.o
1814 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1815 m2/gm2-compiler-boot/gm2m_init.o \
1816 m2/gm2-ici/m2flex.o \
1817 m2/gm2-ici-boot/m2linemap.o \
1818 m2/gm2-ici-boot/M2Emit.o \
1819 m2/gm2-compiler-boot/gm2m.o $(GCC_COLOR) $(GM2_LIBS_BOOT) $(MC_LIBS) $(LIBS) -lm
1820
1821 stage2/m2/gm2l$(exeext): $(GM2_LIBS) $(GM2_C_OBJS) $(GM2_LINK_TOOLS_BOOT) m2/gm2-compiler/gm2l.o
1822 grep -v mod_init $(srcdir)/m2/init/gm2linit > gm2l.lst
1823 $(GM2_1) -fuselist -fmodules -c -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler \
1824 -I../$(target_subdir)/libgm2/libm2pim/.libs/ \
1825 -g -B./ m2/gm2-compiler/gm2l.mod
1826 $(GM2_1) -v -Im2/gm2-libs -Im2/gm2-compiler \
1827 -I../$(target_subdir)/libgm2/libm2pim/.libs/ \
1828 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler -g -B./ -o $@ \
1829 -fuselist m2/gm2-compiler/gm2l.mod $(LIBS)
1830
1831 stage2/m2/gm2m$(exeext): $(GM2_LIBS) $(GM2_LINK_TOOLS_BOOT) \
1832 m2/gm2-compiler/gm2m.o m2/gm2-ici/m2flex.o \
1833 m2/gm2-libiberty/xlibc.o m2/gm2-gcc/m2color.o \
1834 diagnostic-color.o m2/gm2-libiberty/tool.o
1835 unset CC ; $(M2LINK) -s --g++ --exit --name mod_init.c $(srcdir)/m2/init/gm2minit
1836 mv mod_init.c m2/gm2-compiler/gm2m_init.c
1837 $(COMPILER) -c -g m2/gm2-compiler/gm2m_init.c -o m2/gm2-compiler/gm2m_init.o
1838 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
1839 m2/gm2-compiler/gm2m_init.o \
1840 m2/gm2-ici/m2flex.o \
1841 m2/gm2-compiler/gm2m.o $(GM2_LIBS) $(LIBS) \
1842 m2/gm2-libiberty/xlibc.o m2/gm2-gcc/m2color.o diagnostic-color.o m2/gm2-libiberty/tool.o -lm
1843
1844 stage2/m2/gm2lcc$(exeext): $(GM2_LIBS) $(GM2_LINK_TOOLS_BOOT) m2/gm2-compiler/gm2lcc.o
1845 grep -v mod_init $(srcdir)/m2/init/gm2lccinit > gm2lcc.lst
1846 $(GM2_1) -fuselist -fmodules -c -Im2/gm2-libs -Im2/gm2-compiler \
1847 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler \
1848 -g -B./ $(srcdir)/m2/gm2-compiler/gm2lcc.mod
1849 $(GM2_1) -Im2/gm2-libs -Im2/gm2-compiler \
1850 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler -g -B./stage1/gm2 -B./ -o $@ \
1851 -fuselist $(srcdir)/m2/gm2-compiler/gm2lcc.mod $(LIBS)
1852
1853 stage2/m2/gm2lgen$(exeext): $(GM2_LIBS) $(GM2_LINK_TOOLS_BOOT) m2/gm2-compiler/gm2lgen.o
1854 grep -v mod_init $(srcdir)/m2/init/gm2lgeninit > gm2lgen.lst
1855 $(GM2_1) -fuselist -fmodules -c -Im2/gm2-libs -Im2/gm2-compiler \
1856 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler \
1857 -g -B./ $(srcdir)/m2/gm2-compiler/gm2lgen.mod
1858 $(GM2_1) -Im2/gm2-libs -Im2/gm2-compiler \
1859 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler -g -B./ -o $@ \
1860 -fuselist $(srcdir)/m2/gm2-compiler/gm2lgen.mod $(LIBS)
1861
1862 stage2/m2/gm2lorder$(exeext): $(GM2_LIBS) $(GM2_LINK_TOOLS_BOOT) m2/gm2-compiler/gm2lorder.o
1863 grep -v mod_init $(srcdir)/m2/init/gm2lorderinit > gm2lorder.lst
1864 $(GM2_1) -fuselist -fmodules -c -Im2/gm2-libs -Im2/gm2-compiler \
1865 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler \
1866 -g -B./ $(srcdir)/m2/gm2-compiler/gm2lorder.mod
1867 $(GM2_1) -Im2/gm2-libs -Im2/gm2-compiler \
1868 -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-compiler -g -B./ -o $@ \
1869 -fuselist $(srcdir)/m2/gm2-compiler/gm2lorder.mod $(LIBS)
1870
1871 # m2/ppg$(exeext) is the bootstrap parser generator.
1872
1873 PPG-INTERFACE-C = libc.c mcrts.c UnixArgs.c Selective.c termios.c \
1874 SysExceptions.c ldtoa.c dtoa.c wrapc.c \
1875 SYSTEM.c errno.c
1876
1877 PPG-MODS = SymbolKey.mod NameKey.mod Lists.mod bnflex.mod Output.mod
1878
1879
1880 PPG-LIB-DEFS = ASCII.def Args.def Indexing.def FIO.def \
1881 StrIO.def StrLib.def M2RTS.def Indexing.def FIO.def SFIO.def \
1882 Storage.def Debug.def IO.def StdIO.def M2EXCEPTION.def \
1883 StrCase.def NumberIO.def Assertion.def PushBackInput.def \
1884 SysStorage.def DynamicStrings.def M2RTS.def RTExceptions.def
1885
1886 PPG-LIB-MODS = ASCII.mod Args.mod FIO.mod SFIO.mod StrIO.mod StrLib.mod \
1887 Indexing.mod Storage.mod Debug.mod IO.mod \
1888 StdIO.mod M2EXCEPTION.mod StrCase.mod NumberIO.mod \
1889 Assertion.mod PushBackInput.mod SysStorage.mod \
1890 DynamicStrings.mod M2RTS.mod RTExceptions.mod
1891
1892 PPG-SRC = ppg.mod
1893
1894 BUILD-PPG-O = $(PPG-INTERFACE-C:%.c=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
1895 $(PPG-MODS:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
1896 $(PPG-LIB-MODS:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
1897 $(PPG-SRC:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o)
1898
1899 MCC_ARGS= --olang=c \
1900 --quiet \
1901 --h-file-prefix=$(SRC_PREFIX) \
1902 -I$(srcdir)/m2/gm2-libs \
1903 -I$(srcdir)/m2/gm2-compiler \
1904 -I$(srcdir)/m2/gm2-libiberty \
1905 -I$(srcdir)/m2/gm2-gcc
1906
1907 MCC=m2/boot-bin/mc$(exeext) $(MCC_ARGS)
1908
1909 BUILD-PPG-LIBS-H = $(PPG-LIB-DEFS:%.def=m2/gm2-ppg-boot/$(SRC_PREFIX)%.h)
1910
1911 BUILD-PPG-H = m2/boot-bin/mc$(exeext) $(BUILD-PPG-LIBS-H)
1912
1913 m2/gm2-ppg-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
1914 $(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
1915
1916 m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h
1917 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
1918
1919 m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
1920 $(MCC) -o=m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
1921 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) \
1922 -Im2/gm2-ppg-boot -I$(srcdir)/m2/mc-boot \
1923 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c -o $@
1924
1925 m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
1926 $(MCC) -o=m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
1927 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) \
1928 -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
1929 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c -o $@
1930
1931 m2/ppg$(exeext): m2/boot-bin/mc $(BUILD-PPG-O) $(BUILD-MC-INTERFACE-O) m2/gm2-ppg-boot/main.o m2/gm2-libs-boot/RTcodummy.o
1932 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PPG-O) m2/gm2-ppg-boot/main.o m2/gm2-libs-boot/RTcodummy.o -lm
1933
1934 m2/gm2-ppg-boot/main.o: $(M2LINK) $(srcdir)/m2/init/mcinit
1935 unset CC ; $(M2LINK) -s --gcc --exit --name mainppginit.c $(srcdir)/m2/init/ppginit
1936 mv mainppginit.c m2/gm2-ppg-boot/main.c
1937 $(CC) -g -c -o $@ m2/gm2-ppg-boot/main.c
1938
1939 m2/gm2-auto:
1940 test -d $@ || mkdir -p $@
1941
1942 # m2/pg$(exext) is the 2nd generation parser generator built from ebnf
1943 # without error recovery
1944
1945 PG-SRC = pg.mod
1946
1947 BUILD-PG-O = $(PPG-INTERFACE-C:%.c=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
1948 $(PPG-MODS:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
1949 $(PPG-LIB-MODS:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
1950 $(PG-SRC:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o)
1951
1952 m2/gm2-pg-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
1953 $(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
1954
1955 m2/gm2-pg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h
1956 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
1957
1958 m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
1959 $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
1960 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pg-boot -I$(srcdir)/m2/mc-boot -I$(srcdir)/m2/mc-boot-ch \
1961 -g -c m2/gm2-pg-boot/$(SRC_PREFIX)$*.c -o $@
1962
1963 m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
1964 $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
1965 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
1966 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-pg-boot/$(SRC_PREFIX)$*.c -o $@
1967
1968 m2/gm2-pg-boot/$(SRC_PREFIX)pg.o: m2/gm2-auto/pg.mod $(MCDEPS) $(BUILD-BOOT-H)
1969 $(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)pg.c m2/gm2-auto/pg.mod
1970 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
1971 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-pg-boot/$(SRC_PREFIX)pg.c -o $@
1972
1973 m2/pg$(exeext): m2/boot-bin/mc \
1974 $(BUILD-PG-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pg-boot/%.o) \
1975 $(BUILD-MC-INTERFACE-O) m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o
1976 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PG-O) \
1977 m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o -lm
1978
1979 m2/gm2-auto/pginit:
1980 sed -e 's/ppg/pg/' < $(srcdir)/m2/init/ppginit > $@
1981
1982 m2/gm2-pg-boot/main.o: m2/gm2-auto/pginit $(M2LINK)
1983 unset CC ; $(M2LINK) -s --gcc --exit --name mainpginit.c m2/gm2-auto/pginit
1984 mv mainpginit.c m2/gm2-pg-boot/main.c
1985 $(CC) -g -c -o $@ m2/gm2-pg-boot/main.c
1986
1987 m2/pg-e$(exeext): m2/pg$(exeext)
1988 $(CP) m2/pg$(exeext) m2/pg-e$(exeext)
1989 sh $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pg -e > m2/gm2-auto/t.bnf
1990 ./m2/pg-e$(exeext) -e -l m2/gm2-auto/t.bnf | sed -e 's/t\.bnf/pg\.bnf/' > m2/gm2-auto/t.mod
1991 $(QUIAT)if ! diff m2/gm2-auto/t.mod m2/gm2-auto/pg.mod > /dev/null ; then \
1992 echo "pg failed during self build" ; \
1993 exit 1 ; \
1994 fi
1995 $(RM) m2/gm2-auto/t.bnf m2/gm2-auto/t.mod
1996
1997 m2/gm2-auto/pg.mod: m2/ppg$(exeext)
1998 sh $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pg -e > m2/gm2-auto/pg.bnf
1999 ./m2/ppg$(exeext) -e -l m2/gm2-auto/pg.bnf > m2/gm2-auto/pg.mod
2000
2001 #
2002 #
2003 #
2004
2005 PGE-SRC = pge.mod
2006
2007 BUILD-PGE-O = $(PPG-INTERFACE-C:%.c=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
2008 $(PPG-MODS:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
2009 $(PPG-LIB-MODS:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
2010 $(PGE-SRC:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o)
2011
2012 m2/gm2-auto/pge.mod: m2/pg$(exeext)
2013 sh $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pge > m2/gm2-auto/pge.bnf
2014 ./m2/pg$(exeext) -l m2/gm2-auto/pge.bnf -o m2/gm2-auto/pge.mod
2015
2016 m2/gm2-pge-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
2017 $(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
2018
2019 m2/gm2-pge-boot/$(SRC_PREFIX)libc.o: $(srcdir)/m2/mc-boot-ch/Glibc.c m2/gm2-libs/gm2-libs-host.h
2020 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2021
2022 m2/gm2-pge-boot/$(SRC_PREFIX)mcrts.o: $(srcdir)/m2/mc-boot-ch/Gmcrts.c m2/gm2-libs/gm2-libs-host.h
2023 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2024
2025 m2/gm2-pge-boot/$(SRC_PREFIX)UnixArgs.o: $(srcdir)/m2/mc-boot-ch/GUnixArgs.c
2026 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -g -c $< -o $@
2027
2028 m2/gm2-pge-boot/$(SRC_PREFIX)Selective.o: $(srcdir)/m2/mc-boot-ch/GSelective.c m2/gm2-libs/gm2-libs-host.h
2029 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2030
2031 m2/gm2-pge-boot/$(SRC_PREFIX)termios.o: $(srcdir)/m2/mc-boot-ch/Gtermios.c m2/gm2-libs/gm2-libs-host.h
2032 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2033
2034 m2/gm2-pge-boot/$(SRC_PREFIX)SysExceptions.o: $(srcdir)/m2/mc-boot-ch/GSysExceptions.c m2/gm2-libs/gm2-libs-host.h
2035 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2036
2037 m2/gm2-pge-boot/$(SRC_PREFIX)ldtoa.o: $(srcdir)/m2/mc-boot-ch/Gldtoa.c m2/gm2-libs/gm2-libs-host.h
2038 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2039
2040 m2/gm2-pge-boot/$(SRC_PREFIX)dtoa.o: $(srcdir)/m2/mc-boot-ch/Gdtoa.c m2/gm2-libs/gm2-libs-host.h
2041 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2042
2043 m2/gm2-pge-boot/$(SRC_PREFIX)wrapc.o: $(srcdir)/m2/mc-boot-ch/Gwrapc.c m2/gm2-libs/gm2-libs-host.h
2044 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
2045
2046 m2/gm2-pge-boot/$(SRC_PREFIX)SYSTEM.o: $(srcdir)/m2/mc-boot-ch/GSYSTEM.c
2047 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -g -c $< -o $@
2048
2049 m2/gm2-pge-boot/$(SRC_PREFIX)errno.o: $(srcdir)/m2/mc-boot-ch/Gerrno.c
2050 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -g -c $< -o $@
2051
2052 m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
2053 $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
2054 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pge-boot -I$(srcdir)/m2/mc-boot \
2055 -I$(srcdir)/m2/mc-boot-ch \
2056 -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@
2057
2058 m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
2059 $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
2060 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot \
2061 -Im2/gm2-libs-boot \
2062 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@
2063
2064 m2/gm2-pge-boot/$(SRC_PREFIX)pge.o: m2/gm2-auto/pge.mod $(MCDEPS) $(BUILD-BOOT-H)
2065 $(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)pge.c m2/gm2-auto/pge.mod
2066 $(CC) -I. -I$(srcdir)/../include -I$(srcdir) \
2067 -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
2068 -I$(srcdir)/m2/mc-boot-ch -g -c m2/gm2-pge-boot/$(SRC_PREFIX)pge.c -o $@
2069
2070 m2/pge$(exeext): m2/boot-bin/mc \
2071 $(BUILD-PGE-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pge-boot/%.o) \
2072 $(BUILD-MC-INTERFACE-O) m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o
2073 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PGE-O) \
2074 m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o -lm
2075 sh $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod t > m2/gm2-auto/t.bnf
2076 ./m2/pge$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t1.mod
2077 ./m2/pg$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t2.mod
2078 $(QUIAT)if ! diff m2/gm2-auto/t1.mod m2/gm2-auto/t2.mod > /dev/null ; then \
2079 echo "failure: pg (with error recovery) failed" ; \
2080 $(RM) m2/pge$(exeext) ; \
2081 exit 1 ; \
2082 fi
2083 $(RM) m2/gm2-auto/t.mod m2/gm2-auto/t1.mod m2/gm2-auto/t2.mod
2084
2085 m2/gm2-auto/pgeinit:
2086 sed -e 's/ppg/pge/' < $(srcdir)/m2/init/ppginit > $@
2087
2088 m2/gm2-pge-boot/main.o: m2/gm2-auto/pgeinit $(M2LINK)
2089 unset CC ; $(M2LINK) -s --gcc --exit --name mainpgeinit.c m2/gm2-auto/pgeinit
2090 mv mainpgeinit.c m2/gm2-pge-boot/main.c
2091 $(CC) -g -c -o $@ m2/gm2-pge-boot/main.c
2092
2093 $(objdir)/m2/gm2-compiler-paranoid/P0SyntaxCheck.mod: $(srcdir)/m2/bnf/m2.bnf m2/pge$(exeext)
2094 ./m2/pge$(exeext) -k -l $< -o $@
2095
2096 $(objdir)/m2/gm2-compiler-paranoid/P1Build.mod: $(srcdir)/m2/bnf/m2-1.bnf m2/pge$(exeext)
2097 ./m2/pge$(exeext) -k $< -o $@
2098
2099 $(objdir)/m2/gm2-compiler-paranoid/P2Build.mod: $(srcdir)/m2/bnf/m2-2.bnf m2/pge$(exeext)
2100 ./m2/pge$(exeext) -k $< -o $@
2101
2102 $(objdir)/m2/gm2-compiler-paranoid/PCBuild.mod: $(srcdir)/m2/bnf/m2-c.bnf m2/pge$(exeext)
2103 ./m2/pge$(exeext) -k -l $< -o $@
2104
2105 $(objdir)/m2/gm2-compiler-paranoid/P3Build.mod: $(srcdir)/m2/bnf/m2-3.bnf m2/pge$(exeext)
2106 ./m2/pge$(exeext) -k $< -o $@
2107
2108 $(objdir)/m2/gm2-compiler-paranoid/PHBuild.mod: $(srcdir)/m2/bnf/m2-h.bnf m2/pge$(exeext)
2109 ./m2/pge$(exeext) -k $< -o $@
2110
2111 $(objdir)/m2/gm2-compiler-paranoid/gm2l.mod: $(srcdir)/m2/bnf/gm2l.bnf m2/pge$(exeext)
2112 ./m2/pge$(exeext) $< -o $@
2113
2114 $(objdir)/m2/gm2-compiler-paranoid/gm2m.mod: $(srcdir)/m2/bnf/gm2m.bnf m2/pge$(exeext)
2115 ./m2/pge$(exeext) $< -o $@
2116
2117 $(objdir)/m2/gm2-compiler/P0SyntaxCheck.mod: $(srcdir)/m2/bnf/m2.bnf m2/pge$(exeext)
2118 ./m2/pge$(exeext) -k -l $< -o $@
2119
2120 $(objdir)/m2/gm2-compiler/P1Build.mod: $(srcdir)/m2/bnf/m2-1.bnf m2/pge$(exeext)
2121 ./m2/pge$(exeext) -k $< -o $@
2122
2123 $(objdir)/m2/gm2-compiler/P2Build.mod: $(srcdir)/m2/bnf/m2-2.bnf m2/pge$(exeext)
2124 ./m2/pge$(exeext) -k $< -o $@
2125
2126 $(objdir)/m2/gm2-compiler/PCBuild.mod: $(srcdir)/m2/bnf/m2-c.bnf m2/pge$(exeext)
2127 ./m2/pge$(exeext) -k -l $< -o $@
2128
2129 $(objdir)/m2/gm2-compiler/P3Build.mod: $(srcdir)/m2/bnf/m2-3.bnf m2/pge$(exeext)
2130 ./m2/pge$(exeext) -k $< -o $@
2131
2132 $(objdir)/m2/gm2-compiler/PHBuild.mod: $(srcdir)/m2/bnf/m2-h.bnf m2/pge$(exeext)
2133 ./m2/pge$(exeext) -k $< -o $@
2134
2135 $(objdir)/m2/gm2-compiler/gm2l.mod: $(srcdir)/m2/bnf/gm2l.bnf m2/pge$(exeext)
2136 ./m2/pge$(exeext) $< -o $@
2137
2138 $(objdir)/m2/gm2-compiler/gm2m.mod: $(srcdir)/m2/bnf/gm2m.bnf m2/pge$(exeext)
2139 ./m2/pge$(exeext) $< -o $@
2140
2141 $(objdir)/m2/gm2-compiler-boot/P0SyntaxCheck.mod: $(srcdir)/m2/bnf/m2.bnf m2/pge$(exeext)
2142 ./m2/pge$(exeext) -k -l $< -o $@
2143
2144 $(objdir)/m2/gm2-compiler-boot/P1Build.mod: $(srcdir)/m2/bnf/m2-1.bnf m2/pge$(exeext)
2145 ./m2/pge$(exeext) -k $< -o $@
2146
2147 $(objdir)/m2/gm2-compiler-boot/P2Build.mod: $(srcdir)/m2/bnf/m2-2.bnf m2/pge$(exeext)
2148 ./m2/pge$(exeext) -k $< -o $@
2149
2150 $(objdir)/m2/gm2-compiler-boot/PCBuild.mod: $(srcdir)/m2/bnf/m2-c.bnf m2/pge$(exeext)
2151 ./m2/pge$(exeext) -k -l $< -o $@
2152
2153 $(objdir)/m2/gm2-compiler-boot/P3Build.mod: $(srcdir)/m2/bnf/m2-3.bnf m2/pge$(exeext)
2154 ./m2/pge$(exeext) -k $< -o $@
2155
2156 $(objdir)/m2/gm2-compiler-boot/PHBuild.mod: $(srcdir)/m2/bnf/m2-h.bnf m2/pge$(exeext)
2157 ./m2/pge$(exeext) -k $< -o $@
2158
2159 $(objdir)/m2/gm2-compiler-boot/gm2l.mod: $(srcdir)/m2/bnf/gm2l.bnf m2/pge$(exeext)
2160 ./m2/pge$(exeext) $< -o $@
2161
2162 $(objdir)/m2/gm2-compiler-boot/gm2m.mod: $(srcdir)/m2/bnf/gm2m.bnf m2/pge$(exeext)
2163 ./m2/pge$(exeext) $< -o $@
2164
2165
2166 # gm2.verifyparanoid diffs the output of all three compilers with the compiler source code
2167
2168 gm2.verifyparanoid: stage1/m2/cc1gm2$(exeext) stage2/m2/cc1gm2$(exeext) stage3/m2/cc1gm2$(exeext) force
2169 @echo "verifying the three generations of GNU Modula-2 compilers - it may take some time.."
2170 $(QUIAT)for i in $(GM2-VERIFY-MODS) ; do \
2171 echo -n "$$i " ; \
2172 ./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/1.s ; \
2173 echo -n "[1]" ; \
2174 ./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/2.s ; \
2175 echo -n "[2]" ; \
2176 ./gm2 -S $(GM2_FLAGS) -c -B./stage3/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/3.s ; \
2177 echo -n "[3]" ; \
2178 if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
2179 echo -n " [stage 1 and stage 2 differ]" ; \
2180 cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
2181 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2182 echo " " ; \
2183 exit 1 ; \
2184 fi ; \
2185 if ! diff m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s > m2/gm2-compiler-verify/2_3.diff 2>&1 ; then \
2186 echo -n " [stage 2 and stage 3 differ]" ; \
2187 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2188 cp m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.3.lst ; \
2189 fi ; \
2190 echo " " ; \
2191 done
2192 $(QUIAT)echo "now verifying automatically built modules"
2193 $(QUIAT)for i in x $(GM2-VERIFY-AUTO) ; do \
2194 if [ -f m2/gm2-auto/$$i ] ; then \
2195 echo -n "$$i " ; \
2196 ./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/1.s ; \
2197 echo -n "[1]" ; \
2198 ./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/2.s ; \
2199 echo -n "[2]" ; \
2200 ./gm2 -S $(GM2_FLAGS) -c -B./stage3/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/3.s ; \
2201 echo -n "[3]" ; \
2202 if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
2203 echo -n " [stage 1 and stage 2 differ]" ; \
2204 cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
2205 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2206 echo " " ; \
2207 exit 1 ; \
2208 fi ; \
2209 if ! diff m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s > m2/gm2-compiler-verify/2_3.diff 2>&1 ; then \
2210 echo -n " [stage 2 and stage 3 differ]" ; \
2211 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2212 cp m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.3.lst ; \
2213 fi ; \
2214 echo " " ; \
2215 fi ; \
2216 done ; \
2217 $(RM) -f m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/2_3.diff m2/gm2-compiler-verify/1_2.diff
2218
2219
2220 # gm2.verifystage12 diffs the output of the stage1 and stage2 compilers with the compiler source code
2221
2222 gm2.verifystage12: force stage1/m2/cc1gm2$(exeext) stage2/m2/cc1gm2$(exeext)
2223 @echo "verifying stage1 and stage2 generations of GNU Modula-2 compilers - it may take some time.."
2224 $(QUIAT)for i in $(GM2-VERIFY-MODS) ; do \
2225 echo -n "$$i " ; \
2226 ./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/1.s ; \
2227 echo -n "[1]" ; \
2228 ./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/2.s ; \
2229 echo -n "[2]" ; \
2230 if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
2231 echo -n " [stage 1 and stage 2 differ]" ; \
2232 cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
2233 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2234 echo " " ; \
2235 fi ; \
2236 echo " " ; \
2237 done
2238 $(QUIAT)echo "now verifying automatically built modules"
2239 $(QUIAT)for i in x $(GM2-VERIFY-AUTO) ; do \
2240 if [ -f m2/gm2-auto/$$i ] ; then \
2241 echo -n "$$i " ; \
2242 ./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/1.s ; \
2243 echo -n "[1]" ; \
2244 ./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/2.s ; \
2245 echo -n "[2]" ; \
2246 if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
2247 echo -n " [stage 1 and stage 2 differ]" ; \
2248 cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
2249 cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
2250 echo " " ; \
2251 fi ; \
2252 echo " " ; \
2253 fi ; \
2254 done ; \
2255 $(RM) -f m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/2_3.diff m2/gm2-compiler-verify/1_2.diff
2256
2257 check-m2: check-gm2
2258 check_m2: check-gm2
2259 check_gm2: check-gm2
2260 check-modula2: check-gm2
2261 check_modula2: check-gm2
2262 check-modula-2: check-gm2
2263 check_modula-2: check-gm2
2264
2265 lang_checks += check-gm2
2266 lang_checks_parallelized += check-gm2
2267 # For description see the check_$lang_parallelize comment in gcc/Makefile.in.
2268 check_gm2_parallelize = 10000
2269
2270 check-gm2-local: $(GM2TESTSUITEDIR)/site.exp
2271 -(rootme=`${PWD_COMMAND}`; export rootme; \
2272 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
2273 cd $(TESTSUITEDIR); \
2274 EXPECT=${EXPECT} ; export EXPECT ; \
2275 if [ -f $${rootme}/../expect/expect ] ; then \
2276 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
2277 export TCL_LIBRARY ; fi ; \
2278 $(RUNTEST) --tool gm2 --directory testsuite/m2/pim/pass)
2279
2280 gm2-check-examples: force
2281 allok="yes" ; \
2282 for i in examples/hello examples/gravity/ \
2283 examples/cplusplus/cppcatchm2 examples/cplusplus/m2catchcpp \
2284 examples/callingC examples/iso/socket examples/swig/exceptions \
2285 examples/swig/tiny examples/swig/strlib \
2286 examples/cpp examples/map examples/ncurses ; do \
2287 ( testdir=`pwd` ; cd m2/$${i} ; if make clean pre-install >& $${testdir}/log ; \
2288 then echo "passed m2/$${i}" ; \
2289 else echo "failed m2/$${i}" ; allok="no" ; \
2290 fi ) ; \
2291 done ; \
2292 if [ "$${allok}" == "yes" ] ; then \
2293 echo "all examples passed" ; \
2294 else \
2295 echo "some example(s) failed" ; \
2296 fi
2297
2298 gm2.maintainer-reconfigure: force
2299 autoconf $(srcdir)/m2/gm2-libs/config-host.in > $(srcdir)/m2/gm2-libs/config-host
2300 ( cd $(srcdir)/m2/gm2-libs ; autoheader config-host.in )
2301 ( cd $(srcdir)/m2 ; autoconf configure.in > configure )
2302
2303 gm2.maintainer-clean: force
2304 -rm -f $(srcdir)/m2/gm2-auto/*
2305 -rm -f $(srcdir)/m2/gm2-libs.texi
2306 -rm -f $(srcdir)/m2/gm2-ebnf.texi
2307 -rm -f $(srcdir)/m2/images/gnu.eps
2308
2309 gm2.maintainer-help: force
2310 @echo "make knows about:"
2311 @echo " "
2312 @echo "make gm2.maintainer-help this command"
2313 @echo "make gm2.maintainer-reconfigure rebuild the configure scripts"
2314 @echo "make gm2.maintainer-clean clean pre-built images and texi files"
This page took 0.154279 seconds and 5 git commands to generate.