* Makefile.am (bfin-parse.o): Remove bfin-parse.h from
[external/binutils.git] / gas / Makefile.am
1 ## Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = 1.11 dejagnu foreign no-dist
4 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
5
6 SUBDIRS = doc po
7
8 tooldir = $(exec_prefix)/$(target_alias)
9
10 YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi`
11 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
12
13 # Automake 1.10+ disables lex and yacc output file regeneration if
14 # maintainer mode is disabled.  Avoid this.
15 am__skiplex =
16 am__skipyacc =
17
18 WARN_CFLAGS = @WARN_CFLAGS@
19 NO_WERROR = @NO_WERROR@
20 AM_CFLAGS = $(WARN_CFLAGS)
21
22 TARG_CPU = @target_cpu_type@
23 TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
24 TARG_CPU_O = tc-@target_cpu_type@.o
25 TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
26 OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
27 OBJ_FORMAT_O = obj-@obj_format@.o
28 OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
29 TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
30 ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
31 ATOF_TARG_O = atof-@atof@.o
32
33 # use @target_cpu_type@ for refering to configured target name
34 IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
35 IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
36 IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
37 IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
38
39 # CPU types.  This is only used for dependency information.
40
41 CPU_TYPES = \
42         alpha \
43         arc \
44         arm \
45         avr \
46         bfin \
47         cr16 \
48         cris \
49         crx \
50         d10v \
51         d30v \
52         dlx \
53         fr30 \
54         frv \
55         h8300 \
56         hppa \
57         i370 \
58         i386 \
59         i860 \
60         i960 \
61         ia64 \
62         ip2k \
63         lm32 \
64         m32c \
65         m32r \
66         m68hc11 \
67         m68k \
68         maxq \
69         mcore \
70         mep \
71         microblaze \
72         mips \
73         mmix \
74         mn10200 \
75         mn10300 \
76         msp430 \
77         mt \
78         ns32k \
79         openrisc \
80         or32 \
81         pdp11 \
82         pj \
83         ppc \
84         s390 \
85         score \
86         sh \
87         sh64 \
88         sparc \
89         spu \
90         tic30 \
91         tic4x \
92         tic54x \
93         v850 \
94         vax \
95         xc16x \
96         xstormy16 \
97         xtensa \
98         z80 \
99         z8k
100
101 # Object format types.  This is only used for dependency information.
102 # We deliberately omit SOM, since it does not work as a cross assembler.
103
104 OBJ_FORMATS = \
105         aout \
106         coff \
107         ecoff \
108         elf \
109         evax \
110         macho
111
112 # This is an sh case which sets valid according to whether the CPU
113 # type in the shell variable c and the OS type in the shell variable o
114 # are supported.  This helps cuts down on the amount of dependency
115 # information.
116
117 CPU_OBJ_VALID = \
118         valid= ; \
119         case $$o in \
120         aout) \
121           case $$c in \
122           arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
123             valid=yes ;; \
124           esac ;; \
125         coff) \
126           case $$c in \
127           arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
128                 | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
129             valid=yes ;; \
130           esac ;; \
131         ecoff) \
132           case $$c in \
133           mips | alpha) valid=yes ;; \
134           esac ;; \
135         elf) valid=yes ; \
136           case $$c in \
137           maxq | ns32k | tic* | z80 | z8k) valid= ;; \
138           esac ;; \
139         evax) \
140           case $$c in \
141           alpha) valid=yes ;; \
142           esac ;; \
143         macho) \
144           case $$c in \
145           i386) valid=yes ;; \
146           esac ;; \
147         vms) \
148           case $$c in \
149           vax) valid=yes ;; \
150           esac ;; \
151         esac;
152
153 # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
154
155 MULTI_CPU_TYPES = i386 mips cris
156
157 MULTI_CPU_OBJ_VALID = \
158         valid= ; \
159         case $$o in \
160         aout) \
161           case $$c in \
162           i386 | cris) valid=yes ;; \
163           esac ;; \
164         coff) \
165           case $$c in \
166           i386 | mips) valid=yes ;; \
167           esac ;; \
168         ecoff) \
169           case $$c in \
170           mips) valid=yes ;; \
171           esac ;; \
172         elf) valid=yes ;; \
173         esac;
174
175 # Regular source files.
176
177 GAS_CFILES = \
178         app.c \
179         as.c \
180         atof-generic.c \
181         cond.c \
182         depend.c \
183         dwarf2dbg.c \
184         dw2gencfi.c \
185         ecoff.c \
186         ehopt.c \
187         expr.c \
188         flonum-copy.c \
189         flonum-konst.c \
190         flonum-mult.c \
191         frags.c \
192         hash.c \
193         input-file.c \
194         input-scrub.c \
195         listing.c \
196         literal.c \
197         macro.c \
198         messages.c \
199         output-file.c \
200         read.c \
201         remap.c \
202         sb.c \
203         stabs.c \
204         subsegs.c \
205         symbols.c \
206         write.c
207
208 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
209
210 HFILES = \
211         as.h \
212         asintl.h \
213         bignum.h \
214         bit_fix.h \
215         cgen.h \
216         dwarf2dbg.h \
217         dw2gencfi.h \
218         ecoff.h \
219         emul-target.h \
220         emul.h \
221         expr.h \
222         flonum.h \
223         frags.h \
224         hash.h \
225         input-file.h \
226         itbl-lex.h \
227         itbl-ops.h \
228         listing.h \
229         macro.h \
230         obj.h \
231         output-file.h \
232         read.h \
233         sb.h \
234         struc-symbol.h \
235         subsegs.h \
236         symbols.h \
237         tc.h \
238         write.h
239
240 # CPU files in config.
241
242 TARGET_CPU_CFILES = \
243         config/tc-alpha.c \
244         config/tc-arc.c \
245         config/tc-arm.c \
246         config/tc-avr.c \
247         config/tc-bfin.c \
248         config/tc-cr16.c \
249         config/tc-cris.c \
250         config/tc-crx.c \
251         config/tc-d10v.c \
252         config/tc-d30v.c \
253         config/tc-dlx.c \
254         config/tc-fr30.c \
255         config/tc-frv.c \
256         config/tc-h8300.c \
257         config/tc-hppa.c \
258         config/tc-ia64.c \
259         config/tc-i370.c \
260         config/tc-i386.c \
261         config/tc-i860.c \
262         config/tc-i960.c \
263         config/tc-ip2k.c \
264         config/tc-iq2000.c \
265         config/tc-lm32.c \
266         config/tc-m32c.c \
267         config/tc-m32r.c \
268         config/tc-m68hc11.c \
269         config/tc-m68k.c \
270         config/tc-maxq.c \
271         config/tc-mcore.c \
272         config/tc-mep.c \
273         config/tc-microblaze.c \
274         config/tc-mips.c \
275         config/tc-mmix.c \
276         config/tc-mn10200.c \
277         config/tc-mn10300.c \
278         config/tc-moxie.c \
279         config/tc-msp430.c \
280         config/tc-mt.c \
281         config/tc-ns32k.c \
282         config/tc-openrisc.c \
283         config/tc-or32.c \
284         config/tc-pdp11.c \
285         config/tc-pj.c \
286         config/tc-ppc.c \
287         config/tc-s390.c \
288         config/tc-score.c \
289         config/tc-sh.c \
290         config/tc-sh64.c \
291         config/tc-sparc.c \
292         config/tc-spu.c \
293         config/tc-tic30.c \
294         config/tc-tic4x.c \
295         config/tc-tic54x.c \
296         config/tc-vax.c \
297         config/tc-v850.c \
298         config/tc-xstormy16.c \
299         config/tc-xc16x.c \
300         config/tc-xtensa.c \
301         config/tc-z80.c \
302         config/tc-z8k.c \
303         config/xtensa-relax.c
304
305 TARGET_CPU_HFILES = \
306         config/tc-alpha.h \
307         config/tc-arc.h \
308         config/tc-arm.h \
309         config/tc-avr.h \
310         config/tc-bfin.h \
311         config/tc-cr16.h \
312         config/tc-cris.h \
313         config/tc-crx.h \
314         config/tc-d10v.h \
315         config/tc-d30v.h \
316         config/tc-dlx.h \
317         config/tc-fr30.h \
318         config/tc-frv.h \
319         config/tc-h8300.h \
320         config/tc-hppa.h \
321         config/tc-ia64.h \
322         config/tc-i370.h \
323         config/tc-i386.h \
324         config/tc-i860.h \
325         config/tc-i960.h \
326         config/tc-ip2k.h \
327         config/tc-iq2000.h \
328         config/tc-lm32.h \
329         config/tc-m32c.h \
330         config/tc-m32r.h \
331         config/tc-m68hc11.h \
332         config/tc-m68k.h \
333         config/tc-maxq.h \
334         config/tc-mcore.h \
335         config/tc-mep.h \
336         config/tc-microblaze.h \
337         config/tc-mips.h \
338         config/tc-mmix.h \
339         config/tc-mn10200.h \
340         config/tc-mn10300.h \
341         config/tc-msp430.h \
342         config/tc-mt.h \
343         config/tc-ns32k.h \
344         config/tc-openrisc.h \
345         config/tc-or32.h \
346         config/tc-pdp11.h \
347         config/tc-pj.h \
348         config/tc-ppc.h \
349         config/tc-s390.h \
350         config/tc-score.h \
351         config/tc-sh.h \
352         config/tc-sh64.h \
353         config/tc-sparc.h \
354         config/tc-spu.h \
355         config/tc-tic30.h \
356         config/tc-tic4x.h \
357         config/tc-tic54x.h \
358         config/tc-vax.h \
359         config/tc-v850.h \
360         config/tc-xstormy16.h \
361         config/tc-xc16x.h \
362         config/tc-xtensa.h \
363         config/tc-z80.h \
364         config/tc-z8k.h \
365         config/xtensa-relax.h
366
367 # OBJ files in config
368
369 OBJ_FORMAT_CFILES = \
370         config/obj-aout.c \
371         config/obj-coff.c \
372         config/obj-ecoff.c \
373         config/obj-elf.c \
374         config/obj-evax.c \
375         config/obj-fdpicelf.c \
376         config/obj-macho.c \
377         config/obj-multi.c \
378         config/obj-som.c
379
380 OBJ_FORMAT_HFILES = \
381         config/obj-aout.h \
382         config/obj-coff.h \
383         config/obj-ecoff.h \
384         config/obj-elf.h \
385         config/obj-evax.h \
386         config/obj-fdpicelf.h \
387         config/obj-macho.h \
388         config/obj-multi.h \
389         config/obj-som.h
390
391 # Emulation header files in config
392
393 TARG_ENV_HFILES = \
394         config/te-386bsd.h \
395         config/te-aix5.h \
396         config/te-armeabi.h \
397         config/te-armlinuxeabi.h \
398         config/te-dynix.h \
399         config/te-epoc-pe.h \
400         config/te-freebsd.h \
401         config/te-generic.h \
402         config/te-gnu.h \
403         config/te-go32.h \
404         config/te-hppa.h \
405         config/te-hppa64.h \
406         config/te-hppalinux64.h \
407         config/te-i386aix.h \
408         config/te-ia64aix.h \
409         config/te-interix.h \
410         config/te-lnews.h \
411         config/te-lynx.h \
412         config/te-mach.h \
413         config/te-macos.h \
414         config/te-nbsd.h \
415         config/te-nbsd532.h \
416         config/te-netware.h \
417         config/te-pc532mach.h \
418         config/te-pe.h \
419         config/te-psos.h \
420         config/te-riscix.h \
421         config/te-solaris.h \
422         config/te-sparcaout.h \
423         config/te-sun3.h \
424         config/te-svr4.h \
425         config/te-symbian.h \
426         config/te-tmips.h \
427         config/te-vxworks.h \
428         config/te-wince-pe.h
429
430 # Multi files in config
431
432 MULTI_CFILES = \
433         config/e-crisaout.c \
434         config/e-criself.c \
435         config/e-i386aout.c \
436         config/e-i386coff.c \
437         config/e-i386elf.c \
438         config/e-mipsecoff.c \
439         config/e-mipself.c
440
441 CONFIG_OBJS = \
442         $(TARG_CPU_O) \
443         $(OBJ_FORMAT_O) \
444         $(ATOF_TARG_O) \
445         $(extra_objects)
446
447 GENERIC_OBJS = \
448         app.o \
449         as.o \
450         atof-generic.o \
451         cond.o \
452         depend.o \
453         dwarf2dbg.o \
454         dw2gencfi.o \
455         ehopt.o \
456         expr.o \
457         flonum-konst.o \
458         flonum-copy.o \
459         flonum-mult.o \
460         frags.o \
461         hash.o \
462         input-file.o \
463         input-scrub.o \
464         literal.o \
465         messages.o \
466         output-file.o \
467         read.o \
468         remap.o \
469         subsegs.o \
470         symbols.o \
471         write.o \
472         listing.o \
473         ecoff.o \
474         stabs.o \
475         sb.o \
476         macro.o
477
478 CONFIG_ATOF_CFILES = \
479         config/atof-ieee.c \
480         config/atof-vax.c
481
482 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
483
484 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
485         $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
486         $(HFILES) $(CFILES)
487 po/POTFILES.in: @MAINT@ Makefile
488         for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
489           && mv tmp $(srcdir)/po/POTFILES.in
490
491 # Note: GASP is now deprecated and has been removed.  It is still
492 # available in the CVS archive or older binutils releases if it is needed.
493 noinst_PROGRAMS = as-new
494 noinst_SCRIPTS = $(GDBINIT)
495 EXTRA_SCRIPTS = .gdbinit
496
497 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
498         bfin-parse.c bfin-parse.h bfin-lex.c
499
500 diststuff: $(EXTRA_DIST) info
501
502 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
503
504 # Now figure out from those variables how to compile and link.
505
506 BASEDIR = $(srcdir)/..
507 BFDDIR = $(BASEDIR)/bfd
508 INCDIR = $(BASEDIR)/include
509
510 # This is the variable actually used when we compile.
511 # Specify the directories to be searched for header files.
512 # Both . and srcdir are used, in that order,
513 # so that tm.h and config.h will be found in the compilation
514 # subdirectory rather than in the source directory.
515 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
516         -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
517         -DLOCALEDIR="\"$(datadir)/locale\""
518
519 # How to link with both our special library facilities
520 # and the system's installed libraries.
521
522 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
523
524 # Files to be copied away after each stage in building.
525 STAGESTUFF = *.o $(noinst_PROGRAMS)
526
527 as_new_SOURCES = $(GAS_CFILES)
528 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
529         $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
530 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
531         $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
532 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
533         $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
534         $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
535
536 EXPECT = expect
537 RUNTEST = runtest
538 RUNTESTFLAGS=
539
540 check-DEJAGNU: site.exp
541         if [ -d testsuite ]; then \
542           true; \
543         else \
544           mkdir testsuite; \
545         fi
546         rm -f testsuite/site.exp
547         cp site.exp testsuite/site.exp
548         rootme=`pwd`; export rootme; \
549         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
550         EXPECT=${EXPECT} ; export EXPECT ; \
551         runtest=$(RUNTEST); \
552         cd testsuite; \
553         if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
554           $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
555                 $(RUNTESTFLAGS); \
556         else echo "WARNING: could not find \`runtest'" 1>&2; :;\
557         fi
558
559 # The m68k operand parser.
560
561 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
562
563 # If m68k-parse.y is in a different directory, then ylwrap will use an
564 # absolute path when it invokes yacc, which will cause yacc to put the
565 # absolute path into the generated file.  That's a pain when it comes
566 # to generating snapshots, because it introduces spurious diffs.
567 # Since when we make the snapshots $(srcdir) = ".", we check for that
568 # case and handle it differently.  This means that anybody who
569 # configures with $(srcdir) = "." will have to set their path in the
570 # debugger if they want to debug m68k-parse.y.  This is bad, but on
571 # the other hand it's good that people who use the prebuilt
572 # m68k-parse.c don't get a spurious absolute path.
573 m68k-parse.c: $(srcdir)/config/m68k-parse.y
574         f=$(srcdir)/config/m68k-parse.y; \
575         if [ $$f = "./config/m68k-parse.y" ]; then \
576           ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
577            ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
578            cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
579           f=m68k-parse.y; \
580         else true; fi; \
581         $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
582         if [ $$f = "m68k-parse.y" ]; then \
583           rm -f m68k-parse.y; \
584         else true; fi
585 # Disable -Werror, if it has been enabled, since old versions of bison/
586 # yacc will produce working code which contain compile time warnings.
587 m68k-parse.o: m68k-parse.c
588 if am__fastdepCC
589         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
590         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
591 else
592 if AMDEP
593         source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
594         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
595 endif
596         $(COMPILE) -c `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
597 endif
598
599 # Don't let the .y.h rule clobber m68k-parse.h.
600 m68k-parse.h: ; @true
601 $(srcdir)/config/m68k-parse.h: ; @true
602
603 bfin-parse.c: $(srcdir)/config/bfin-parse.y
604         $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
605 bfin-parse.h: bfin-parse.c
606 bfin-parse.o: bfin-parse.c \
607  $(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
608  $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
609
610 bfin-parse.h: ; @true
611 $(srcdir)/config/bfin-parse.h: ; @true
612
613 bfin-lex.c: $(srcdir)/config/bfin-lex.l
614         $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
615 bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
616 if am__fastdepCC
617         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
618         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
619 else
620 if AMDEP
621         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
622         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
623 endif
624         $(COMPILE) -c `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
625 endif
626
627 # The instruction table specification lexical analyzer and parser.
628
629 # Disable -Werror, if it has been enabled, since old versions of bison/
630 # yacc will produce working code which contain compile time warnings.
631 itbl-lex.o: itbl-lex.c itbl-parse.h
632 if am__fastdepCC
633         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
634         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
635 else
636 if AMDEP
637         source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
638         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639 endif
640         $(COMPILE) -c `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
641 endif
642
643 # Disable -Werror, if it has been enabled, since old versions of bison/
644 # yacc will produce working code which contain compile time warnings.
645 itbl-parse.o: itbl-parse.c
646 if am__fastdepCC
647         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
648         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
649 else
650 if AMDEP
651         source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
652         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
653 endif
654         $(COMPILE) -c `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
655 endif
656
657 itbl-parse.c: $(srcdir)/itbl-parse.y
658         $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
659
660 itbl-parse.h: itbl-parse.c ; @true
661
662 itbl-ops.o: itbl-parse.h
663
664 # stand-alone itbl assembler & disassembler
665
666 EXTRA_PROGRAMS = itbl-test
667 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
668 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
669
670 itbl-tops.o: itbl-ops.c itbl-parse.h
671 if am__fastdepCC
672         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
673         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
674 else
675 if AMDEP
676         source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
677         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
678 endif
679         $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
680 endif
681
682 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
683 if am__fastdepCC
684         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
685         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
686 else
687 if AMDEP
688         source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
689         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
690 endif
691         $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
692 endif
693
694 # CGEN interface.
695
696 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
697
698 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
699         $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
700         $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
701         $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
702
703 # Remake the info files.
704
705 MOSTLYCLEANFILES = $(STAGESTUFF) core \
706         testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
707         testsuite/site.exp site.bak site.exp stage stage1 stage2
708
709 .PHONY: install-exec-local install-data-local
710 .PHONY: install-exec-bindir install-exec-tooldir
711
712 install-exec-local: install-exec-bindir @install_tooldir@
713
714 install-exec-bindir: $(noinst_PROGRAMS)
715         $(mkinstalldirs) $(DESTDIR)$(bindir)
716         @list='$(noinst_PROGRAMS)'; for p in $$list; do \
717           if test -f $$p; then \
718             echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
719             $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
720           else :; fi; \
721         done
722
723 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
724         $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
725         n=`echo as | sed '$(transform)'`; \
726         if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
727           rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
728           ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
729             || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
730         else \
731           true ; \
732         fi
733
734 # These exist for maintenance purposes.
735
736 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
737
738 bootstrap: as-new
739         $(MAKE) stage1
740         rm -f stage && ln -s stage1 stage
741         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
742         $(MAKE) stage2
743         rm -f stage && ln -s stage2 stage
744         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
745         $(MAKE) comparison against=stage2
746
747 bootstrap2:
748         rm -f stage && ln -s stage1 stage
749         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
750         $(MAKE) stage2
751         rm -f stage && ln -s stage2 stage
752         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
753         $(MAKE) comparison against=stage2
754
755 bootstrap3:
756         rm -f stage && ln -s stage2 stage
757         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
758         $(MAKE) comparison against=stage2
759
760 # Copy the object files from a particular stage into a subdirectory.
761 stage1:
762         -mkdir stage1
763         -mv $(STAGESTUFF) stage1
764         if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
765
766 stage2:
767         -mkdir stage2
768         -mv $(STAGESTUFF) stage2
769         if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
770
771 stage3:
772         -mkdir stage3
773         -mv $(STAGESTUFF) stage3
774         if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
775
776 against=stage2
777
778 # This rule is derived from corresponding code in the Makefile.in for gcc.
779 # The "tail +16c" is to bypass headers which may include timestamps or
780 # temporary assembly file names.
781 comparison:
782         x=0 ; \
783         for file in *.o ; do \
784           tail +16c ./$$file > tmp-foo1; \
785           if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
786             if cmp tmp-foo1 tmp-foo2 ; then \
787               true ; \
788             else \
789               echo $$file differs ; \
790               x=1 ; \
791             fi ; \
792           else true; fi ; \
793         done ; \
794         exit $$x
795         -rm -f tmp-foo*
796
797 .PHONY: de-stage1 de-stage2 de-stage3
798
799 de-stage1:
800         - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
801         - rmdir stage1
802
803 de-stage2:
804         - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
805         - rmdir stage2
806
807 de-stage3:
808         - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
809         - rmdir stage3
810
811 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt