(libgcc1-asm.a): New target for building libgcc1.a in cross compilers.
authorDoug Evans <dje@gnu.org>
Mon, 11 Jul 1994 22:36:14 +0000 (22:36 +0000)
committerDoug Evans <dje@gnu.org>
Mon, 11 Jul 1994 22:36:14 +0000 (22:36 +0000)
From-SVN: r7724

gcc/Makefile.in

index 023d42397c668b0f6c002e46b1ca2cb04f206ceb..65e3e85527c94cc203275007ce38c2bef077f6d7 100644 (file)
@@ -740,6 +740,32 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
        done
        mv tmplibgcc1.a libgcc1.a
 
+# Build libgcc1.a from assembler source.  LIB1ASMFUNCS is the list of
+# functions.  LIB1ASMSRC is the name of the source file in the config
+# subdirectory.
+libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC)
+       -rm -f tmplibgcc1.a libgcc1.S
+       cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S
+# Actually build it in tmplibgcc1.a, then rename at end,
+# so that libgcc1-asm.a itself remains nonexistent if compilation is aborted.
+# -e causes any failing command to make this rule fail.
+# -e doesn't work in certain shells, so we test $$? as well.
+# lynx has a broken ar, it always complains when the initial library is
+# empty, thus this command works only if we don't do -e
+# There is a trailing backslash (\) deleted from the following line.
+#      set -e;
+       for name in $(LIB1ASMFUNCS); \
+       do \
+         echo $${name}; \
+         $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \
+         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+         mv libgcc1.o $${name}.o; \
+         $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}.o; \
+         rm -f $${name}.o; \
+       done
+       -rm -f libgcc1.S
+       mv tmplibgcc1.a libgcc1-asm.a
+
 # Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
 # But recompiling cc1 should not force recompilation of libgcc2.a.
 # If you want to force recompilation, delete libgcc2.a.