Rewrite many of the build rules to use order-only dependancies when
encountering generated sources.  The generated sources should not be
regenerated if header files (such as command line option headers) are
rebuilt.

gcc/m2/ChangeLog:

        PR modula2/126847
        * Make-lang.in (TEXILIBSRC): New define.
        (m2/stage1/cc1gm2$(exeext)): Rewrite.
        (m2/gm2-gcc/$(SRC_PREFIX)%.h): Add order-only dependancy.
        (m2/gm2-libs-boot/M2RTS.o): Ditto.
        (m2/gm2-libs-boot/%.o): Ditto.
        (m2/gm2-libs-boot/$(SRC_PREFIX)%.h): Ditto.
        (m2/gm2-libs-boot/RTintdummy.o): Ditto.
        (m2/gm2-libs-boot/wrapc.o): Ditto.
        (m2/gm2-libs-boot/UnixArgs.o): Ditto.
        (m2/gm2-libs-boot/choosetemp.o): Ditto.
        (m2/gm2-libs-boot/errno.o): Ditto.
        (m2/gm2-libs-boot/dtoa.o): Ditto.
        (m2/gm2-libs-boot/ldtoa.o): Ditto.
        (m2/gm2-libs-boot/termios.o): Ditto.
        (m2/gm2-libs-boot/SysExceptions.o): Ditto.
        (m2/gm2-libs-boot/SysStorage.o): Ditto.
        (m2/gm2-libs-boot/Selective.o): Ditto.
        (m2/gm2-compiler-boot/M2GCCDeclare.o): Ditto.
        (m2/gm2-compiler-boot/M2Error.o): Ditto.
        (m2/gm2-compiler-boot/%.o): Ditto.
        (m2/gm2-compiler-boot/$(SRC_PREFIX)%.h): Ditto.
        (m2/gm2-compiler-boot/P0SyntaxCheck.c): Ditto.
        (m2/gm2-compiler-boot/P0SyntaxCheck.o): Ditto.
        (m2/gm2-compiler-boot/P1Build.c): Ditto.
        (m2/gm2-compiler-boot/P1Build.o): Ditto.
        (m2/gm2-compiler-boot/P2Build.c): Ditto.
        (m2/gm2-compiler-boot/P2Build.o): Ditto.
        (m2/gm2-compiler-boot/P3Build.c): Ditto.
        (m2/gm2-compiler-boot/P3Build.o): Ditto.
        (m2/gm2-compiler-boot/PCBuild.c): Ditto.
        (m2/gm2-compiler-boot/PCBuild.o): Ditto.
        (m2/gm2-compiler-boot/PHBuild.c): Ditto.
        (m2/gm2-compiler-boot/PHBuild.o): Ditto.
        (m2/gm2-compiler-boot/m2flex.o): Ditto.
        (m2/gm2-libiberty/$(SRC_PREFIX)%.h): Ditto.
        (m2/gm2-compiler/%.o): Ditto.
        (m2/gm2-compiler/m2flex.o): Ditto.
        (m2/gm2-libs/choosetemp.o): Ditto.
        (m2/gm2-libs-boot/libgm2.a): Ditto.
        (m2/gm2-compiler-boot/gm2.a): Ditto.

Signed-off-by: Gaius Mulley <[email protected]>
---
 gcc/m2/Make-lang.in | 109 +++++++++++++++++++++++++-------------------
 1 file changed, 61 insertions(+), 48 deletions(-)

diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index d5635a7cdfa..d7a27d3422c 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -49,14 +49,15 @@ else
   PLUGINLDFLAGS += -lc
 endif
 
-TEXISRC = $(srcdir)/doc/gm2.texi \
-          m2/gm2-libs.texi \
+TEXILIBSRC = m2/gm2-libs.texi \
           m2/gm2-ebnf.texi \
           m2/SYSTEM-pim.texi \
           m2/SYSTEM-iso.texi \
           m2/Builtins.texi \
           m2/gpl_v3_without_node.texi
 
+TEXISRC = $(srcdir)/doc/gm2.texi
+
 # Define the names for selecting modula-2 in LANGUAGES.
 m2 modula-2 modula2: gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) $(GCC_PASSES)
 m2.serial = cc1gm2$(exeext)
@@ -85,6 +86,7 @@ m2.srcman: doc/gm2.1
 
 # Tell GNU make to ignore these if they exist.
 .PHONY: m2 modula-2 modula2
+.SECONDARY: $(TEXILIBSRC) m2/gm2-compiler/m2flex.c 
m2/gm2-compiler-boot/m2flex.o m2/gm2-compiler/m2flex.o
 
 GM2_PROG_DEP=gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext)
 
@@ -151,7 +153,7 @@ $(DESTDIR)$(man1dir)/$(GM2_INSTALL_NAME)$(man1ext): 
doc/m2.1 installdirs
 
 m2.dvi: doc/m2.dvi
 
-doc/m2.dvi: $(TEXISRC) $(objdir)/m2/images/gnu.eps
+doc/m2.dvi: $(objdir)/m2/images/gnu.eps
        $(TEXI2DVI) -c -I $(objdir)/m2 -I $(srcdir)/doc/include -o $@ 
$(srcdir)/doc/gm2.texi
 
 M2_DVIFILES = doc/m2.dvi
@@ -171,7 +173,7 @@ doc/m2.ps: doc/m2.dvi
 
 m2.pdf: doc/m2.pdf
 
-doc/m2.pdf: $(TEXISRC) $(objdir)/m2/images/gnu.eps
+doc/m2.pdf: $(TEXISRC) | $(objdir)/m2/images/gnu.eps $(TEXILIBSRC)
        $(TEXI2PDF) -I $(objdir)/m2 -I $(srcdir)/doc/include \
           $(srcdir)/doc/gm2.texi -o $@
 
@@ -189,10 +191,10 @@ m2.install-pdf: $(M2_PDFFILES)
 
 .INTERMEDIATE: m2.pod
 
-m2.pod: $(TEXISRC) $(objdir)/m2/images/gnu.eps
+m2.pod: $(TEXISRC) | $(objdir)/m2/images/gnu.eps $(TEXILIBSRC)
        -$(TEXI2POD) -I $(objdir)/m2 -D m2 < $< > $@
 
-doc/m2.info: $(TEXISRC) $(objdir)/m2/images/gnu.eps
+doc/m2.info: $(TEXISRC) | $(objdir)/m2/images/gnu.eps $(TEXILIBSRC)
        if test "x$(BUILD_INFO)" = xinfo; then \
          rm -f doc/m2.info*; \
           $(MAKEINFO) -I$(objdir)/m2 -I$(srcdir)/doc/include \
@@ -205,7 +207,7 @@ $(objdir)/m2/images/gnu.eps: $(srcdir)/m2/images/gnupng
 
 m2.html: $(build_htmldir)/m2/index.html
 
-$(build_htmldir)/m2/index.html: $(TEXISRC) $(objdir)/m2/images/gnu.eps
+$(build_htmldir)/m2/index.html: $(TEXISRC) | $(objdir)/m2/images/gnu.eps 
$(TEXILIBSRC)
        $(mkinstalldirs) $(@D)
        rm -f $(@D)/*
        $(TEXI2HTML) -I $(objdir)/m2 -I $(srcdir)/m2 -I $(gcc_docdir)/include 
-o $(@D) $<
@@ -269,7 +271,7 @@ endif
 
 # SYSTEM-iso.texi
 
-m2/SYSTEM-iso.texi:  SYSTEM-iso.texi-check; @true
+m2/SYSTEM-iso.texi: SYSTEM-iso.texi-check; @true
 
 ifeq ($(HAVE_PYTHON),yes)
 SYSTEM-iso.texi-check:  m2/gm2-libs-iso-common/SYSTEM.def
@@ -530,9 +532,20 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) 
m2/gm2-compiler/m2flex.o \
                               $(BACKENDLIBS) $(LIBSTDCXX) -lm
        @$(call LINK_PROGRESS,$(INDEX.m2),end)
 
-m2/stage1/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \
-                            $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \
-                            $(GM2_LIBS_BOOT) $(MC_LIBS) \
+
+# The objects contained in GM2_SRC_GEN_OBJ should not be rebuilt if the headers
+# or sources change as they are automatically generated.  For this reason
+# they are built using order-only dependancies so not to rebuild on
+# make/make install.
+
+GM2_SRC_GEN_OBJ=m2/gm2-compiler-boot/gm2.a \
+                 m2/gm2-libs-boot/libgm2.a \
+                 m2/gm2-compiler-boot/m2flex.o
+
+m2/stage1/cc1gm2$(exeext): gm2 $(GM2_SRC_GEN_OBJ) $(GM2-BOOT-O) \
+                            $(GM2_C_OBJS) \
+                            $(MC_LIBS) \
+                            $(BACKEND) $(LIBDEPS) \
                             m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) \
                             $(m2.prev)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
@@ -583,7 +596,7 @@ m2/gm2-gcc/rtegraph.o: $(srcdir)/m2/gm2-gcc/rtegraph.cc 
$(GCC_HEADER_DEPENDENCIE
             $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
        $(POSTCOMPILE)
 
-m2/gm2-gcc/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-gcc/%.def $(MCDEPS)
+m2/gm2-gcc/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-gcc/%.def | $(MCDEPS)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(MC) -o=$@ $(srcdir)/m2/gm2-gcc/$*.def
 
@@ -1435,25 +1448,25 @@ mcflex.o: mcflex.c m2/gm2-libs/gm2-libs-host.h
 mcflex.c: $(srcdir)/m2/mc/mc.flex
        flex -t $< > $@
 
-m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod
        $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot 
-I$(srcdir)/m2/gm2-libs-ch $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/M2RTS.c 
-o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs-boot/%.mod $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs-boot/%.mod | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs-boot/$*.mod
        $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) $(MCINCLUDES) -I$(srcdir)/m2/gm2-libs-ch m2/gm2-libs-boot/$*.c 
-o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-libs-boot/%.o: $(srcdir)/m2/gm2-libs/%.mod | $(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-libs-boot/$*.c $(srcdir)/m2/gm2-libs/$*.mod
        $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot 
-I$(srcdir)/m2/gm2-libs-ch $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/$*.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
+m2/gm2-libs-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def | $(MCDEPS)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(MC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
 
@@ -1469,57 +1482,57 @@ m2/gm2-libs-boot/RTintdummy.o: 
$(srcdir)/m2/gm2-libs-ch/RTintdummy.c
        $(CXX) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
-Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/wrapc.o: $(srcdir)/m2/gm2-libs-ch/wrapc.c 
m2/gm2-libs-boot/$(SRC_PREFIX)wrapc.h $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/wrapc.o: $(srcdir)/m2/gm2-libs-ch/wrapc.c | 
m2/gm2-libs-boot/$(SRC_PREFIX)wrapc.h $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c -DHAVE_CONFIG_H $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot 
-Im2/gm2-libs $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
 MC_BOOT_INCLUDES = -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot 
-I$(srcdir)/m2/mc-boot-ch
 
-m2/gm2-libs-boot/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.cc 
m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.cc | 
m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) \
          $(MC_BOOT_INCLUDES) $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/choosetemp.o: m2/gm2-libs-ch/choosetemp.c 
m2/gm2-libiberty/Gchoosetemp.h $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/choosetemp.o: m2/gm2-libs-ch/choosetemp.c | 
m2/gm2-libiberty/Gchoosetemp.h $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
$(MC_BOOT_INCLUDES) \
          -Im2/gm2-libiberty -I$(srcdir)/m2/gm2-libiberty/ $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/errno.o: $(srcdir)/m2/gm2-libs-ch/errno.c 
m2/gm2-libs-boot/$(SRC_PREFIX)errno.h $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/errno.o: $(srcdir)/m2/gm2-libs-ch/errno.c | 
m2/gm2-libs-boot/$(SRC_PREFIX)errno.h $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) \
          $(MC_BOOT_INCLUDES) $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.cc $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.cc | $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
$(MC_BOOT_INCLUDES) \
           $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.cc $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.cc | 
$(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
$(MC_BOOT_INCLUDES) \
           $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c 
$(BUILD-LIBS-BOOT-H) $(GM2-LIBS-BOOT-H)
+m2/gm2-libs-boot/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c | 
$(BUILD-LIBS-BOOT-H) $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
$(MC_BOOT_INCLUDES) \
           $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c \
+m2/gm2-libs-boot/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c | \
                                   
m2/gm2-libs-boot/$(SRC_PREFIX)SysExceptions.h $(GM2-LIBS-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) $(MC_SRC_FLAGS) 
$(MC_BOOT_INCLUDES) \
           $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/SysStorage.o: $(srcdir)/m2/gm2-libs/SysStorage.mod $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-libs-boot/SysStorage.o: $(srcdir)/m2/gm2-libs/SysStorage.mod | 
$(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-libs-boot/SysStorage.c 
$(srcdir)/m2/gm2-libs/SysStorage.mod
        $(COMPILER) $(CM2DEP) -DIN_GCC -c $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) \
@@ -1527,34 +1540,34 @@ m2/gm2-libs-boot/SysStorage.o: 
$(srcdir)/m2/gm2-libs/SysStorage.mod $(MCDEPS) $(
           m2/gm2-libs-boot/SysStorage.c -o m2/gm2-libs-boot/SysStorage.o
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/Selective.o: $(srcdir)/m2/gm2-libs-ch/Selective.c \
-                                  m2/gm2-libs-boot/$(SRC_PREFIX)Selective.h 
m2/gm2-libs/gm2-libs-host.h
+m2/gm2-libs-boot/Selective.o: $(srcdir)/m2/gm2-libs-ch/Selective.c | \
+                              m2/gm2-libs-boot/$(SRC_PREFIX)Selective.h 
m2/gm2-libs/gm2-libs-host.h
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs 
-I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/M2GCCDeclare.o: 
$(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod $(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-compiler-boot/M2GCCDeclare.o: 
$(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod | $(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) $(MC_EXTENDED_OPAQUE) -o=m2/gm2-compiler-boot/M2GCCDeclare.c $<
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/M2GCCDeclare.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/M2Error.o: $(srcdir)/m2/gm2-compiler/M2Error.mod 
$(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-compiler-boot/M2Error.o: $(srcdir)/m2/gm2-compiler/M2Error.mod | 
$(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) $(MC_EXTENDED_OPAQUE) -o=m2/gm2-compiler-boot/M2Error.c $<
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/M2Error.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/%.o: $(srcdir)/m2/gm2-compiler/%.mod $(BUILD-BOOT-H) 
$(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-compiler-boot/%.o: $(srcdir)/m2/gm2-compiler/%.mod | $(BUILD-BOOT-H) 
$(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/$*.c $(srcdir)/m2/gm2-compiler/$*.mod
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/$*.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/%.o: m2/gm2-compiler-boot/%.mod $(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-compiler-boot/%.o: m2/gm2-compiler-boot/%.mod | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/$*.c m2/gm2-compiler-boot/$*.mod
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
@@ -1565,67 +1578,67 @@ m2/gm2-compiler-boot/$(SRC_PREFIX)%.h: 
$(srcdir)/m2/gm2-compiler/%.def $(MCDEPS)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(MC) -o=$@ $(srcdir)/m2/gm2-compiler/$*.def
 
-m2/gm2-compiler-boot/P0SyntaxCheck.c: m2/gm2-compiler-boot/P0SyntaxCheck.mod 
$(MCDEPS)
+m2/gm2-compiler-boot/P0SyntaxCheck.c: m2/gm2-compiler-boot/P0SyntaxCheck.mod | 
$(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/P0SyntaxCheck.c 
m2/gm2-compiler-boot/P0SyntaxCheck.mod
 
-m2/gm2-compiler-boot/P0SyntaxCheck.o: m2/gm2-compiler-boot/P0SyntaxCheck.c 
$(MCDEPS) $(BUILD-BOOT-H)
+m2/gm2-compiler-boot/P0SyntaxCheck.o: m2/gm2-compiler-boot/P0SyntaxCheck.c | 
$(MCDEPS) $(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/P0SyntaxCheck.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/P1Build.c: m2/gm2-compiler-boot/P1Build.mod $(MCDEPS)
+m2/gm2-compiler-boot/P1Build.c: m2/gm2-compiler-boot/P1Build.mod | $(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/P1Build.c m2/gm2-compiler-boot/P1Build.mod
 
-m2/gm2-compiler-boot/P1Build.o: m2/gm2-compiler-boot/P1Build.c $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-compiler-boot/P1Build.o: m2/gm2-compiler-boot/P1Build.c | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/P1Build.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/P2Build.c: m2/gm2-compiler-boot/P2Build.mod $(MCDEPS)
+m2/gm2-compiler-boot/P2Build.c: m2/gm2-compiler-boot/P2Build.mod | $(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/P2Build.c m2/gm2-compiler-boot/P2Build.mod
 
-m2/gm2-compiler-boot/P2Build.o: m2/gm2-compiler-boot/P2Build.c $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-compiler-boot/P2Build.o: m2/gm2-compiler-boot/P2Build.c | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/P2Build.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/P3Build.c: m2/gm2-compiler-boot/P3Build.mod $(MCDEPS)
+m2/gm2-compiler-boot/P3Build.c: m2/gm2-compiler-boot/P3Build.mod | $(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/P3Build.c m2/gm2-compiler-boot/P3Build.mod
 
-m2/gm2-compiler-boot/P3Build.o: m2/gm2-compiler-boot/P3Build.c $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-compiler-boot/P3Build.o: m2/gm2-compiler-boot/P3Build.c | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/P3Build.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/PCBuild.c: m2/gm2-compiler-boot/PCBuild.mod $(MCDEPS)
+m2/gm2-compiler-boot/PCBuild.c: m2/gm2-compiler-boot/PCBuild.mod | $(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/PCBuild.c m2/gm2-compiler-boot/PCBuild.mod
 
-m2/gm2-compiler-boot/PCBuild.o: m2/gm2-compiler-boot/PCBuild.c $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-compiler-boot/PCBuild.o: m2/gm2-compiler-boot/PCBuild.c | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/PCBuild.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/PHBuild.c: m2/gm2-compiler-boot/PHBuild.mod $(MCDEPS)
+m2/gm2-compiler-boot/PHBuild.c: m2/gm2-compiler-boot/PHBuild.mod | $(MCDEPS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(MC) -o=m2/gm2-compiler-boot/PHBuild.c m2/gm2-compiler-boot/PHBuild.mod
 
-m2/gm2-compiler-boot/PHBuild.o: m2/gm2-compiler-boot/PHBuild.c $(MCDEPS) 
$(BUILD-BOOT-H)
+m2/gm2-compiler-boot/PHBuild.o: m2/gm2-compiler-boot/PHBuild.c | $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) 
\
             $(GM2_BOOT_INCLUDES) $(MCINCLUDES) $(INCLUDES) 
m2/gm2-compiler-boot/PHBuild.c -o $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler-boot/m2flex.o: m2/gm2-compiler/m2flex.c $(BUILD-BOOT-H) 
$(TIMEVAR_H) \
+m2/gm2-compiler-boot/m2flex.o: m2/gm2-compiler/m2flex.c | $(BUILD-BOOT-H) 
$(TIMEVAR_H) \
         $(BUILD-LIBS-BOOT-H) m2/gm2-compiler-boot/$(SRC_PREFIX)NameKey.h \
         $(CONFIG_H) m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
@@ -1643,12 +1656,12 @@ m2/gm2-libiberty/$(SRC_PREFIX)%.h: 
$(srcdir)/m2/gm2-libiberty/%.def $(MCDEPS)
 
 # The rules to build objects in gm2-compiler and gm2-libs directories.
 
-m2/gm2-compiler/%.o: $(srcdir)/m2/gm2-compiler/%.mod
+m2/gm2-compiler/%.o: | $(srcdir)/m2/gm2-compiler/%.mod
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(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 $@
        $(POSTCOMPILE)
 
-m2/gm2-compiler/m2flex.o: m2/gm2-compiler/m2flex.c m2/gm2-libs/gm2-libs-host.h 
$(TIMEVAR_H)
+m2/gm2-compiler/m2flex.o: | m2/gm2-compiler/m2flex.c 
m2/gm2-libs/gm2-libs-host.h $(TIMEVAR_H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
        $(COMPILER) $(CM2DEP) -c -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) 
$(INCLUDES) \
           $(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
@@ -1837,14 +1850,14 @@ m2/gm2-libs/choosetemp.o: m2/gm2-libs-ch/choosetemp.c 
m2/gm2-libiberty/Gchoosete
        $(CXX) $(CM2DEP) -c $(CFLAGS) $(GM2_PICFLAGS) -Im2/gm2-libs 
-I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty 
-I$(srcdir)/m2/gm2-libiberty/ $(INCLUDES) $< -o $@
        $(POSTCOMPILE)
 
-m2/gm2-libs-boot/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-BOOT)
+m2/gm2-libs-boot/libgm2.a: | m2/boot-bin/mc$(exeext) $(BUILD-LIBS-BOOT)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(AR) cr $@ $(GM2-LIBS-BOOT-MODS:%.mod=m2/gm2-libs-boot/%.o) \
                     $(GM2-LIBS-BOOT-CC:%.cc=m2/gm2-libs-boot/%.o) \
                     $(GM2-LIBS-BOOT-C:%.c=m2/gm2-libs-boot/%.o)
        $(RANLIB) $@
 
-m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext) 
m2/boot-bin/mklink$(exeext) \
+m2/gm2-compiler-boot/gm2.a: | m2/boot-bin/mc$(exeext) 
m2/boot-bin/mklink$(exeext) \
                          $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT)
        -test -d $(@D) || $(mkinstalldirs) $(@D)
        $(AR) cr $@ $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
-- 
2.47.3

Reply via email to