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.
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.
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
122 arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
127 arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
128 | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
133 mips | alpha) valid=yes ;; \
137 maxq | ns32k | tic* | z80 | z8k) valid= ;; \
141 alpha) valid=yes ;; \
153 # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
155 MULTI_CPU_TYPES = i386 mips cris
157 MULTI_CPU_OBJ_VALID = \
162 i386 | cris) valid=yes ;; \
166 i386 | mips) valid=yes ;; \
175 # Regular source files.
208 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
240 # CPU files in config.
242 TARGET_CPU_CFILES = \
268 config/tc-m68hc11.c \
273 config/tc-microblaze.c \
276 config/tc-mn10200.c \
277 config/tc-mn10300.c \
282 config/tc-openrisc.c \
298 config/tc-xstormy16.c \
303 config/xtensa-relax.c
305 TARGET_CPU_HFILES = \
331 config/tc-m68hc11.h \
336 config/tc-microblaze.h \
339 config/tc-mn10200.h \
340 config/tc-mn10300.h \
344 config/tc-openrisc.h \
360 config/tc-xstormy16.h \
365 config/xtensa-relax.h
367 # OBJ files in config
369 OBJ_FORMAT_CFILES = \
375 config/obj-fdpicelf.c \
380 OBJ_FORMAT_HFILES = \
386 config/obj-fdpicelf.h \
391 # Emulation header files in config
396 config/te-armeabi.h \
397 config/te-armlinuxeabi.h \
399 config/te-epoc-pe.h \
400 config/te-freebsd.h \
401 config/te-generic.h \
406 config/te-hppalinux64.h \
407 config/te-i386aix.h \
408 config/te-ia64aix.h \
409 config/te-interix.h \
415 config/te-nbsd532.h \
416 config/te-netware.h \
417 config/te-pc532mach.h \
421 config/te-solaris.h \
422 config/te-sparcaout.h \
425 config/te-symbian.h \
427 config/te-vxworks.h \
433 # Multi files in config
436 config/e-crisaout.c \
438 config/e-i386aout.c \
439 config/e-i386coff.c \
441 config/e-mipsecoff.c \
481 CONFIG_ATOF_CFILES = \
485 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
487 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) \
488 $(TARG_ENV_HFILES) $(TARG_ENV_CFILES) $(OBJ_FORMAT_HFILES) \
489 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
491 po/POTFILES.in: @MAINT@ Makefile
492 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
493 && mv tmp $(srcdir)/po/POTFILES.in
495 # Note: GASP is now deprecated and has been removed. It is still
496 # available in the CVS archive or older binutils releases if it is needed.
497 noinst_PROGRAMS = as-new
498 noinst_SCRIPTS = $(GDBINIT)
499 EXTRA_SCRIPTS = .gdbinit
501 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
502 bfin-parse.c bfin-parse.h bfin-lex.c
504 diststuff: $(EXTRA_DIST) info
506 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
508 # Now figure out from those variables how to compile and link.
510 BASEDIR = $(srcdir)/..
511 BFDDIR = $(BASEDIR)/bfd
512 INCDIR = $(BASEDIR)/include
514 # This is the variable actually used when we compile.
515 # Specify the directories to be searched for header files.
516 # Both . and srcdir are used, in that order,
517 # so that tm.h and config.h will be found in the compilation
518 # subdirectory rather than in the source directory.
519 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
520 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
521 -DLOCALEDIR="\"$(datadir)/locale\""
523 # How to link with both our special library facilities
524 # and the system's installed libraries.
526 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
528 # Files to be copied away after each stage in building.
529 STAGESTUFF = *.o $(noinst_PROGRAMS)
531 as_new_SOURCES = $(GAS_CFILES)
532 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
533 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
534 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
535 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
536 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
537 $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
538 $(TARG_ENV_CFILES) $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
544 check-DEJAGNU: site.exp
545 if [ -d testsuite ]; then \
550 rm -f testsuite/site.exp
551 cp site.exp testsuite/site.exp
552 rootme=`pwd`; export rootme; \
553 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
554 EXPECT=${EXPECT} ; export EXPECT ; \
555 runtest=$(RUNTEST); \
557 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
558 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
560 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
563 # The m68k operand parser.
565 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
567 # If m68k-parse.y is in a different directory, then ylwrap will use an
568 # absolute path when it invokes yacc, which will cause yacc to put the
569 # absolute path into the generated file. That's a pain when it comes
570 # to generating snapshots, because it introduces spurious diffs.
571 # Since when we make the snapshots $(srcdir) = ".", we check for that
572 # case and handle it differently. This means that anybody who
573 # configures with $(srcdir) = "." will have to set their path in the
574 # debugger if they want to debug m68k-parse.y. This is bad, but on
575 # the other hand it's good that people who use the prebuilt
576 # m68k-parse.c don't get a spurious absolute path.
577 m68k-parse.c: $(srcdir)/config/m68k-parse.y
578 f=$(srcdir)/config/m68k-parse.y; \
579 if [ $$f = "./config/m68k-parse.y" ]; then \
580 ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
581 ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
582 cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
585 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
586 if [ $$f = "m68k-parse.y" ]; then \
587 rm -f m68k-parse.y; \
589 # Disable -Werror, if it has been enabled, since old versions of bison/
590 # yacc will produce working code which contain compile time warnings.
591 m68k-parse.o: m68k-parse.c
593 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
594 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
597 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
598 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
600 $(COMPILE) -c `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
603 # Don't let the .y.h rule clobber m68k-parse.h.
604 m68k-parse.h: ; @true
605 $(srcdir)/config/m68k-parse.h: ; @true
607 bfin-parse.c: $(srcdir)/config/bfin-parse.y
608 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
609 bfin-parse.h: bfin-parse.c
610 bfin-parse.o: bfin-parse.c \
611 $(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
612 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
614 bfin-parse.h: ; @true
615 $(srcdir)/config/bfin-parse.h: ; @true
617 bfin-lex.c: $(srcdir)/config/bfin-lex.l
618 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
619 bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
621 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
622 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
625 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
626 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
628 $(COMPILE) -c `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
631 # The instruction table specification lexical analyzer and parser.
633 # Disable -Werror, if it has been enabled, since old versions of bison/
634 # yacc will produce working code which contain compile time warnings.
635 itbl-lex.o: itbl-lex.c itbl-parse.h
637 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
638 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
641 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
642 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
644 $(COMPILE) -c `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
647 # Disable -Werror, if it has been enabled, since old versions of bison/
648 # yacc will produce working code which contain compile time warnings.
649 itbl-parse.o: itbl-parse.c
651 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
652 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
655 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
656 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
658 $(COMPILE) -c `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
661 itbl-parse.c: $(srcdir)/itbl-parse.y
662 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
664 itbl-parse.h: itbl-parse.c ; @true
666 itbl-ops.o: itbl-parse.h
668 # stand-alone itbl assembler & disassembler
670 EXTRA_PROGRAMS = itbl-test
671 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
672 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
674 itbl-tops.o: itbl-ops.c itbl-parse.h
676 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
677 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
680 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
681 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
683 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
686 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
688 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
689 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
692 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
693 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
695 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
700 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
702 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
703 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
704 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
705 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
707 # Remake the info files.
709 MOSTLYCLEANFILES = $(STAGESTUFF) core \
710 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
711 testsuite/site.exp site.bak site.exp stage stage1 stage2
713 .PHONY: install-exec-local install-data-local
714 .PHONY: install-exec-bindir install-exec-tooldir
716 install-exec-local: install-exec-bindir @install_tooldir@
718 install-exec-bindir: $(noinst_PROGRAMS)
719 $(mkinstalldirs) $(DESTDIR)$(bindir)
720 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
721 if test -f $$p; then \
722 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
723 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
727 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
728 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
729 n=`echo as | sed '$(transform)'`; \
730 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
731 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
732 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
733 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
738 # These exist for maintenance purposes.
740 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
744 rm -f stage && ln -s stage1 stage
745 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
747 rm -f stage && ln -s stage2 stage
748 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
749 $(MAKE) comparison against=stage2
752 rm -f stage && ln -s stage1 stage
753 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
755 rm -f stage && ln -s stage2 stage
756 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
757 $(MAKE) comparison against=stage2
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
764 # Copy the object files from a particular stage into a subdirectory.
767 -mv $(STAGESTUFF) stage1
768 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
772 -mv $(STAGESTUFF) stage2
773 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
777 -mv $(STAGESTUFF) stage3
778 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
782 # This rule is derived from corresponding code in the Makefile.in for gcc.
783 # The "tail +16c" is to bypass headers which may include timestamps or
784 # temporary assembly file names.
787 for file in *.o ; do \
788 tail +16c ./$$file > tmp-foo1; \
789 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
790 if cmp tmp-foo1 tmp-foo2 ; then \
793 echo $$file differs ; \
801 .PHONY: de-stage1 de-stage2 de-stage3
804 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
808 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
812 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
815 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt