Commit 057f494b by Richard Stallman

(all.build): New rule for making gcc with a cross-compiler.

(install.build): New target.
(line 271): Add `####build overrides'.
(gen*.o): Depend on hconfig.h, not config.h.
($(HOST_PREFIX_1)rtl.o, $(HOST_PREFIX_1)print-rtl.o,
 $(HOST_PREFIX_1)rtlanal.o, $(HOST_PREFIX_1)obstack.o,
 $(HOST_PREFIX_1)malloc.o): Add final `h' to the regexp to replace.

(gcc.xtar): Fix typo in last change.
(mostlyclean): Don't use $(MAKEFLAGS) for objc subdir stuff.

From-SVN: r2505
parent 5c4d7cfb
...@@ -268,6 +268,7 @@ all: all.indirect ...@@ -268,6 +268,7 @@ all: all.indirect
####target overrides ####target overrides
####host overrides ####host overrides
####cross overrides ####cross overrides
####build overrides
# Now figure out from those variables how to compile and link. # Now figure out from those variables how to compile and link.
...@@ -422,6 +423,8 @@ Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \ ...@@ -422,6 +423,8 @@ Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
all.internal: start.encap rest.encap all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler. # This is what to compile if making a cross-compiler.
all.cross: native gcc-cross libgcc.a cross-test $(EXTRA_PARTS) all.cross: native gcc-cross libgcc.a cross-test $(EXTRA_PARTS)
# This is what to compile if making gcc with a cross-compiler.
all.build: native $(EXTRA_PARTS)
# This is what must be made before installing GCC and converting libraries. # This is what must be made before installing GCC and converting libraries.
start.encap: native xgcc specs $(LIBGCC1) xlimits.h start.encap: native xgcc specs $(LIBGCC1) xlimits.h
# Use this to make a GCC that will be used only to recompile GCC. # Use this to make a GCC that will be used only to recompile GCC.
...@@ -765,6 +768,8 @@ ld: collect2 ...@@ -765,6 +768,8 @@ ld: collect2
ln collect2 ld ln collect2 ld
collect2 : collect2.o version.o $(LIBDEPS) collect2 : collect2.o version.o $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-rm -f collect2
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
collect2.o : collect2.c $(CONFIG_H) gstab.h collect2.o : collect2.c $(CONFIG_H) gstab.h
...@@ -1035,70 +1040,70 @@ genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS) ...@@ -1035,70 +1040,70 @@ genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
genconfig.o $(HOST_RTL) $(HOST_LIBS) genconfig.o $(HOST_RTL) $(HOST_LIBS)
genconfig.o : genconfig.c $(RTL_H) config.h genconfig.o : genconfig.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS) genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
genflags.o $(HOST_RTL) $(HOST_LIBS) genflags.o $(HOST_RTL) $(HOST_LIBS)
genflags.o : genflags.c $(RTL_H) config.h genflags.o : genflags.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS) gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
gencodes.o $(HOST_RTL) $(HOST_LIBS) gencodes.o $(HOST_RTL) $(HOST_LIBS)
gencodes.o : gencodes.c $(RTL_H) config.h gencodes.o : gencodes.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS) genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
genemit.o $(HOST_RTL) $(HOST_LIBS) genemit.o $(HOST_RTL) $(HOST_LIBS)
genemit.o : genemit.c $(RTL_H) config.h genemit.o : genemit.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS) genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
genrecog.o $(HOST_RTL) $(HOST_LIBS) genrecog.o $(HOST_RTL) $(HOST_LIBS)
genrecog.o : genrecog.c $(RTL_H) config.h genrecog.o : genrecog.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS) genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
genextract.o $(HOST_RTL) $(HOST_LIBS) genextract.o $(HOST_RTL) $(HOST_LIBS)
genextract.o : genextract.c $(RTL_H) config.h insn-config.h genextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS) genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
genpeep.o $(HOST_RTL) $(HOST_LIBS) genpeep.o $(HOST_RTL) $(HOST_LIBS)
genpeep.o : genpeep.c $(RTL_H) config.h genpeep.o : genpeep.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS) genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
genattr.o $(HOST_RTL) $(HOST_LIBS) genattr.o $(HOST_RTL) $(HOST_LIBS)
genattr.o : genattr.c $(RTL_H) config.h genattr.o : genattr.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS) genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS) genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
genattrtab.o : genattrtab.c $(RTL_H) config.h insn-config.h genattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS) genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
genoutput.o $(HOST_RTL) $(HOST_LIBS) genoutput.o $(HOST_RTL) $(HOST_LIBS)
genoutput.o : genoutput.c $(RTL_H) config.h genoutput.o : genoutput.c $(RTL_H) hconfig.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
# Compile the libraries to be used by gen*. # Compile the libraries to be used by gen*.
...@@ -1107,17 +1112,17 @@ genoutput.o : genoutput.c $(RTL_H) config.h ...@@ -1107,17 +1112,17 @@ genoutput.o : genoutput.c $(RTL_H) config.h
# with the rules for rtl.o, alloca.o, etc. # with the rules for rtl.o, alloca.o, etc.
$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H) $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
rm -f $(HOST_PREFIX)rtl.c rm -f $(HOST_PREFIX)rtl.c
sed -e 's/config[.]/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H) $(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
rm -f $(HOST_PREFIX)print-rtl.c rm -f $(HOST_PREFIX)print-rtl.c
sed -e 's/config[.]/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H) $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
rm -f $(HOST_PREFIX)rtlanal.c rm -f $(HOST_PREFIX)rtlanal.c
sed -e 's/config[.]/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
$(HOST_PREFIX_1)alloca.o: alloca.c $(HOST_PREFIX_1)alloca.o: alloca.c
...@@ -1127,12 +1132,12 @@ $(HOST_PREFIX_1)alloca.o: alloca.c ...@@ -1127,12 +1132,12 @@ $(HOST_PREFIX_1)alloca.o: alloca.c
$(HOST_PREFIX_1)obstack.o: obstack.c $(HOST_PREFIX_1)obstack.o: obstack.c
rm -f $(HOST_PREFIX)obstack.c rm -f $(HOST_PREFIX)obstack.c
sed -e 's/config[.]/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
$(HOST_PREFIX_1)malloc.o: malloc.c $(HOST_PREFIX_1)malloc.o: malloc.c
rm -f $(HOST_PREFIX)malloc.c rm -f $(HOST_PREFIX)malloc.c
sed -e 's/config[.]/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
# This satisfies the dependency that we get if you cross-compile a compiler # This satisfies the dependency that we get if you cross-compile a compiler
...@@ -1261,7 +1266,7 @@ mostlyclean: ...@@ -1261,7 +1266,7 @@ mostlyclean:
-rm -f $(STAGESTUFF) -rm -f $(STAGESTUFF)
# Clean the objc subdir. # Clean the objc subdir.
srcdir1=`cd $(srcdir); pwd`; \ srcdir1=`cd $(srcdir); pwd`; \
cd objc; $(MAKE) $(MAKEFLAGS) -f $$srcdir1/objc/Makefile mostlyclean cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean
# Delete the temporary source copies for cross compilation. # Delete the temporary source copies for cross compilation.
-rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
...@@ -1340,6 +1345,12 @@ install-native: install-common install-libgcc $(INSTALL_HEADERS) \ ...@@ -1340,6 +1345,12 @@ install-native: install-common install-libgcc $(INSTALL_HEADERS) \
install-cross: install-common install-common-headers \ install-cross: install-common install-common-headers \
install-man install-cross-tools install-libgcc install-man install-cross-tools install-libgcc
# Do nothing while making gcc with a cross-compiler. The person who
# makes gcc for the target machine has to know how to put a complete
# gcc together by hand.
install-build: force
@echo You have to install gcc on your target machine by hand.
# Install the tools, libraries and header files for the target machine # Install the tools, libraries and header files for the target machine
# where cross-compilation will look for them. # where cross-compilation will look for them.
# Use tooldir to find them. # Use tooldir to find them.
...@@ -1655,7 +1666,7 @@ gcc.xtar: doc c-parse.y objc-parse.y ...@@ -1655,7 +1666,7 @@ gcc.xtar: doc c-parse.y objc-parse.y
done done
cd objc; \ cd objc; \
for file in *[0-9a-zA-Z+]; do \ for file in *[0-9a-zA-Z+]; do \
ln $$file ../tmp/config >/dev/null 2>&1 || cp $$file ../tmp/config; \ ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
done done
ln .gdbinit tmp ln .gdbinit tmp
mv tmp gcc-$(version) mv tmp gcc-$(version)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment