i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \
$(INCDIR)/ansidecl.h $(INCDIR)/getopt.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h $(INCDIR)/opcode/i386.h $(INCDIR)/safe-ctype.h \
- config.h i386-opc.h sysdep.h
+ config.h sysdep.h
$(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
-$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
- @echo $@
-
-$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
+# i386-gen will generate both headers in one go. Use a pattern rule to properly
+# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
+$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
+ $(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
< $(srcdir)/i386-opc.tbl \
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
i386-opc.lo: $(srcdir)/i386-tbl.h
+# While not really a dependency, specify i386-init.h here as well to make sure
+# it is generated even if i386-tbl.h is present and up-to-date.
+i386-opc.lo: $(srcdir)/i386-init.h
ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS)
$(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS)
i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \
$(INCDIR)/ansidecl.h $(INCDIR)/getopt.h $(INCDIR)/hashtab.h \
$(INCDIR)/libiberty.h $(INCDIR)/opcode/i386.h $(INCDIR)/safe-ctype.h \
- config.h i386-opc.h sysdep.h
+ config.h sysdep.h
$(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
-$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
- @echo $@
-
-$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
+# i386-gen will generate both headers in one go. Use a pattern rule to properly
+# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
+$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
+ $(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
< $(srcdir)/i386-opc.tbl \
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
i386-opc.lo: $(srcdir)/i386-tbl.h
+# While not really a dependency, specify i386-init.h here as well to make sure
+# it is generated even if i386-tbl.h is present and up-to-date.
+i386-opc.lo: $(srcdir)/i386-init.h
ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS)
$(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS)