Fix yacc and lex reruns with maintainer-mode off.
[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-msp430.c \
279         config/tc-mt.c \
280         config/tc-ns32k.c \
281         config/tc-openrisc.c \
282         config/tc-or32.c \
283         config/tc-pdp11.c \
284         config/tc-pj.c \
285         config/tc-ppc.c \
286         config/tc-s390.c \
287         config/tc-score.c \
288         config/tc-sh.c \
289         config/tc-sh64.c \
290         config/tc-sparc.c \
291         config/tc-spu.c \
292         config/tc-tic30.c \
293         config/tc-tic4x.c \
294         config/tc-tic54x.c \
295         config/tc-vax.c \
296         config/tc-v850.c \
297         config/tc-xstormy16.c \
298         config/tc-xc16x.c \
299         config/tc-xtensa.c \
300         config/tc-z80.c \
301         config/tc-z8k.c \
302         config/xtensa-relax.c
303
304 TARGET_CPU_HFILES = \
305         config/tc-alpha.h \
306         config/tc-arc.h \
307         config/tc-arm.h \
308         config/tc-avr.h \
309         config/tc-bfin.h \
310         config/tc-cr16.h \
311         config/tc-cris.h \
312         config/tc-crx.h \
313         config/tc-d10v.h \
314         config/tc-d30v.h \
315         config/tc-dlx.h \
316         config/tc-fr30.h \
317         config/tc-frv.h \
318         config/tc-h8300.h \
319         config/tc-hppa.h \
320         config/tc-ia64.h \
321         config/tc-i370.h \
322         config/tc-i386.h \
323         config/tc-i860.h \
324         config/tc-i960.h \
325         config/tc-ip2k.h \
326         config/tc-iq2000.h \
327         config/tc-lm32.h \
328         config/tc-m32c.h \
329         config/tc-m32r.h \
330         config/tc-m68hc11.h \
331         config/tc-m68k.h \
332         config/tc-maxq.h \
333         config/tc-mcore.h \
334         config/tc-mep.h \
335         config/tc-microblaze.h \
336         config/tc-mips.h \
337         config/tc-mmix.h \
338         config/tc-mn10200.h \
339         config/tc-mn10300.h \
340         config/tc-msp430.h \
341         config/tc-mt.h \
342         config/tc-ns32k.h \
343         config/tc-openrisc.h \
344         config/tc-or32.h \
345         config/tc-pdp11.h \
346         config/tc-pj.h \
347         config/tc-ppc.h \
348         config/tc-s390.h \
349         config/tc-score.h \
350         config/tc-sh.h \
351         config/tc-sh64.h \
352         config/tc-sparc.h \
353         config/tc-spu.h \
354         config/tc-tic30.h \
355         config/tc-tic4x.h \
356         config/tc-tic54x.h \
357         config/tc-vax.h \
358         config/tc-v850.h \
359         config/tc-xstormy16.h \
360         config/tc-xc16x.h \
361         config/tc-xtensa.h \
362         config/tc-z80.h \
363         config/tc-z8k.h \
364         config/xtensa-relax.h
365
366 # OBJ files in config
367
368 OBJ_FORMAT_CFILES = \
369         config/obj-aout.c \
370         config/obj-coff.c \
371         config/obj-ecoff.c \
372         config/obj-elf.c \
373         config/obj-evax.c \
374         config/obj-fdpicelf.c \
375         config/obj-macho.c \
376         config/obj-multi.c \
377         config/obj-som.c
378
379 OBJ_FORMAT_HFILES = \
380         config/obj-aout.h \
381         config/obj-coff.h \
382         config/obj-ecoff.h \
383         config/obj-elf.h \
384         config/obj-evax.h \
385         config/obj-fdpicelf.h \
386         config/obj-macho.h \
387         config/obj-multi.h \
388         config/obj-som.h
389
390 # Emulation header files in config
391
392 TARG_ENV_HFILES = \
393         config/te-386bsd.h \
394         config/te-aix5.h \
395         config/te-armeabi.h \
396         config/te-armlinuxeabi.h \
397         config/te-dynix.h \
398         config/te-epoc-pe.h \
399         config/te-freebsd.h \
400         config/te-generic.h \
401         config/te-gnu.h \
402         config/te-go32.h \
403         config/te-hppa.h \
404         config/te-hppa64.h \
405         config/te-hppalinux64.h \
406         config/te-i386aix.h \
407         config/te-ia64aix.h \
408         config/te-interix.h \
409         config/te-lnews.h \
410         config/te-lynx.h \
411         config/te-mach.h \
412         config/te-macos.h \
413         config/te-nbsd.h \
414         config/te-nbsd532.h \
415         config/te-netware.h \
416         config/te-pc532mach.h \
417         config/te-pe.h \
418         config/te-psos.h \
419         config/te-riscix.h \
420         config/te-solaris.h \
421         config/te-sparcaout.h \
422         config/te-sun3.h \
423         config/te-svr4.h \
424         config/te-symbian.h \
425         config/te-tmips.h \
426         config/te-vxworks.h \
427         config/te-wince-pe.h
428
429 # Multi files in config
430
431 MULTI_CFILES = \
432         config/e-crisaout.c \
433         config/e-criself.c \
434         config/e-i386aout.c \
435         config/e-i386coff.c \
436         config/e-i386elf.c \
437         config/e-mipsecoff.c \
438         config/e-mipself.c
439
440 CONFIG_OBJS = \
441         $(TARG_CPU_O) \
442         $(OBJ_FORMAT_O) \
443         $(ATOF_TARG_O) \
444         $(extra_objects)
445
446 GENERIC_OBJS = \
447         app.o \
448         as.o \
449         atof-generic.o \
450         cond.o \
451         depend.o \
452         dwarf2dbg.o \
453         dw2gencfi.o \
454         ehopt.o \
455         expr.o \
456         flonum-konst.o \
457         flonum-copy.o \
458         flonum-mult.o \
459         frags.o \
460         hash.o \
461         input-file.o \
462         input-scrub.o \
463         literal.o \
464         messages.o \
465         output-file.o \
466         read.o \
467         remap.o \
468         subsegs.o \
469         symbols.o \
470         write.o \
471         listing.o \
472         ecoff.o \
473         stabs.o \
474         sb.o \
475         macro.o
476
477 CONFIG_ATOF_CFILES = \
478         config/atof-ieee.c \
479         config/atof-vax.c
480
481 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
482
483 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
484         $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
485         $(HFILES) $(CFILES)
486 po/POTFILES.in: @MAINT@ Makefile
487         for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
488           && mv tmp $(srcdir)/po/POTFILES.in
489
490 # Note: GASP is now deprecated and has been removed.  It is still
491 # available in the CVS archive or older binutils releases if it is needed.
492 noinst_PROGRAMS = as-new
493 noinst_SCRIPTS = $(GDBINIT)
494 EXTRA_SCRIPTS = .gdbinit
495
496 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
497         bfin-parse.c bfin-parse.h bfin-lex.c
498
499 diststuff: $(EXTRA_DIST) info
500
501 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
502
503 # Now figure out from those variables how to compile and link.
504
505 BASEDIR = $(srcdir)/..
506 BFDDIR = $(BASEDIR)/bfd
507 INCDIR = $(BASEDIR)/include
508
509 # This is the variable actually used when we compile.
510 # Specify the directories to be searched for header files.
511 # Both . and srcdir are used, in that order,
512 # so that tm.h and config.h will be found in the compilation
513 # subdirectory rather than in the source directory.
514 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
515         -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
516         -DLOCALEDIR="\"$(datadir)/locale\""
517
518 # How to link with both our special library facilities
519 # and the system's installed libraries.
520
521 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
522
523 # Files to be copied away after each stage in building.
524 STAGESTUFF = *.o $(noinst_PROGRAMS)
525
526 as_new_SOURCES = $(GAS_CFILES)
527 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
528         $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
529 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
530         $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
531 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
532         $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
533         $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
534
535 EXPECT = expect
536 RUNTEST = runtest
537 RUNTESTFLAGS=
538
539 check-DEJAGNU: site.exp
540         if [ -d testsuite ]; then \
541           true; \
542         else \
543           mkdir testsuite; \
544         fi
545         rm -f testsuite/site.exp
546         cp site.exp testsuite/site.exp
547         rootme=`pwd`; export rootme; \
548         srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
549         EXPECT=${EXPECT} ; export EXPECT ; \
550         runtest=$(RUNTEST); \
551         cd testsuite; \
552         if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
553           $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
554                 $(RUNTESTFLAGS); \
555         else echo "WARNING: could not find \`runtest'" 1>&2; :;\
556         fi
557
558 # The m68k operand parser.
559
560 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
561
562 # If m68k-parse.y is in a different directory, then ylwrap will use an
563 # absolute path when it invokes yacc, which will cause yacc to put the
564 # absolute path into the generated file.  That's a pain when it comes
565 # to generating snapshots, because it introduces spurious diffs.
566 # Since when we make the snapshots $(srcdir) = ".", we check for that
567 # case and handle it differently.  This means that anybody who
568 # configures with $(srcdir) = "." will have to set their path in the
569 # debugger if they want to debug m68k-parse.y.  This is bad, but on
570 # the other hand it's good that people who use the prebuilt
571 # m68k-parse.c don't get a spurious absolute path.
572 m68k-parse.c: $(srcdir)/config/m68k-parse.y
573         f=$(srcdir)/config/m68k-parse.y; \
574         if [ $$f = "./config/m68k-parse.y" ]; then \
575           ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
576            ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
577            cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
578           f=m68k-parse.y; \
579         else true; fi; \
580         $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
581         if [ $$f = "m68k-parse.y" ]; then \
582           rm -f m68k-parse.y; \
583         else true; fi
584 # Disable -Werror, if it has been enabled, since old versions of bison/
585 # yacc will produce working code which contain compile time warnings.
586 m68k-parse.o: m68k-parse.c
587 if am__fastdepCC
588         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ m68k-parse.c $(NO_WERROR)
589         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
590 else
591 if AMDEP
592         source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
593         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
594 endif
595         $(COMPILE) -c m68k-parse.c $(NO_WERROR)
596 endif
597
598 # Don't let the .y.h rule clobber m68k-parse.h.
599 m68k-parse.h: ; @true
600 $(srcdir)/config/m68k-parse.h: ; @true
601
602 bfin-parse.c: $(srcdir)/config/bfin-parse.y
603         $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
604 bfin-parse.h: bfin-parse.c
605 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
606  $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
607
608 bfin-defs.h: ; @true
609 $(srcdir)/config/bfin-defs.h: ; @true
610
611 bfin-lex.c: $(srcdir)/config/bfin-lex.l
612         $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
613 bfin-lex.o: bfin-lex.c
614 if am__fastdepCC
615         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
616         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
617 else
618 if AMDEP
619         source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
620         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
621 endif
622         $(COMPILE) -c bfin-lex.c $(NO_WERROR)
623 endif
624
625 # The instruction table specification lexical analyzer and parser.
626
627 # Disable -Werror, if it has been enabled, since old versions of bison/
628 # yacc will produce working code which contain compile time warnings.
629 itbl-lex.o: itbl-lex.c
630 if am__fastdepCC
631         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
632         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
633 else
634 if AMDEP
635         source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
636         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
637 endif
638         $(COMPILE) -c itbl-lex.c $(NO_WERROR)
639 endif
640
641 # Disable -Werror, if it has been enabled, since old versions of bison/
642 # yacc will produce working code which contain compile time warnings.
643 itbl-parse.o: itbl-parse.c
644 if am__fastdepCC
645         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-parse.c $(NO_WERROR)
646         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
647 else
648 if AMDEP
649         source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
650         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
651 endif
652         $(COMPILE) -c itbl-parse.c $(NO_WERROR)
653 endif
654
655 itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
656         $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
657
658 # stand-alone itbl assembler & disassembler
659
660 EXTRA_PROGRAMS = itbl-test
661 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
662 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
663
664 itbl-tops.o: itbl-ops.c
665 if am__fastdepCC
666         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
667         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
668 else
669 if AMDEP
670         source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
671         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
672 endif
673         $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
674 endif
675
676 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
677 if am__fastdepCC
678         $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
679         mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
680 else
681 if AMDEP
682         source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
683         DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
684 endif
685         $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
686 endif
687
688 # CGEN interface.
689
690 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
691
692 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
693         $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
694         $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
695         $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
696
697 # Remake the info files.
698
699 MOSTLYCLEANFILES = $(STAGESTUFF) core \
700         testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
701         testsuite/site.exp site.bak site.exp stage stage1 stage2
702
703 .PHONY: install-exec-local install-data-local
704 .PHONY: install-exec-bindir install-exec-tooldir
705
706 install-exec-local: install-exec-bindir @install_tooldir@
707
708 install-exec-bindir: $(noinst_PROGRAMS)
709         $(mkinstalldirs) $(DESTDIR)$(bindir)
710         @list='$(noinst_PROGRAMS)'; for p in $$list; do \
711           if test -f $$p; then \
712             echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
713             $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
714           else :; fi; \
715         done
716
717 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
718         $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
719         n=`echo as | sed '$(transform)'`; \
720         if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
721           rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
722           ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
723             || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
724         else \
725           true ; \
726         fi
727
728 # These exist for maintenance purposes.
729
730 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
731
732 bootstrap: as-new
733         $(MAKE) stage1
734         rm -f stage && ln -s stage1 stage
735         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
736         $(MAKE) stage2
737         rm -f stage && ln -s stage2 stage
738         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
739         $(MAKE) comparison against=stage2
740
741 bootstrap2:
742         rm -f stage && ln -s stage1 stage
743         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
744         $(MAKE) stage2
745         rm -f stage && ln -s stage2 stage
746         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
747         $(MAKE) comparison against=stage2
748
749 bootstrap3:
750         rm -f stage && ln -s stage2 stage
751         $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
752         $(MAKE) comparison against=stage2
753
754 # Copy the object files from a particular stage into a subdirectory.
755 stage1:
756         -mkdir stage1
757         -mv $(STAGESTUFF) stage1
758         if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
759
760 stage2:
761         -mkdir stage2
762         -mv $(STAGESTUFF) stage2
763         if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
764
765 stage3:
766         -mkdir stage3
767         -mv $(STAGESTUFF) stage3
768         if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
769
770 against=stage2
771
772 # This rule is derived from corresponding code in the Makefile.in for gcc.
773 # The "tail +16c" is to bypass headers which may include timestamps or
774 # temporary assembly file names.
775 comparison:
776         x=0 ; \
777         for file in *.o ; do \
778           tail +16c ./$$file > tmp-foo1; \
779           if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
780             if cmp tmp-foo1 tmp-foo2 ; then \
781               true ; \
782             else \
783               echo $$file differs ; \
784               x=1 ; \
785             fi ; \
786           else true; fi ; \
787         done ; \
788         exit $$x
789         -rm -f tmp-foo*
790
791 .PHONY: de-stage1 de-stage2 de-stage3
792
793 de-stage1:
794         - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
795         - rmdir stage1
796
797 de-stage2:
798         - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
799         - rmdir stage2
800
801 de-stage3:
802         - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
803         - rmdir stage3
804
805 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt