Richard Biener <richard.guent...@gmail.com> writes: >> +M2_MAINTAINER = no >> + >> +CPP_GM2=-fpermissive -DIN_GCC -g > > Do we really need -fpermissive here?
no not needed (and now removed) - thanks for spotting it. >> +GM2_1 = ./gm2 -B./stage1/m2 -g -fm2-g >> + >> +GM2_FOR_TARGET = $(STAGE_CC_WRAPPER) ./gm2 -B./ -B$(build_tooldir)/bin/ >> -L$(objdir)/../ld $(TFLAGS) >> + >> +TEXISRC = $(objdir)/m2/images/gnu.eps \ >> + $(srcdir)/doc/gm2.texi \ >> + m2/gm2-libs.texi \ >> + m2/gm2-ebnf.texi \ >> + m2/SYSTEM-pim.texi \ >> + m2/SYSTEM-iso.texi \ >> + m2/Builtins.texi >> + > > That will need Sphinx treatment true >> +# Define the names for selecting modula-2 in LANGUAGES. snip >> +m2.info: doc/m2.info >> + >> +m2.man: doc/m2.1 >> + >> +m2.install-man: $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext) >> + >> +$(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext): doc/m2.1 installdirs >> + -rm -f $@ >> + -$(INSTALL_DATA) $< $@ >> + -chmod a-x $@ >> + >> +m2.dvi: $(TEXISRC) >> + $(TEXI2DVI) -I $(objdir)/m2 -I $(srcdir)/doc/include >> $(srcdir)/doc/gm2.texi -o $@ >> + >> +m2.ps: m2.dvi >> + dvips -o $@ $< >> + >> +m2.pdf: m2.ps >> + gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $< >> + >> +.INTERMEDIATE: gm2.pod >> + >> +m2.pod: doc/gm2.texi $(TEXISRC) >> + -$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@ > > Likewise for the doc parts above and below yes, sure I'll convert them >> +doc/m2.info: $(TEXISRC) >> + if test "x$(BUILD_INFO)" = xinfo; then \ >> + rm -f doc/m2.info*; \ >> + $(MAKEINFO) --no-headers -I$(objdir)/m2 -I$(srcdir)/doc/include \ >> + -o $@ $(srcdir)/doc/gm2.texi ; \ >> + else true; fi >> + >> +$(objdir)/m2/images/gnu.eps: $(srcdir)/m2/images/gnupng >> + test -d m2/images || mkdir -p m2/images >> + if [ -f $(srcdir)/m2/images/gnu.eps ] ; then \ >> + cp $(srcdir)/m2/images/gnu.eps $@ ; \ >> + else \ >> + pngtopnm $< | pnmtops -noturn > $@ ; \ >> + fi >> + >> +m2/gm2-libs.texi: gm2-libs.texi-check; @true >> + >> +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 >> + python3 $(srcdir)/m2/tools-src/def2texi.py -uLibraries >> -s$(srcdir)/m2 -b$(objdir)/m2 > $(objdir)/m2/gm2-libs.texi >> + $(STAMP) gm2-libs.texi-check >> + >> +m2/gm2-ebnf.texi: gm2-ebnf.texi-check; @true >> + >> +gm2-ebnf.texi-check: $(PGE) $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf >> + $(PGE) -c -p -t -f $(srcdir)/m2/gm2-compiler/P0SyntaxCheck.bnf > >> m2/gm2-ebnf.texi >> + $(STAMP) gm2-ebnf.texi-check >> + >> +m2/SYSTEM-pim.texi: SYSTEM-pim-texi-check; @true >> + >> +SYSTEM-pim-texi-check: $(objdir)/m2/gm2-libs/SYSTEM.def >> + python3 $(srcdir)/m2/tools-src/def2texi.py -b$(objdir)/m2 >> -f$(objdir)/m2/gm2-libs/SYSTEM.def > $(objdir)/m2/SYSTEM-pim.texi >> + $(STAMP) SYSTEM-pim-texi-check >> + >> +m2/SYSTEM-iso.texi: SYSTEM-iso.texi-check; @true >> + >> +SYSTEM-iso.texi-check: $(objdir)/m2/gm2-libs-iso/SYSTEM.def >> + python3 $(srcdir)/m2/tools-src/def2texi.py -b$(objdir)/m2 >> -f$(objdir)/m2/gm2-libs-iso/SYSTEM.def > $(objdir)/m2/SYSTEM-iso.texi >> + $(STAMP) SYSTEM-iso.texi-check >> + >> +m2/Builtins.texi: Builtins.texi-check; @true >> + >> +Builtins.texi-check: m2/gm2-libs/Builtins.def >> + python3 $(srcdir)/m2/tools-src/def2texi.py -b./ >> -f$(srcdir)/m2/gm2-libs/Builtins.def > $(objdir)/m2/Builtins.texi >> + $(STAMP) Builtins.texi-check snip >> +gm2.paranoid: stage3/m2/cc1gm2$(exeext) gm2.verifyparanoid >> + >> +cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) $(m2.prev) >> + cp -p $< $@ >> + >> +stage3/m2/cc1gm2$(exeext): stage2/m2/cc1gm2$(exeext) >> m2/gm2-compiler-paranoid/m2flex.o \ >> + $(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) >> $(GM2_LIBS_PARANOID) \ >> + m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so >> + @$(call LINK_PROGRESS,$(INDEX.m2),start) >> + +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) >> m2/gm2-compiler-paranoid/m2flex.o \ >> + attribs.o \ >> + $(GM2_LIBS_PARANOID) \ >> + $(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o \ >> + $(BACKENDLIBS) $(LIBSTDCXX) -lm >> + @$(call LINK_PROGRESS,$(INDEX.m2),end) >> + >> +stage2/m2/cc1gm2$(exeext): stage1/m2/cc1gm2$(exeext) >> m2/gm2-compiler/m2flex.o $(P) \ >> + $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) >> \ >> + m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so >> + @$(call LINK_PROGRESS,$(INDEX.m2),start) >> + +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) >> m2/gm2-compiler/m2flex.o \ >> + attribs.o \ >> + $(GM2_LIBS) \ >> + $(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o \ >> + $(BACKENDLIBS) $(LIBSTDCXX) -lm >> + @$(call LINK_PROGRESS,$(INDEX.m2),end) >> + >> +stage1/m2/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \ >> + $(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \ >> + $(GM2_LIBS_BOOT) $(MC_LIBS) \ >> + m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so \ >> + m2/gm2-libs-boot/M2LINK.o \ >> + $(m2.prev) >> + @$(call LINK_PROGRESS,$(INDEX.m2),start) >> + +$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) >> m2/gm2-compiler-boot/m2flex.o \ >> + attribs.o \ >> + $(GM2_LIBS_BOOT) $(MC_LIBS) \ >> + m2/gm2-gcc/rtegraph.o >> m2/gm2-libs-boot/M2LINK.o \ >> + $(BACKEND) $(LIBS) $(BACKENDLIBS) >> + @$(call LINK_PROGRESS,$(INDEX.m2),end) > > It looks like you are employing your own bootstrapping scheme here? > In theory one could > use --enable-stage1-languages=m2 and the stage1 built compiler could > be used to shorten the above for stage2 and stage3? ah yes this would work and likely reduce the number of rules. > Likewise it might be feasible to provide a --with-system-gm2? sure I will look into this > Anyway, I can't spot any obvious issues in this file (but it's large). I think it might also be shortened by changing the bootstrap tool mc to only use generic rules (and avoid using the --extended-opaque specific rules) > I think exposing this to a wider audience > earlier is most important at this point. > > Thus OK. great news thanks! regards, Gaius