RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
CROSS_TOOLS =
+# Dir to search for system headers. Overridden by cross-make.
+SYSTEM_HEADER_DIR = /usr/include
+
# There may be a premade insn-attrtab.c for this machine.
# (You could rebuild it with genattrtab as usual, but it takes a long time.)
# PREMADE_ATTRTAB is the file name of the file to use.
# This is what to compile if making a cross-compiler.
all.cross: native gcc-cross libgcc.a cross-test $(EXTRA_PARTS)
# This is what must be made before installing GCC and converting libraries.
-start.encap: native xgcc specs $(LIBGCC1)
+start.encap: native xgcc specs $(LIBGCC1) xlimits.h
# Use this to make a GCC that will be used only to recompile GCC.
for-bootstrap: start.encap libgcc.a
# These can't be made, with COFF encapsulation, until after GCC can run.
# -cp $(srcdir)/enquire.c . > /dev/null 2>&1
# Breaking this line caused a problem with one version of GNU make.
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
+
+# Build the version of limits.h that we will install.
+xlimits.h: glimits.h limitx.h limity.h
+ if [ -f $(SYSTEM_HEADER_DIR)/limits.h ] ; then \
+ cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > xlimits.h; \
+ else \
+ cat $(srcdir)/glimits.h > xlimits.h; \
+ fi
\f
# Build libgcc.a.
# This is done in two parts because some functions, in libgcc1.c,
# Each of the other insn-* files is handled by a similar pair of rules.
+# This causes an anomaly in the results of make -n
+# because insn-* is older than stamp-*
+# and thus make -n thinks that insn-* will be updated
+# and force recompilation of things that depend on it.
+# We use move-if-changed precisely to avoid such recompilation.
+# But there is no way to teach make -n that it will be avoided.
+
# Each of the insn-*.[ch] rules has a semicolon at the end,
# for otherwise the system Make on SunOS 4.1 never tries
# to recompile insn-*.o.
# Also temporarily `install-fixincludes' could replace `install-headers'.
# Also use `install-collect2' to install collect2 when the config files don't.
-install: $(INSTALL_TARGET)
+# The semicolon is to prevent the install.sh -> install default rule
+# from doing anything.
+install: $(INSTALL_TARGET) ;
# Copy the files of native compiler into directories where they will be run.
install-native: install-common install-libgcc $(INSTALL_HEADERS) \
chmod a-x $(libsubdir)/include/float.h
# Install limits.h, optionally inheriting from the standard system version.
-install-limits-h: glimits.h limitx.h install-dir
- -rm -f $(libsubdir)/include/limits.h tmp-limits.h
- if [ -f /usr/include/limits.h ] ; then \
- cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-limits.h; \
- else \
- cat $(srcdir)/glimits.h > tmp-limits.h; \
- fi
- $(INSTALL_DATA) tmp-limits.h $(libsubdir)/include/limits.h
+install-limits-h: xlimits.h install-dir
+ -rm -f $(libsubdir)/include/limits.h
+ $(INSTALL_DATA) xlimits.h $(libsubdir)/include/limits.h
chmod a-x $(libsubdir)/include/limits.h
- rm tmp-limits.h
# Install the fixed headers that are the same for all machines.
install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h