On Tue, May 25, 2010 at 4:28 PM, Ralf Wildenhues <ralf.wildenh...@gmx.de> wrote: > * Steven Bosscher wrote on Tue, May 25, 2010 at 04:23:35PM CEST: >> On Tue, May 25, 2010 at 11:13 AM, Andreas Schwab wrote: >> > Target-specific variable values are applied to all dependencies, see >> > (make) Target-specific: > [...] >> That is the problem here. TM_H depends on insn-constants.h, which >> depends on genconstants: > [...] >> >> Lots of files validly depend on TM_H (directly, or via target.h). > > What's more, the order-only prerequisite > > $(ALL_HOST_OBJS) : | $(generated_files)
I can use that to my advantage if I turn the logic around, as in the attached patch. With this, I get all gen* files and libiberty built without trouble, and the build stops on the first front-end file that includes rtl.h (attribs.h, which btw doesn't have to include it). Ciao! Steven Index: Makefile.in =================================================================== --- Makefile.in (revision 159808) +++ Makefile.in (working copy) @@ -1445,15 +1445,22 @@ OBJS = $(OBJS-common) $(OBJS-md) $(OBJS- OBJS-onestep = libbackend.o $(OBJS-archive) -# This lists all host object files, whether they are included in this -# compilation or not. -ALL_HOST_OBJS = $(GCC_OBJS) $(C_OBJS) $(OBJS) libbackend.o \ +# This lists all host objects for the front ends. Extra defines are passed +# to the compiler for these objects. +ALL_HOST_FRONTEND_OBJS = $(C_OBJS) + $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) + +ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) libbackend.o \ @TREEBROWSER@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \ - $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) \ - $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) \ - mips-tfile.o mips-tdump.o \ + $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) mips-tfile.o mips-tdump.o \ $(GCOV_OBJS) $(GCOV_DUMP_OBJS) +$(ALL_HOST_BACKEND_OBJS): ALL_CFLAGS += -DIN_GCC_BACKEND + +# This lists all host object files, whether they are included in this +# compilation or not. +ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS) + BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER) MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ @@ -2075,7 +2082,7 @@ c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG # A file used by all variants of C and some other languages. attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FLAGS_H) $(TOPLEV_H) output.h $(RTL_H) $(GGC_H) $(TM_P_H) \ + $(FLAGS_H) $(TOPLEV_H) output.h $(GGC_H) $(TM_P_H) \ $(TARGET_H) langhooks.h $(CPPLIB_H) $(PLUGIN_H) c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \ Index: system.h =================================================================== --- system.h (revision 159808) +++ system.h (working copy) @@ -789,6 +789,10 @@ extern void fancy_abort (const char *, i VA_FIXEDARG VA_CLOSE VA_START #endif /* IN_GCC */ +#if !defined(IN_GCC_BACKEND) && !defined(GENERATOR_FILE) +#pragma GCC poison GCC_RTL_H +#endif + /* Note: not all uses of the `index' token (e.g. variable names and structure members) have been eliminated. */ #undef bcopy