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