Don't add IMAGE_FILE_RELOCS_STRIPPED for PIE.
[deliverable/binutils-gdb.git] / opcodes / Makefile.am
index f9b7060306f1a4259e0f60ca9ec0324d0f382a23..71b8608d4d45e1562b9e071f1668dd65e4cc9ac3 100644 (file)
@@ -3,7 +3,8 @@
 AUTOMAKE_OPTIONS = 1.11 foreign no-dist
 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
 
-SUBDIRS = po
+# Build '.' first so all generated files exist.
+SUBDIRS = . po
 
 INCDIR = $(srcdir)/../include
 BFDDIR = $(srcdir)/../bfd
@@ -12,27 +13,34 @@ WARN_CFLAGS = @WARN_CFLAGS@
 NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS)
 
-bfdlibdir = @bfdlibdir@
-bfdincludedir = @bfdincludedir@
+COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CFLAGS_FOR_BUILD)
+LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
+       $(LDFLAGS_FOR_BUILD) -o $@
 
 libopcodes_la_LDFLAGS =
 if INSTALL_LIBBFD
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libopcodes.la
 bfdinclude_DATA = $(INCDIR)/dis-asm.h
 else
+# Empty these so that the respective installation directories will not be created.
+bfdlibdir =
+bfdincludedir =
+rpath_bfdlibdir = @bfdlibdir@
 noinst_LTLIBRARIES = libopcodes.la
-libopcodes_la_LDFLAGS += -rpath $(bfdlibdir)
+libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
 # This is where bfd.h lives.
 BFD_H = ../bfd/bfd.h
 
-# This is where libiberty lives.
-LIBIBERTY = ../libiberty/libiberty.a
+BUILD_LIBS = @BUILD_LIBS@
+BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
 
 # Header files.
 HFILES = \
-       cgen-ops.h cgen-types.h \
        fr30-desc.h fr30-opc.h \
        frv-desc.h frv-opc.h \
        h8500-opc.h \
@@ -179,6 +187,8 @@ TARGET_LIBOPCODES_CFILES = \
        pj-opc.c \
        ppc-dis.c \
        ppc-opc.c \
+       rx-decode.c \
+       rx-dis.c \
        s390-dis.c \
        s390-opc.c \
        score-dis.c \
@@ -312,32 +322,32 @@ CGENDEPS = \
        $(CGENDIR)/opc-opinst.scm \
        cgen-asm.in cgen-dis.in cgen-ibld.in
 
-CGEN_CPUS = fr30 frv ip2k m32c m32r mep mt openrisc xc16x xstormy16
+CGEN_CPUS = fr30 frv ip2k iq2000 lm32 m32c m32r mep mt openrisc xc16x xstormy16
 
 if CGEN_MAINT
+FR30_DEPS = stamp-fr30
+FRV_DEPS = stamp-frv
 IP2K_DEPS = stamp-ip2k
+IQ2000_DEPS = stamp-iq2000
 LM32_DEPS = stamp-lm32
 M32C_DEPS = stamp-m32c
 M32R_DEPS = stamp-m32r
-FR30_DEPS = stamp-fr30
-FRV_DEPS = stamp-frv
 MEP_DEPS = stamp-mep
 MT_DEPS = stamp-mt
 OPENRISC_DEPS = stamp-openrisc
-IQ2000_DEPS = stamp-iq2000
 XC16X_DEPS = stamp-xc16x
 XSTORMY16_DEPS = stamp-xstormy16
 else
+FR30_DEPS =
+FRV_DEPS =
 IP2K_DEPS =
+IQ2000_DEPS = 
 LM32_DEPS = 
 M32C_DEPS =
 M32R_DEPS =
-FR30_DEPS =
-FRV_DEPS =
 MEP_DEPS =
 MT_DEPS =
 OPENRISC_DEPS = 
-IQ2000_DEPS = 
 XC16X_DEPS = 
 XSTORMY16_DEPS = 
 endif
@@ -358,12 +368,34 @@ run-cgen-all:
 .PHONY: run-cgen-all
 
 # For now, require developers to configure with --enable-cgen-maint.
+
+$(srcdir)/fr30-desc.h $(srcdir)/fr30-desc.c $(srcdir)/fr30-opc.h $(srcdir)/fr30-opc.c $(srcdir)/fr30-ibld.c $(srcdir)/fr30-asm.c $(srcdir)/fr30-dis.c: $(FR30_DEPS)
+       @true
+stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.cpu $(CPUDIR)/fr30.opc
+       $(MAKE) run-cgen arch=fr30 prefix=fr30 options= \
+               archfile=$(CPUDIR)/fr30.cpu opcfile=$(CPUDIR)/fr30.opc extrafiles=
+
+$(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS)
+       @true
+stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc
+       $(MAKE) run-cgen arch=frv prefix=frv options= \
+               archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles=
+
 $(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k-opc.c $(srcdir)/ip2k-ibld.c $(srcdir)/ip2k-asm.c $(srcdir)/ip2k-dis.c: $(IP2K_DEPS)
        @true
 stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc
        $(MAKE) run-cgen arch=ip2k prefix=ip2k options= \
                archfile=$(CPUDIR)/ip2k.cpu opcfile=$(CPUDIR)/ip2k.opc extrafiles=
 
+$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS)
+       @true
+stamp-iq2000: $(CGENDEPS) $(srcdir)/../cpu/iq2000.cpu \
+               $(srcdir)/../cpu/iq2000.opc $(srcdir)/../cpu/iq2000m.cpu \
+               $(srcdir)/../cpu/iq10.cpu
+       $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= \
+               archfile=$(srcdir)/../cpu/iq2000.cpu \
+               opcfile=$(srcdir)/../cpu/iq2000.opc extrafiles=
+
 $(srcdir)lm32-desc.h $(srcdir)/lm32-desc.c $(srcdir)/lm32-opc.h $(srcdir)/lm32-opc.c $(srcdir)/lm32-ibld.c $(srcdir)/lm32-opinst.c $(srcdir)/lm32-asm.c $(srcdir)/lm32-dis.c: $(LM32_DEPS)
        @true
 stamp-lm32: $(CGENDEPS) $(srcdir)/../cpu/lm32.cpu $(srcdir)/../cpu/lm32.opc
@@ -386,18 +418,6 @@ stamp-m32r: $(CGENDEPS) $(srcdir)/../cpu/m32r.cpu $(srcdir)/../cpu/m32r.opc
                archfile=$(srcdir)/../cpu/m32r.cpu \
                opcfile=$(srcdir)/../cpu/m32r.opc extrafiles=opinst
 
-$(srcdir)/fr30-desc.h $(srcdir)/fr30-desc.c $(srcdir)/fr30-opc.h $(srcdir)/fr30-opc.c $(srcdir)/fr30-ibld.c $(srcdir)/fr30-asm.c $(srcdir)/fr30-dis.c: $(FR30_DEPS)
-       @true
-stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.cpu $(CPUDIR)/fr30.opc
-       $(MAKE) run-cgen arch=fr30 prefix=fr30 options= \
-               archfile=$(CPUDIR)/fr30.cpu opcfile=$(CPUDIR)/fr30.opc extrafiles=
-
-$(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS)
-       @true
-stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc
-       $(MAKE) run-cgen arch=frv prefix=frv options= \
-               archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles=
-
 $(srcdir)/mep-desc.h $(srcdir)/mep-desc.c $(srcdir)/mep-opc.h $(srcdir)/mep-opc.c $(srcdir)/mep-ibld.c $(srcdir)/mep-asm.c $(srcdir)/mep-dis.c: $(MEP_DEPS)
        @true
 stamp-mep: $(CGENDEPS) $(CPUDIR)/mep.cpu $(CPUDIR)/mep-default.cpu $(CPUDIR)/mep-core.cpu $(CPUDIR)/mep-h1.cpu $(CPUDIR)/mep-ext-cop.cpu $(CPUDIR)/mep-sample-ucidsp.cpu $(CPUDIR)/mep-rhcop.cpu $(CPUDIR)/mep-fmax.cpu $(CPUDIR)/mep.opc
@@ -417,14 +437,13 @@ stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc
        $(MAKE) run-cgen arch=openrisc prefix=openrisc options= \
                archfile=$(CPUDIR)/openrisc.cpu opcfile=$(CPUDIR)/openrisc.opc extrafiles=
 
-$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS)
+$(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-iq2000: $(CGENDEPS) $(srcdir)/../cpu/iq2000.cpu \
-               $(srcdir)/../cpu/iq2000.opc $(srcdir)/../cpu/iq2000m.cpu \
-               $(srcdir)/../cpu/iq10.cpu
-       $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= \
-               archfile=$(srcdir)/../cpu/iq2000.cpu \
-               opcfile=$(srcdir)/../cpu/iq2000.opc extrafiles=
+stamp-xc16x: $(CGENDEPS) $(srcdir)/../cpu/xc16x.cpu $(srcdir)/../cpu/xc16x.opc
+       $(MAKE) run-cgen arch=xc16x prefix=xc16x options= \
+               archfile=$(srcdir)/../cpu/xc16x.cpu \
+               opcfile=$(srcdir)/../cpu/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
@@ -432,37 +451,78 @@ stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
        $(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= \
                archfile=$(CPUDIR)/xstormy16.cpu opcfile=$(CPUDIR)/xstormy16.opc extrafiles=
 
-$(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=
+MOSTLYCLEANFILES = i386-gen$(EXEEXT_FOR_BUILD) ia64-gen$(EXEEXT_FOR_BUILD) \
+       s390-mkopc$(EXEEXT_FOR_BUILD) z8kgen$(EXEEXT_FOR_BUILD) \
+       opc2c$(EXEEXT_FOR_BUILD)
+
+MAINTAINERCLEANFILES = $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h \
+       $(srcdir)/ia64-asmtab.c s390-opc.tab $(srcdir)/z8k-opc.h \
+       $(srcdir)/rx-decode.c
 
-i386-gen: i386-gen.o
-       $(LINK) i386-gen.o $(LIBIBERTY)
+i386-gen$(EXEEXT_FOR_BUILD): i386-gen.o $(BUILD_LIB_DEPS)
+       $(LINK_FOR_BUILD) i386-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
+       $(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
 
 $(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h 
        @echo $@
 
-$(srcdir)/i386-init.h: @MAINT@ i386-gen i386-opc.tbl i386-reg.tbl
-       ./i386-gen --srcdir $(srcdir)
+$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl
+       ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
+
+i386-opc.lo: $(srcdir)/i386-tbl.h
 
-ia64-gen: ia64-gen.o
-       $(LINK) ia64-gen.o $(LIBIBERTY)
+ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS)
+       $(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS)
 
-# Don't wrap the line below, as @MAINT@ can be expanded to '#'.
-# Some make versions don't handle line continuations in comments.
-$(srcdir)/ia64-asmtab.c: @MAINT@ ia64-gen ia64-ic.tbl ia64-raw.tbl ia64-waw.tbl ia64-war.tbl
-       ./ia64-gen --srcdir $(srcdir) > $@
+ia64-gen.o: ia64-gen.c $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h \
+       $(INCDIR)/libiberty.h $(INCDIR)/opcode/ia64.h $(INCDIR)/safe-ctype.h \
+       $(INCDIR)/symcat.h config.h ia64-opc-a.c ia64-opc-b.c \
+       ia64-opc-d.c ia64-opc-f.c ia64-opc-i.c ia64-opc-m.c \
+       ia64-opc-x.c ia64-opc.h sysdep.h
+       $(COMPILE_FOR_BUILD) -c $(srcdir)/ia64-gen.c
 
-s390-mkopc: s390-mkopc.c
-       $(CC_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
+# Use a helper variable for the dependencies to avoid 'make' issues
+# with continuations in comments, as @MAINT@ can be expanded to '#'.
+ia64_asmtab_deps = ia64-gen$(EXEEXT_FOR_BUILD) ia64-ic.tbl \
+       ia64-raw.tbl ia64-waw.tbl ia64-war.tbl
+$(srcdir)/ia64-asmtab.c: @MAINT@ $(ia64_asmtab_deps)
+       ./ia64-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir) > $@
 
-s390-opc.tab: s390-mkopc s390-opc.txt
-       ./s390-mkopc < $(srcdir)/s390-opc.txt > s390-opc.tab
+ia64-opc.lo: $(srcdir)/ia64-asmtab.c
+
+$(srcdir)/rx-decode.c: @MAINT@ $(srcdir)/rx-decode.opc opc2c$(EXEEXT_FOR_BUILD)
+       ./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
+
+opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
+       $(LINK_FOR_BUILD) opc2c.o $(BUILD_LIBS)
+
+opc2c.o: opc2c.c $(INCDIR)/libiberty.h
+       $(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
+
+s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
+       $(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
+
+s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt
+       ./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab
 
 s390-opc.lo: s390-opc.tab
 
+z8kgen$(EXEEXT_FOR_BUILD): z8kgen.o $(BUILD_LIB_DEPS)
+       $(LINK_FOR_BUILD) z8kgen.o $(BUILD_LIBS)
+
+z8kgen.o: z8kgen.c
+       $(COMPILE_FOR_BUILD) -c $(srcdir)/z8kgen.c
+
+$(srcdir)/z8k-opc.h: @MAINT@ z8kgen$(EXEEXT_FOR_BUILD)
+       ./z8kgen$(EXEEXT_FOR_BUILD) -a > $@
+
+z8k-dis.lo: $(srcdir)/z8k-opc.h
+
 sh-dis.lo: sh-dis.c
 if am__fastdepCC
        $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ @archdefs@ $(srcdir)/sh-dis.c
This page took 0.02606 seconds and 4 git commands to generate.