libgfortran building reliability corner case

Mike Stump mrs@apple.com
Sat Oct 15 17:05:00 GMT 2005


If things go incredibly wrong and the command fails, we wind up with  
up-to-date targets that are just wrong.  This fixes it so they are  
removed, so that the next build will `just work' once the problem  
that cause them to fail is fixed.  An example might be mostly out of  
disk space.

     * Makefile.am (kinds.h): Remove target, if command fails.
     (selected_int_kind.inc): Likewise.
     (selected_real_kind.inc): Likewise.

Ok?

--- ./libgfortran/Makefile.am.~1~       2005-10-07 09:00:59.000000000  
-0700
+++ ./libgfortran/Makefile.am   2005-10-07 10:01:58.000000000 -0700
@@ -578,7 +578,7 @@ I_M4_DEPS0=$(I_M4_DEPS) m4/iforeach.m4
I_M4_DEPS1=$(I_M4_DEPS) m4/ifunction.m4
kinds.h: $(srcdir)/mk-kinds-h.sh
-       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ || rm $@
kinds.inc: kinds.h
         grep '^#' < kinds.h > $@
@@ -587,10 +587,10 @@ c99_protos.inc: $(srcdir)/c99_protos.h
         grep '^#' < $(srcdir)/c99_protos.h > $@
selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh
-       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ || rm $@
selected_real_kind.inc: $(srcdir)/mk-srk-inc.sh
-       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@ || rm $@
## A 'normal' build shouldn't need to regenerate these
## so we only include them in maintainer mode
--- ./libgfortran/Makefile.in.~1~       2005-10-07 09:00:59.000000000  
-0700
+++ ./libgfortran/Makefile.in   2005-10-07 10:02:02.000000000 -0700
@@ -2685,7 +2685,7 @@ uninstall-am: uninstall-info-am uninstal
kinds.h: $(srcdir)/mk-kinds-h.sh
-       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-kinds-h.sh '$(FCCOMPILE)' > $@ || rm $@
kinds.inc: kinds.h
         grep '^#' < kinds.h > $@
@@ -2694,10 +2694,10 @@ c99_protos.inc: $(srcdir)/c99_protos.h
         grep '^#' < $(srcdir)/c99_protos.h > $@
selected_int_kind.inc: $(srcdir)/mk-sik-inc.sh
-       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-sik-inc.sh '$(FCCOMPILE)' > $@ || rm $@
selected_real_kind.inc: $(srcdir)/mk-srk-inc.sh
-       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@
+       $(SHELL) $(srcdir)/mk-srk-inc.sh '$(FCCOMPILE)' > $@ || rm $@
@MAINTAINER_MODE_TRUE@$(i_all_c): m4/all.m4 $(I_M4_DEPS1)
@MAINTAINER_MODE_TRUE@ m4 -Dfile=$@ -I$(srcdir)/m4 all.m4 > $(srcdir)/$@
--------------



More information about the Gcc-patches mailing list