x86: optimize BT{,C,R,S} $imm,%reg
[binutils-gdb.git] / opcodes / Makefile.am
index 10ea3368d7fae0f1fbd959d3a631b3414f4781fe..578fdc056c51d6fb7350d67ce4a7d3a8d0599c9f 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to generate Makefile.in
 #
-#   Copyright (C) 2012-2022 Free Software Foundation, Inc.
+#   Copyright (C) 2012-2023 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -64,9 +64,7 @@ HFILES = \
        epiphany-desc.h epiphany-opc.h \
        fr30-desc.h fr30-opc.h \
        frv-desc.h frv-opc.h \
-       i386-init.h \
        i386-opc.h \
-       i386-tbl.h \
        ia64-asmtab.h \
        ia64-opc.h \
        ip2k-desc.h ip2k-opc.h \
@@ -82,7 +80,6 @@ HFILES = \
        score-opc.h \
        sh-opc.h \
        sysdep.h \
-       xc16x-desc.h xc16x-opc.h \
        xstormy16-desc.h xstormy16-opc.h \
        z8k-opc.h
 
@@ -163,7 +160,6 @@ TARGET32_LIBOPCODES_CFILES = \
        h8300-dis.c \
        hppa-dis.c \
        i386-dis.c \
-       i386-opc.c \
        ip2k-asm.c \
        ip2k-desc.c \
        ip2k-dis.c \
@@ -262,11 +258,6 @@ TARGET32_LIBOPCODES_CFILES = \
        visium-dis.c \
        visium-opc.c \
        wasm32-dis.c \
-       xc16x-asm.c \
-       xc16x-desc.c \
-       xc16x-dis.c \
-       xc16x-ibld.c \
-       xc16x-opc.c \
        xstormy16-asm.c \
        xstormy16-desc.c \
        xstormy16-dis.c \
@@ -286,22 +277,6 @@ LIBOPCODES_CFILES = \
        dis-init.c \
        disassemble.c
 
-# C source files that correspond to .o's.
-CFILES = \
-       $(LIBOPCODES_CFILES) \
-       aarch64-gen.c \
-       i386-gen.c \
-       ia64-asmtab.c \
-       ia64-gen.c \
-       ia64-opc-a.c \
-       ia64-opc-b.c \
-       ia64-opc-f.c \
-       ia64-opc-i.c \
-       ia64-opc-m.c \
-       ia64-opc-d.c \
-       s390-mkopc.c \
-       z8kgen.c
-
 ALL32_MACHINES = $(TARGET32_LIBOPCODES_CFILES:.c=.lo)
 ALL64_MACHINES = $(TARGET64_LIBOPCODES_CFILES:.c=.lo)
 
@@ -350,15 +325,14 @@ stamp-lib: libopcodes.la
 
 libopcodes.a: stamp-lib ; @true
 
-POTFILES = $(HFILES) $(CFILES)
+POTFILES = $(HFILES) $(LIBOPCODES_CFILES)
 po/POTFILES.in: @MAINT@ Makefile
        for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
          && mv tmp $(srcdir)/po/POTFILES.in
 
 CLEANFILES = \
        stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \
-       stamp-m32c stamp-m32r stamp-mep stamp-mt \
-       stamp-or1k stamp-xc16x stamp-xstormy16 \
+       stamp-m32c stamp-m32r stamp-mep stamp-mt stamp-or1k stamp-xstormy16 \
        libopcodes.a stamp-lib
 
 
@@ -375,7 +349,7 @@ CGENDEPS = \
        $(CGENDIR)/opc-opinst.scm \
        cgen-asm.in cgen-dis.in cgen-ibld.in
 
-CGEN_CPUS = cris epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt or1k xc16x xstormy16
+CGEN_CPUS = cris epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt or1k xstormy16
 
 if CGEN_MAINT
 BPF_DEPS = stamp-bpf
@@ -391,7 +365,6 @@ M32R_DEPS = stamp-m32r
 MEP_DEPS = stamp-mep
 MT_DEPS = stamp-mt
 OR1K_DEPS = stamp-or1k
-XC16X_DEPS = stamp-xc16x
 XSTORMY16_DEPS = stamp-xstormy16
 else
 BPF_DEPS =
@@ -407,7 +380,6 @@ M32R_DEPS =
 MEP_DEPS =
 MT_DEPS =
 OR1K_DEPS =
-XC16X_DEPS =
 XSTORMY16_DEPS =
 endif
 
@@ -524,14 +496,6 @@ stamp-or1k: $(CGENDEPS) $(CPUDIR)/or1k.cpu $(CPUDIR)/or1k.opc $(CPUDIR)/or1kcomm
        $(MAKE) run-cgen arch=or1k prefix=or1k options=opinst \
                archfile=$(CPUDIR)/or1k.cpu opcfile=$(CPUDIR)/or1k.opc extrafiles=opinst
 
-$(srcdir)/xc16x-desc.h $(srcdir)/xc16x-desc.c $(srcdir)/xc16x-opc.h $(srcdir)/xc16x-opc.c $(srcdir)/xc16x-ibld.c $(srcdir)/xc16x-asm.c $(srcdir)/xc16x-dis.c: $(XC16X_DEPS)
-       @true
-stamp-xc16x: $(CGENDEPS) $(CPUDIR)/xc16x.cpu $(CPUDIR)/xc16x.opc
-       $(MAKE) run-cgen arch=xc16x prefix=xc16x options= \
-               archfile=$(CPUDIR)/xc16x.cpu \
-               opcfile=$(CPUDIR)/xc16x.opc \
-               extrafiles=
-
 $(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS)
        @true
 stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
@@ -543,7 +507,8 @@ MOSTLYCLEANFILES = aarch64-gen$(EXEEXT_FOR_BUILD) i386-gen$(EXEEXT_FOR_BUILD) \
        z8kgen$(EXEEXT_FOR_BUILD) opc2c$(EXEEXT_FOR_BUILD)
 
 MAINTAINERCLEANFILES = $(srcdir)/aarch64-asm-2.c $(srcdir)/aarch64-dis-2.c \
-       $(srcdir)/aarch64-opc-2.c $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h \
+       $(srcdir)/aarch64-opc-2.c \
+       $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h $(srcdir)/i386-mnem.h \
        $(srcdir)/ia64-asmtab.c $(srcdir)/z8k-opc.h \
        $(srcdir)/msp430-decode.c \
        $(srcdir)/rl78-decode.c \
@@ -569,18 +534,20 @@ i386-gen$(EXEEXT_FOR_BUILD): i386-gen.o $(BUILD_LIB_DEPS)
 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) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
+# i386-gen will generate all 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 $(srcdir)/i386%mnem.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 dependencies, specify other generated i386-*.h here as well
+# to make sure they are re-generated as necessary.
+i386-dis.lo: $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h $(srcdir)/i386-mnem.h
 
 ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS)
        $(AM_V_CCLD)$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS)