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 \
281 config/tc-openrisc.c \
297 config/tc-xstormy16.c \
302 config/xtensa-relax.c
304 TARGET_CPU_HFILES = \
330 config/tc-m68hc11.h \
335 config/tc-microblaze.h \
338 config/tc-mn10200.h \
339 config/tc-mn10300.h \
343 config/tc-openrisc.h \
359 config/tc-xstormy16.h \
364 config/xtensa-relax.h
366 # OBJ files in config
368 OBJ_FORMAT_CFILES = \
374 config/obj-fdpicelf.c \
379 OBJ_FORMAT_HFILES = \
385 config/obj-fdpicelf.h \
390 # Emulation header files in config
395 config/te-armeabi.h \
396 config/te-armlinuxeabi.h \
398 config/te-epoc-pe.h \
399 config/te-freebsd.h \
400 config/te-generic.h \
405 config/te-hppalinux64.h \
406 config/te-i386aix.h \
407 config/te-ia64aix.h \
408 config/te-interix.h \
414 config/te-nbsd532.h \
415 config/te-netware.h \
416 config/te-pc532mach.h \
420 config/te-solaris.h \
421 config/te-sparcaout.h \
424 config/te-symbian.h \
426 config/te-vxworks.h \
429 # Multi files in config
432 config/e-crisaout.c \
434 config/e-i386aout.c \
435 config/e-i386coff.c \
437 config/e-mipsecoff.c \
477 CONFIG_ATOF_CFILES = \
481 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
483 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
484 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_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
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
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
499 diststuff: $(EXTRA_DIST) info
501 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
503 # Now figure out from those variables how to compile and link.
505 BASEDIR = $(srcdir)/..
506 BFDDIR = $(BASEDIR)/bfd
507 INCDIR = $(BASEDIR)/include
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\""
518 # How to link with both our special library facilities
519 # and the system's installed libraries.
521 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
523 # Files to be copied away after each stage in building.
524 STAGESTUFF = *.o $(noinst_PROGRAMS)
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)
539 check-DEJAGNU: site.exp
540 if [ -d testsuite ]; then \
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); \
552 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
553 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
555 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
558 # The m68k operand parser.
560 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
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; \
580 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
581 if [ $$f = "m68k-parse.y" ]; then \
582 rm -f m68k-parse.y; \
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
588 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ m68k-parse.c $(NO_WERROR)
589 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
592 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
593 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
595 $(COMPILE) -c m68k-parse.c $(NO_WERROR)
598 # Don't let the .y.h rule clobber m68k-parse.h.
599 m68k-parse.h: ; @true
600 $(srcdir)/config/m68k-parse.h: ; @true
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
609 $(srcdir)/config/bfin-defs.h: ; @true
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
615 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
616 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
619 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
620 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
622 $(COMPILE) -c bfin-lex.c $(NO_WERROR)
625 # The instruction table specification lexical analyzer and parser.
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
631 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
632 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
635 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
636 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
638 $(COMPILE) -c itbl-lex.c $(NO_WERROR)
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
645 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-parse.c $(NO_WERROR)
646 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
649 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
650 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
652 $(COMPILE) -c itbl-parse.c $(NO_WERROR)
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
658 # stand-alone itbl assembler & disassembler
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@
664 itbl-tops.o: itbl-ops.c
666 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
667 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
670 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
671 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
673 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
676 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
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
682 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
683 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
685 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
690 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
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
697 # Remake the info files.
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
703 .PHONY: install-exec-local install-data-local
704 .PHONY: install-exec-bindir install-exec-tooldir
706 install-exec-local: install-exec-bindir @install_tooldir@
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)/'`; \
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); \
728 # These exist for maintenance purposes.
730 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
734 rm -f stage && ln -s stage1 stage
735 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
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
742 rm -f stage && ln -s stage1 stage
743 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
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
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
754 # Copy the object files from a particular stage into a subdirectory.
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
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
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
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.
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 \
783 echo $$file differs ; \
791 .PHONY: de-stage1 de-stage2 de-stage3
794 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
798 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
802 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
805 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt