1 ## Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = 1.11 dejagnu foreign no-dist
4 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
8 tooldir = $(exec_prefix)/$(target_alias)
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`
13 # Automake 1.10+ disables lex and yacc output file regeneration if
14 # maintainer mode is disabled. Avoid this.
18 WARN_CFLAGS = @WARN_CFLAGS@
19 NO_WERROR = @NO_WERROR@
20 AM_CFLAGS = $(WARN_CFLAGS)
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
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
39 # CPU types. This is only used for dependency information.
102 # Object format types. This is only used for dependency information.
103 # We deliberately omit SOM, since it does not work as a cross assembler.
113 # This is an sh case which sets valid according to whether the CPU
114 # type in the shell variable c and the OS type in the shell variable o
115 # are supported. This helps cuts down on the amount of dependency
123 arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
128 arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
129 | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
134 mips | alpha) valid=yes ;; \
138 maxq | ns32k | tic* | z80 | z8k) valid= ;; \
142 alpha) valid=yes ;; \
154 # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
156 MULTI_CPU_TYPES = i386 mips cris
158 MULTI_CPU_OBJ_VALID = \
163 i386 | cris) valid=yes ;; \
167 i386 | mips) valid=yes ;; \
176 # Regular source files.
209 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
241 # CPU files in config.
243 TARGET_CPU_CFILES = \
269 config/tc-m68hc11.c \
274 config/tc-microblaze.c \
277 config/tc-mn10200.c \
278 config/tc-mn10300.c \
283 config/tc-openrisc.c \
300 config/tc-xstormy16.c \
305 config/xtensa-relax.c
307 TARGET_CPU_HFILES = \
333 config/tc-m68hc11.h \
338 config/tc-microblaze.h \
341 config/tc-mn10200.h \
342 config/tc-mn10300.h \
346 config/tc-openrisc.h \
363 config/tc-xstormy16.h \
368 config/xtensa-relax.h
370 # OBJ files in config
372 OBJ_FORMAT_CFILES = \
378 config/obj-fdpicelf.c \
383 OBJ_FORMAT_HFILES = \
389 config/obj-fdpicelf.h \
394 # Emulation header files in config
399 config/te-armeabi.h \
400 config/te-armlinuxeabi.h \
402 config/te-epoc-pe.h \
403 config/te-freebsd.h \
404 config/te-generic.h \
409 config/te-hppalinux64.h \
410 config/te-i386aix.h \
411 config/te-ia64aix.h \
412 config/te-interix.h \
418 config/te-nbsd532.h \
419 config/te-netware.h \
420 config/te-pc532mach.h \
424 config/te-solaris.h \
425 config/te-sparcaout.h \
428 config/te-symbian.h \
430 config/te-vxworks.h \
436 # Multi files in config
439 config/e-crisaout.c \
441 config/e-i386aout.c \
442 config/e-i386coff.c \
444 config/e-mipsecoff.c \
484 CONFIG_ATOF_CFILES = \
488 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
490 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) \
491 $(TARG_ENV_HFILES) $(TARG_ENV_CFILES) $(OBJ_FORMAT_HFILES) \
492 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
494 po/POTFILES.in: @MAINT@ Makefile
495 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
496 && mv tmp $(srcdir)/po/POTFILES.in
498 # Note: GASP is now deprecated and has been removed. It is still
499 # available in the CVS archive or older binutils releases if it is needed.
500 noinst_PROGRAMS = as-new
501 noinst_SCRIPTS = $(GDBINIT)
502 EXTRA_SCRIPTS = .gdbinit
504 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
505 bfin-parse.c bfin-parse.h bfin-lex.c \
506 rx-parse.c rx-parse.h
508 diststuff: $(EXTRA_DIST) info
510 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
512 # Now figure out from those variables how to compile and link.
514 BASEDIR = $(srcdir)/..
515 BFDDIR = $(BASEDIR)/bfd
516 INCDIR = $(BASEDIR)/include
518 # This is the variable actually used when we compile.
519 # Specify the directories to be searched for header files.
520 # Both . and srcdir are used, in that order,
521 # so that tm.h and config.h will be found in the compilation
522 # subdirectory rather than in the source directory.
523 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
524 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
525 -DLOCALEDIR="\"$(datadir)/locale\""
527 # How to link with both our special library facilities
528 # and the system's installed libraries.
530 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
532 # Files to be copied away after each stage in building.
533 STAGESTUFF = *.o $(noinst_PROGRAMS)
535 as_new_SOURCES = $(GAS_CFILES)
536 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
537 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
538 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
539 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
540 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
541 $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
542 $(TARG_ENV_CFILES) $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
548 check-DEJAGNU: site.exp
549 if [ -d testsuite ]; then \
554 rm -f testsuite/site.exp
555 cp site.exp testsuite/site.exp
556 rootme=`pwd`; export rootme; \
557 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
558 EXPECT=${EXPECT} ; export EXPECT ; \
559 runtest=$(RUNTEST); \
561 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
562 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
564 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
567 # The m68k operand parser.
569 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
571 # If m68k-parse.y is in a different directory, then ylwrap will use an
572 # absolute path when it invokes yacc, which will cause yacc to put the
573 # absolute path into the generated file. That's a pain when it comes
574 # to generating snapshots, because it introduces spurious diffs.
575 # Since when we make the snapshots $(srcdir) = ".", we check for that
576 # case and handle it differently. This means that anybody who
577 # configures with $(srcdir) = "." will have to set their path in the
578 # debugger if they want to debug m68k-parse.y. This is bad, but on
579 # the other hand it's good that people who use the prebuilt
580 # m68k-parse.c don't get a spurious absolute path.
581 m68k-parse.c: $(srcdir)/config/m68k-parse.y
582 f=$(srcdir)/config/m68k-parse.y; \
583 if [ $$f = "./config/m68k-parse.y" ]; then \
584 ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
585 ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
586 cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
589 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
590 if [ $$f = "m68k-parse.y" ]; then \
591 rm -f m68k-parse.y; \
593 # Disable -Werror, if it has been enabled, since old versions of bison/
594 # yacc will produce working code which contain compile time warnings.
595 m68k-parse.o: m68k-parse.c
597 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
598 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
601 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
602 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
604 $(COMPILE) -c `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
607 # Don't let the .y.h rule clobber m68k-parse.h.
608 m68k-parse.h: ; @true
609 $(srcdir)/config/m68k-parse.h: ; @true
611 bfin-parse.c: $(srcdir)/config/bfin-parse.y
612 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
613 bfin-parse.h: bfin-parse.c
614 bfin-parse.o: bfin-parse.c \
615 $(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
616 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
618 bfin-parse.h: ; @true
619 $(srcdir)/config/bfin-parse.h: ; @true
621 bfin-lex.c: $(srcdir)/config/bfin-lex.l
622 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
623 bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
625 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
626 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
629 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
630 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
632 $(COMPILE) -c `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
635 rx-parse.c: $(srcdir)/config/rx-parse.y
636 $(SHELL) $(YLWRAP) $(srcdir)/config/rx-parse.y y.tab.c rx-parse.c y.tab.h rx-parse.h -- $(YACCCOMPILE) -d ;
637 rx-parse.h: rx-parse.c
638 rx-parse.o: rx-parse.c rx-parse.h $(srcdir)/config/rx-defs.h \
639 $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h $(BFDDIR)/libbfd.h
642 $(srcdir)/config/rx-defs.h: ; @true
644 # The instruction table specification lexical analyzer and parser.
646 # Disable -Werror, if it has been enabled, since old versions of bison/
647 # yacc will produce working code which contain compile time warnings.
648 itbl-lex.o: itbl-lex.c itbl-parse.h
650 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
651 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
654 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
655 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
657 $(COMPILE) -c `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
660 # Disable -Werror, if it has been enabled, since old versions of bison/
661 # yacc will produce working code which contain compile time warnings.
662 itbl-parse.o: itbl-parse.c
664 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
665 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
668 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
669 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
671 $(COMPILE) -c `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
674 itbl-parse.c: $(srcdir)/itbl-parse.y
675 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
677 itbl-parse.h: itbl-parse.c ; @true
679 itbl-ops.o: itbl-parse.h
681 # stand-alone itbl assembler & disassembler
683 EXTRA_PROGRAMS = itbl-test
684 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
685 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
687 itbl-tops.o: itbl-ops.c itbl-parse.h
689 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
690 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
693 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
694 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
696 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
699 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
701 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
702 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
705 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
706 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
708 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
713 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
715 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
716 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
717 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
718 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
720 # Remake the info files.
722 MOSTLYCLEANFILES = $(STAGESTUFF) core \
723 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
724 testsuite/site.exp site.bak site.exp stage stage1 stage2
726 .PHONY: install-exec-local install-data-local
727 .PHONY: install-exec-bindir install-exec-tooldir
729 install-exec-local: install-exec-bindir @install_tooldir@
731 install-exec-bindir: $(noinst_PROGRAMS)
732 $(mkinstalldirs) $(DESTDIR)$(bindir)
733 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
734 if test -f $$p; then \
735 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
736 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
740 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
741 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
742 n=`echo as | sed '$(transform)'`; \
743 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
744 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
745 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
746 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
751 # These exist for maintenance purposes.
753 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
757 rm -f stage && ln -s stage1 stage
758 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
760 rm -f stage && ln -s stage2 stage
761 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
762 $(MAKE) comparison against=stage2
765 rm -f stage && ln -s stage1 stage
766 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
768 rm -f stage && ln -s stage2 stage
769 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
770 $(MAKE) comparison against=stage2
773 rm -f stage && ln -s stage2 stage
774 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
775 $(MAKE) comparison against=stage2
777 # Copy the object files from a particular stage into a subdirectory.
780 -mv $(STAGESTUFF) stage1
781 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
785 -mv $(STAGESTUFF) stage2
786 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
790 -mv $(STAGESTUFF) stage3
791 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
795 # This rule is derived from corresponding code in the Makefile.in for gcc.
796 # The "tail +16c" is to bypass headers which may include timestamps or
797 # temporary assembly file names.
800 for file in *.o ; do \
801 tail +16c ./$$file > tmp-foo1; \
802 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
803 if cmp tmp-foo1 tmp-foo2 ; then \
806 echo $$file differs ; \
814 .PHONY: de-stage1 de-stage2 de-stage3
817 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
821 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
825 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
828 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt