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