1## Process this file with automake to generate Makefile.in
2#
3#   Copyright (C) 2012-2018 Free Software Foundation, Inc.
4#
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; see the file COPYING3.  If not see
17# <http://www.gnu.org/licenses/>.
18#
19
20AUTOMAKE_OPTIONS = foreign no-dist
21ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
22
23# Build '.' first so all generated files exist.
24SUBDIRS = . po
25
26INCDIR = $(srcdir)/../include
27BFDDIR = $(srcdir)/../bfd
28
29WARN_CFLAGS = @WARN_CFLAGS@
30NO_WERROR = @NO_WERROR@
31NO_WMISSING_FIELD_INITIALIZERS = @NO_WMISSING_FIELD_INITIALIZERS@
32AM_CFLAGS = $(WARN_CFLAGS)
33
34COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(INCLUDES) $(AM_CPPFLAGS) \
35	$(CFLAGS_FOR_BUILD)
36LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
37	$(LDFLAGS_FOR_BUILD) -o $@
38
39libopcodes_la_LDFLAGS =
40if INSTALL_LIBBFD
41bfdlibdir = @bfdlibdir@
42bfdincludedir = @bfdincludedir@
43bfdlib_LTLIBRARIES = libopcodes.la
44bfdinclude_DATA = $(INCDIR)/dis-asm.h
45else
46# Empty these so that the respective installation directories will not be created.
47bfdlibdir =
48bfdincludedir =
49rpath_bfdlibdir = @bfdlibdir@
50noinst_LTLIBRARIES = libopcodes.la
51libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
52endif
53
54# This is where bfd.h lives.
55BFD_H = ../bfd/bfd.h
56
57BUILD_LIBS = @BUILD_LIBS@
58BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
59
60# Header files.
61HFILES = \
62	aarch64-asm.h aarch64-dis.h aarch64-opc.h aarch64-tbl.h \
63	epiphany-desc.h epiphany-opc.h \
64	fr30-desc.h fr30-opc.h \
65	frv-desc.h frv-opc.h \
66	i386-init.h \
67	i386-opc.h \
68	i386-tbl.h \
69	ia64-asmtab.h \
70	ia64-opc.h \
71	ip2k-desc.h ip2k-opc.h \
72	iq2000-desc.h iq2000-opc.h \
73	lm32-desc.h \
74	lm32-opc.h \
75	m32c-desc.h m32c-opc.h \
76	m32r-desc.h m32r-opc.h \
77	mcore-opc.h \
78	mep-desc.h mep-opc.h \
79	microblaze-opc.h \
80	mt-desc.h mt-opc.h \
81	or1k-desc.h or1k-opc.h \
82	score-opc.h \
83	sh-opc.h \
84	sysdep.h \
85	xc16x-desc.h xc16x-opc.h \
86	xstormy16-desc.h xstormy16-opc.h \
87	z8k-opc.h
88
89# C source files that correspond to .o's ending up in libopcodes
90# for all machines.
91TARGET_LIBOPCODES_CFILES = \
92	aarch64-asm.c \
93	aarch64-asm-2.c \
94	aarch64-dis.c \
95	aarch64-dis-2.c \
96	aarch64-opc.c \
97	aarch64-opc-2.c \
98	alpha-dis.c \
99	alpha-opc.c \
100	arc-dis.c \
101	arc-ext.c \
102	arc-opc.c \
103	arm-dis.c \
104	avr-dis.c \
105	bfin-dis.c \
106	cgen-asm.c \
107	cgen-bitset.c \
108	cgen-dis.c \
109	cgen-opc.c \
110	cr16-dis.c \
111	cr16-opc.c \
112	cris-dis.c \
113	cris-opc.c \
114	crx-dis.c \
115	crx-opc.c \
116	d10v-dis.c \
117	d10v-opc.c \
118	d30v-dis.c \
119	d30v-opc.c \
120	dlx-dis.c \
121	epiphany-asm.c \
122	epiphany-desc.c \
123	epiphany-dis.c \
124	epiphany-ibld.c \
125	epiphany-opc.c \
126	fr30-asm.c \
127	fr30-desc.c \
128	fr30-dis.c \
129	fr30-ibld.c \
130	fr30-opc.c \
131	frv-asm.c \
132	frv-desc.c \
133	frv-dis.c \
134	frv-ibld.c \
135	frv-opc.c \
136	ft32-dis.c \
137	ft32-opc.c \
138	h8300-dis.c \
139	hppa-dis.c \
140	i386-dis.c \
141	i386-opc.c \
142	ia64-dis.c \
143	ia64-opc.c \
144	ip2k-asm.c \
145	ip2k-desc.c \
146	ip2k-dis.c \
147	ip2k-ibld.c \
148	ip2k-opc.c \
149	iq2000-asm.c \
150	iq2000-desc.c \
151	iq2000-dis.c \
152	iq2000-ibld.c \
153	iq2000-opc.c \
154	lm32-asm.c \
155	lm32-desc.c \
156	lm32-dis.c \
157	lm32-ibld.c \
158	lm32-opc.c \
159	lm32-opinst.c \
160	m10200-dis.c \
161	m10200-opc.c \
162	m10300-dis.c \
163	m10300-opc.c \
164	m32c-asm.c \
165	m32c-desc.c \
166	m32c-dis.c \
167	m32c-ibld.c \
168	m32c-opc.c \
169	m32r-asm.c \
170	m32r-desc.c \
171	m32r-dis.c \
172	m32r-ibld.c \
173	m32r-opc.c \
174	m32r-opinst.c \
175	m68hc11-dis.c \
176	m68hc11-opc.c \
177	m68k-dis.c \
178	m68k-opc.c \
179	s12z-dis.c \
180	mcore-dis.c \
181	mep-asm.c \
182	mep-desc.c \
183	mep-dis.c \
184	mep-ibld.c \
185	mep-opc.c \
186	metag-dis.c \
187	microblaze-dis.c \
188	micromips-opc.c \
189	mips-dis.c \
190	mips-opc.c \
191	mips16-opc.c \
192	mmix-dis.c \
193	mmix-opc.c \
194	moxie-dis.c \
195	moxie-opc.c \
196	msp430-decode.c \
197	msp430-dis.c \
198	mt-asm.c \
199	mt-desc.c \
200	mt-dis.c \
201	mt-ibld.c \
202	mt-opc.c \
203	nds32-asm.c \
204	nds32-dis.c \
205	nfp-dis.c \
206	nios2-dis.c \
207	nios2-opc.c \
208	ns32k-dis.c \
209	or1k-asm.c \
210	or1k-desc.c \
211	or1k-dis.c \
212	or1k-ibld.c \
213	or1k-opc.c \
214	pdp11-dis.c \
215	pdp11-opc.c \
216	pj-dis.c \
217	pj-opc.c \
218	ppc-dis.c \
219	ppc-opc.c \
220	pru-dis.c \
221	pru-opc.c \
222	riscv-dis.c \
223	riscv-opc.c \
224	rl78-decode.c \
225	rl78-dis.c \
226	rx-decode.c \
227	rx-dis.c \
228	s390-dis.c \
229	s390-opc.c \
230	score-dis.c \
231	score7-dis.c \
232	sh-dis.c \
233	sparc-dis.c \
234	sparc-opc.c \
235	spu-dis.c \
236	spu-opc.c \
237	tic30-dis.c \
238	tic4x-dis.c \
239	tic54x-dis.c \
240	tic54x-opc.c \
241	tic6x-dis.c \
242	tic80-dis.c \
243	tic80-opc.c \
244	tilegx-dis.c \
245	tilegx-opc.c \
246	tilepro-dis.c \
247	tilepro-opc.c \
248	v850-dis.c \
249	v850-opc.c \
250	vax-dis.c \
251	visium-dis.c \
252	visium-opc.c \
253	wasm32-dis.c \
254	xc16x-asm.c \
255	xc16x-desc.c \
256	xc16x-dis.c \
257	xc16x-ibld.c \
258	xc16x-opc.c \
259	xstormy16-asm.c \
260	xstormy16-desc.c \
261	xstormy16-dis.c \
262	xstormy16-ibld.c \
263	xstormy16-opc.c \
264	xtensa-dis.c \
265	xgate-dis.c \
266	xgate-opc.c \
267	z80-dis.c \
268	z8k-dis.c
269
270# C source files that correspond to .o's ending up in libopcodes.
271LIBOPCODES_CFILES = \
272	$(TARGET_LIBOPCODES_CFILES) \
273	dis-buf.c \
274	dis-init.c \
275	disassemble.c
276
277# C source files that correspond to .o's.
278CFILES = \
279	$(LIBOPCODES_CFILES) \
280	aarch64-gen.c \
281	i386-gen.c \
282	ia64-asmtab.c \
283	ia64-gen.c \
284	ia64-opc-a.c \
285	ia64-opc-b.c \
286	ia64-opc-f.c \
287	ia64-opc-i.c \
288	ia64-opc-m.c \
289	ia64-opc-d.c \
290	s390-mkopc.c \
291	z8kgen.c
292
293ALL_MACHINES = $(TARGET_LIBOPCODES_CFILES:.c=.lo)
294
295OFILES = @BFD_MACHINES@
296
297# development.sh is used to determine -Werror default.
298CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
299
300AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
301
302disassemble.lo: disassemble.c
303if am__fastdepCC
304	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ @archdefs@ $(srcdir)/disassemble.c
305	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
306else
307if AMDEP
308	source='disassemble.c' object='$@' libtool=yes @AMDEPBACKSLASH@
309	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
310endif
311	$(LTCOMPILE) -c -o $@ @archdefs@ $(srcdir)/disassemble.c
312endif
313
314libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
315# It's desirable to list ../bfd/libbfd.la in DEPENDENCIES and LIBADD.
316# Unfortunately this causes libtool to add -L$(libdir), referring to the
317# planned install directory of libbfd.  This can cause us to pick up an
318# old version of libbfd, or to pick up libbfd for the wrong architecture
319# if host != build. So for building with shared libraries we use a
320# hardcoded path to libbfd.so instead of relying on the entries in libbfd.la.
321libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
322libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
323libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
324# Allow dependency tracking to work on all the source files.
325EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
326
327# libtool will build .libs/libopcodes.a.  We create libopcodes.a in
328# the build directory so that we don't have to convert all the
329# programs that use libopcodes.a simultaneously.  This is a hack which
330# should be removed if everything else starts using libtool.  FIXME.
331
332noinst_LIBRARIES = libopcodes.a
333libopcodes_a_SOURCES =
334
335stamp-lib: libopcodes.la
336	libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
337	if [ -f $$libtooldir/libopcodes.a ]; then \
338	  cp $$libtooldir/libopcodes.a libopcodes.tmp; \
339	  $(RANLIB) libopcodes.tmp; \
340	  $(SHELL) $(srcdir)/../move-if-change libopcodes.tmp libopcodes.a; \
341	else true; fi
342	touch stamp-lib
343
344libopcodes.a: stamp-lib ; @true
345
346POTFILES = $(HFILES) $(CFILES)
347po/POTFILES.in: @MAINT@ Makefile
348	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
349	  && mv tmp $(srcdir)/po/POTFILES.in
350
351CLEANFILES = \
352	stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \
353	stamp-m32c stamp-m32r stamp-mep stamp-mt \
354	stamp-or1k stamp-xc16x stamp-xstormy16 \
355	libopcodes.a stamp-lib
356
357
358CGENDIR = @cgendir@
359CPUDIR = $(srcdir)/../cpu
360CGEN = "`if test -f ../guile/libguile/guile ; then echo ../guile/libguile/guile; else echo guile ; fi` -l ${cgendir}/guile.scm -s"
361CGENFLAGS = -v
362
363CGENDEPS = \
364	$(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm \
365	$(CGENDIR)/opcodes.scm $(CGENDIR)/opc-asmdis.scm \
366	$(CGENDIR)/opc-ibld.scm $(CGENDIR)/opc-itab.scm \
367	$(CGENDIR)/opc-opinst.scm \
368	cgen-asm.in cgen-dis.in cgen-ibld.in
369
370CGEN_CPUS = epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt or1k xc16x xstormy16
371
372if CGEN_MAINT
373EPIPHANY_DEPS = stamp-epiphany
374FR30_DEPS = stamp-fr30
375FRV_DEPS = stamp-frv
376IP2K_DEPS = stamp-ip2k
377IQ2000_DEPS = stamp-iq2000
378LM32_DEPS = stamp-lm32
379M32C_DEPS = stamp-m32c
380M32R_DEPS = stamp-m32r
381MEP_DEPS = stamp-mep
382MT_DEPS = stamp-mt
383OR1K_DEPS = stamp-or1k
384XC16X_DEPS = stamp-xc16x
385XSTORMY16_DEPS = stamp-xstormy16
386else
387EPIPHANY_DEPS =
388FR30_DEPS =
389FRV_DEPS =
390IP2K_DEPS =
391IQ2000_DEPS =
392LM32_DEPS =
393M32C_DEPS =
394M32R_DEPS =
395MEP_DEPS =
396MT_DEPS =
397OR1K_DEPS =
398XC16X_DEPS =
399XSTORMY16_DEPS =
400endif
401
402run-cgen:
403	$(SHELL) $(srcdir)/cgen.sh opcodes $(srcdir) $(CGEN) \
404	  $(CGENDIR) "$(CGENFLAGS)" $(arch) $(prefix) $(archfile) $(opcfile) \
405	  "$(options)" "$(extrafiles)"
406	touch stamp-${prefix}
407.PHONY: run-cgen
408
409# Maintainer utility rule to regenerate all cgen files.
410run-cgen-all:
411	for c in $(CGEN_CPUS) ; \
412	do \
413		$(MAKE) stamp-$$c || exit 1 ; \
414	done
415.PHONY: run-cgen-all
416
417# For now, require developers to configure with --enable-cgen-maint.
418
419$(srcdir)/epiphany-desc.h $(srcdir)/epiphany-desc.c $(srcdir)/epiphany-opc.h \
420		$(srcdir)/epiphany-opc.c $(srcdir)/epiphany-ibld.c \
421		$(srcdir)/epiphany-opinst.c $(srcdir)/epiphany-asm.c \
422		$(srcdir)/epiphany-dis.c: $(EPIPHANY_DEPS)
423	@true
424
425stamp-epiphany: $(CGENDEPS) $(CPUDIR)/epiphany.cpu $(CPUDIR)/epiphany.opc
426	$(MAKE) run-cgen arch=epiphany prefix=epiphany options= \
427		archfile=$(CPUDIR)/epiphany.cpu opcfile=$(CPUDIR)/epiphany.opc extrafiles=
428
429$(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)
430	@true
431stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.cpu $(CPUDIR)/fr30.opc
432	$(MAKE) run-cgen arch=fr30 prefix=fr30 options= \
433		archfile=$(CPUDIR)/fr30.cpu opcfile=$(CPUDIR)/fr30.opc extrafiles=
434
435$(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)
436	@true
437stamp-frv: $(CGENDEPS) $(CPUDIR)/frv.cpu $(CPUDIR)/frv.opc
438	$(MAKE) run-cgen arch=frv prefix=frv options= \
439		archfile=$(CPUDIR)/frv.cpu opcfile=$(CPUDIR)/frv.opc extrafiles=
440
441$(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)
442	@true
443stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc
444	$(MAKE) run-cgen arch=ip2k prefix=ip2k options= \
445		archfile=$(CPUDIR)/ip2k.cpu opcfile=$(CPUDIR)/ip2k.opc extrafiles=
446
447$(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)
448	@true
449stamp-iq2000: $(CGENDEPS) $(CPUDIR)/iq2000.cpu \
450		$(CPUDIR)/iq2000.opc $(CPUDIR)/iq2000m.cpu \
451		$(CPUDIR)/iq10.cpu
452	$(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= \
453		archfile=$(CPUDIR)/iq2000.cpu \
454		opcfile=$(CPUDIR)/iq2000.opc extrafiles=
455
456$(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)
457	@true
458stamp-lm32: $(CGENDEPS) $(CPUDIR)/lm32.cpu $(CPUDIR)/lm32.opc
459	$(MAKE) run-cgen arch=lm32 prefix=lm32 options=opinst \
460		archfile=$(CPUDIR)/lm32.cpu \
461		opcfile=$(CPUDIR)/lm32.opc \
462		extrafiles=opinst
463
464$(srcdir)/m32c-desc.h $(srcdir)/m32c-desc.c $(srcdir)/m32c-opc.h $(srcdir)/m32c-opc.c $(srcdir)/m32c-ibld.c $(srcdir)/m32c-asm.c $(srcdir)/m32c-dis.c: $(M32C_DEPS)
465	@true
466stamp-m32c: $(CGENDEPS) $(CPUDIR)/m32c.cpu $(CPUDIR)/m32c.opc
467	$(MAKE) run-cgen arch=m32c prefix=m32c options= \
468		archfile=$(CPUDIR)/m32c.cpu \
469		opcfile=$(CPUDIR)/m32c.opc extrafiles=
470
471$(srcdir)/m32r-desc.h $(srcdir)/m32r-desc.c $(srcdir)/m32r-opc.h $(srcdir)/m32r-opc.c $(srcdir)/m32r-ibld.c $(srcdir)/m32r-opinst.c $(srcdir)/m32r-asm.c $(srcdir)/m32r-dis.c: $(M32R_DEPS)
472	@true
473stamp-m32r: $(CGENDEPS) $(CPUDIR)/m32r.cpu $(CPUDIR)/m32r.opc
474	$(MAKE) run-cgen arch=m32r prefix=m32r options=opinst \
475		archfile=$(CPUDIR)/m32r.cpu \
476		opcfile=$(CPUDIR)/m32r.opc extrafiles=opinst
477
478$(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)
479	@true
480stamp-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
481	$(MAKE) run-cgen arch=mep prefix=mep options= \
482		archfile=$(CPUDIR)/mep.cpu opcfile=$(CPUDIR)/mep.opc extrafiles=
483
484$(srcdir)/mt-desc.h $(srcdir)/mt-desc.c $(srcdir)/mt-opc.h $(srcdir)/mt-opc.c $(srcdir)/mt-ibld.c $(srcdir)/mt-asm.c $(srcdir)/mt-dis.c: $(MT_DEPS)
485	@true
486stamp-mt: $(CGENDEPS) $(CPUDIR)/mt.cpu $(CPUDIR)/mt.opc
487	$(MAKE) run-cgen arch=mt prefix=mt options= \
488		archfile=$(CPUDIR)/mt.cpu \
489		opcfile=$(CPUDIR)/mt.opc extrafiles=
490
491$(srcdir)/or1k-desc.h $(srcdir)/or1k-desc.c $(srcdir)/or1k-opc.h $(srcdir)/or1k-opc.c $(srcdir)/or1k-ibld.c $(srcdir)/or1k-opinst.c $(srcdir)/or1k-asm.c $(srcdir)/or1k-dis.c: $(OR1K_DEPS)
492	@true
493stamp-or1k: $(CGENDEPS) $(CPUDIR)/or1k.cpu $(CPUDIR)/or1k.opc $(CPUDIR)/or1kcommon.cpu $(CPUDIR)/or1korbis.cpu $(CPUDIR)/or1korfpx.cpu
494	$(MAKE) run-cgen arch=or1k prefix=or1k options=opinst \
495		archfile=$(CPUDIR)/or1k.cpu opcfile=$(CPUDIR)/or1k.opc extrafiles=opinst
496
497$(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)
498	@true
499stamp-xc16x: $(CGENDEPS) $(CPUDIR)/xc16x.cpu $(CPUDIR)/xc16x.opc
500	$(MAKE) run-cgen arch=xc16x prefix=xc16x options= \
501		archfile=$(CPUDIR)/xc16x.cpu \
502		opcfile=$(CPUDIR)/xc16x.opc \
503		extrafiles=
504
505$(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)
506	@true
507stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
508	$(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= \
509		archfile=$(CPUDIR)/xstormy16.cpu opcfile=$(CPUDIR)/xstormy16.opc extrafiles=
510
511MOSTLYCLEANFILES = aarch64-gen$(EXEEXT_FOR_BUILD) i386-gen$(EXEEXT_FOR_BUILD) \
512	ia64-gen$(EXEEXT_FOR_BUILD) s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.tab \
513	z8kgen$(EXEEXT_FOR_BUILD) opc2c$(EXEEXT_FOR_BUILD)
514
515MAINTAINERCLEANFILES = $(srcdir)/aarch64-asm-2.c $(srcdir)/aarch64-dis-2.c \
516	$(srcdir)/aarch64-opc-2.c $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h \
517	$(srcdir)/ia64-asmtab.c $(srcdir)/z8k-opc.h \
518	$(srcdir)/msp430-decode.c \
519	$(srcdir)/rl78-decode.c \
520	$(srcdir)/rx-decode.c
521
522aarch64-gen$(EXEEXT_FOR_BUILD): aarch64-gen.o $(BUILD_LIB_DEPS)
523	$(LINK_FOR_BUILD) aarch64-gen.o $(BUILD_LIBS)
524
525aarch64-gen.o: aarch64-gen.c $(BFD_H) $(INCDIR)/getopt.h $(INCDIR)/libiberty.h\
526	$(INCDIR)/opcode/aarch64.h config.h aarch64-opc.h aarch64-tbl.h
527	$(COMPILE_FOR_BUILD) -c $(srcdir)/aarch64-gen.c
528
529$(srcdir)/aarch64-asm-2.c: @MAINT@ aarch64-gen$(exeext_for_build)
530	./aarch64-gen$(exeext_for_build) --gen-asm > $@
531$(srcdir)/aarch64-dis-2.c: @MAINT@ aarch64-gen$(exeext_for_build)
532	./aarch64-gen$(exeext_for_build) --gen-dis > $@
533$(srcdir)/aarch64-opc-2.c: @MAINT@ aarch64-gen$(exeext_for_build)
534	./aarch64-gen$(exeext_for_build) --gen-opc > $@
535
536i386-gen$(EXEEXT_FOR_BUILD): i386-gen.o $(BUILD_LIB_DEPS)
537	$(LINK_FOR_BUILD) i386-gen.o $(BUILD_LIBS)
538
539i386-gen.o: i386-gen.c i386-opc.h $(srcdir)/../include/opcode/i386.h \
540	$(INCDIR)/ansidecl.h $(INCDIR)/getopt.h $(INCDIR)/hashtab.h \
541	$(INCDIR)/libiberty.h $(INCDIR)/opcode/i386.h $(INCDIR)/safe-ctype.h \
542	config.h i386-opc.h sysdep.h
543	$(COMPILE_FOR_BUILD) -c $(srcdir)/i386-gen.c
544
545$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
546	@echo $@
547
548$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl
549	./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
550
551i386-opc.lo: $(srcdir)/i386-tbl.h
552
553ia64-gen$(EXEEXT_FOR_BUILD): ia64-gen.o $(BUILD_LIB_DEPS)
554	$(LINK_FOR_BUILD) ia64-gen.o $(BUILD_LIBS)
555
556ia64-gen.o: ia64-gen.c $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h \
557	$(INCDIR)/libiberty.h $(INCDIR)/opcode/ia64.h $(INCDIR)/safe-ctype.h \
558	$(INCDIR)/symcat.h config.h ia64-opc-a.c ia64-opc-b.c \
559	ia64-opc-d.c ia64-opc-f.c ia64-opc-i.c ia64-opc-m.c \
560	ia64-opc-x.c ia64-opc.h sysdep.h
561	$(COMPILE_FOR_BUILD) -c $(srcdir)/ia64-gen.c
562
563# Use a helper variable for the dependencies to avoid 'make' issues
564# with continuations in comments, as @MAINT@ can be expanded to '#'.
565ia64_asmtab_deps = ia64-gen$(EXEEXT_FOR_BUILD) ia64-ic.tbl \
566	ia64-raw.tbl ia64-waw.tbl ia64-war.tbl
567$(srcdir)/ia64-asmtab.c: @MAINT@ $(ia64_asmtab_deps)
568	./ia64-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir) > $@
569
570ia64-opc.lo: $(srcdir)/ia64-asmtab.c
571
572$(srcdir)/msp430-decode.c: @MAINT@ $(srcdir)/msp430-decode.opc opc2c$(EXEEXT_FOR_BUILD)
573	./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/msp430-decode.opc > $(srcdir)/msp430-decode.c
574
575$(srcdir)/rl78-decode.c: @MAINT@ $(srcdir)/rl78-decode.opc opc2c$(EXEEXT_FOR_BUILD)
576	./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/rl78-decode.opc > $(srcdir)/rl78-decode.c
577
578$(srcdir)/rx-decode.c: @MAINT@ $(srcdir)/rx-decode.opc opc2c$(EXEEXT_FOR_BUILD)
579	./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
580
581opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
582	$(LINK_FOR_BUILD) opc2c.o $(BUILD_LIBS)
583
584opc2c.o: opc2c.c $(INCDIR)/libiberty.h
585	$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
586
587s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
588	$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
589
590s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt
591	./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab
592
593s390-opc.lo: s390-opc.tab
594
595z8kgen$(EXEEXT_FOR_BUILD): z8kgen.o $(BUILD_LIB_DEPS)
596	$(LINK_FOR_BUILD) z8kgen.o $(BUILD_LIBS)
597
598z8kgen.o: z8kgen.c
599	$(COMPILE_FOR_BUILD) -c $(srcdir)/z8kgen.c
600
601$(srcdir)/z8k-opc.h: @MAINT@ z8kgen$(EXEEXT_FOR_BUILD)
602	./z8kgen$(EXEEXT_FOR_BUILD) -a > $@
603
604z8k-dis.lo: $(srcdir)/z8k-opc.h
605
606MIPS_DEFS=`case \`cat ../bfd/ofiles\` in *elfxx-mips*) echo "-DHAVE_BFD_MIPS_ELF_GET_ABIFLAGS=1";; esac`
607mips-dis.lo: mips-dis.c
608if am__fastdepCC
609	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $(MIPS_DEFS) $<
610	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
611else
612if AMDEP
613	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
614	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
615endif
616	$(LTCOMPILE) -c -o $@ $(MIPS_DEFS) $<
617endif
618
619sh-dis.lo: sh-dis.c
620if am__fastdepCC
621	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ @archdefs@ $(srcdir)/sh-dis.c
622	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
623else
624if AMDEP
625	source='sh-dis.c' object='$@' libtool=yes @AMDEPBACKSLASH@
626	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
627endif
628	$(LTCOMPILE) -c -o $@ @archdefs@ $(srcdir)/sh-dis.c
629endif
630