summaryrefslogtreecommitdiff
path: root/gcc/Makefile.in
diff options
context:
space:
mode:
authorBasile Starynkevitch <basile@starynkevitch.net>2010-11-25 19:03:27 +0000
committerBasile Starynkevitch <bstarynk@gcc.gnu.org>2010-11-25 19:03:27 +0000
commit92724e1d707ea2821c9a94517ba3b830f84eb296 (patch)
treee0e8eaea81b8a2157370fd1822a8fd68c29a5a3b /gcc/Makefile.in
parentf759884521f40179bd1296c5a4f30fd3b6a378ce (diff)
downloadgcc-92724e1d707ea2821c9a94517ba3b830f84eb296.tar.gz
gentype-state.c: Add new file.
2010-11-25 Basile Starynkevitch <basile@starynkevitch.net> Jeremie Salvucci <jeremie.salvucci@free.fr> * gentype-state.c: Add new file. * gengtype.c (type count): New variable. (new_structure, find_param_structure, create_pointer) (create_array): Use it to set state_number in types. (dump_everything): Improve comment. (main): Call read_state and write_state. Print type_count. * gengtype.h (type_lineloc): New function. (read_state, write_state): New declarations. * Makefile.in (GENGTYPE_FLAGS): New variable. (s-gtype): Run gengtype twice and generate gtype.state. (build/gengtype-state.o): New rule. (build/gengtype$(build_exeext)): Link gengtype-state.o. (mostlyclean): Update comment. Remove gtype.state. Co-Authored-By: Jeremie Salvucci <jeremie.salvucci@free.fr> From-SVN: r167150
Diffstat (limited to 'gcc/Makefile.in')
-rw-r--r--gcc/Makefile.in18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3165f101fff..20e01aa0b57 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3819,6 +3819,9 @@ ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h : s-gtype ; @true
+### Common flags to gengtype [e.g. -v or -B backupdir]
+GENGTYPE_FLAGS=
+
gtyp-input.list: s-gtyp-input ; @true
s-gtyp-input: Makefile
@: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
@@ -3827,7 +3830,13 @@ s-gtyp-input: Makefile
s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \
gtyp-input.list
- $(RUN_GEN) build/gengtype$(build_exeext) -S $(srcdir) -I gtyp-input.list
+# First, parse all files and save a state file.
+ $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
+ -S $(srcdir) -I gtyp-input.list -w gtype.state
+# Second, read the state file and generate all files. This ensure that
+# gtype.state is correctly read:
+ $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
+ -r gtype.state
$(STAMP) s-gtype
generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
@@ -3923,6 +3932,8 @@ build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
build/gengtype-lex.o : gengtype-lex.c gengtype.h $(BCONFIG_H) $(SYSTEM_H)
build/gengtype-parse.o : gengtype-parse.c gengtype.h $(BCONFIG_H) \
$(SYSTEM_H)
+build/gengtype-state.o: gengtype-state.c gengtype.h $(BCONFIG_H) \
+ $(SYSTEM_H) errors.h
build/gengtype.o : gengtype.c $(BCONFIG_H) $(SYSTEM_H) gengtype.h \
rtl.def insn-notes.def errors.h double-int.h $(HASHTAB_H) \
$(OBSTACK_H) $(XREGEX_H)
@@ -3968,7 +3979,7 @@ build/genautomata$(build_exeext) : BUILD_LIBS += -lm
# These programs are not linked with the MD reader.
build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
- build/version.o
+ build/gengtype-state.o build/version.o
# Rule for the generator programs:
$(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
@@ -4441,9 +4452,10 @@ mostlyclean: lang.mostlyclean
-rm -f core */core
# Delete file generated for gengtype
-rm -f gtyp-input.list
-# Delete files generated by gengtype.c
+# Delete files generated by gengtype
-rm -f gtype-*
-rm -f gt-*
+ -rm -f gtype.state
# Delete genchecksum outputs
-rm -f *-checksum.c