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 \
430 # Multi files in config
433 config/e-crisaout.c \
435 config/e-i386aout.c \
436 config/e-i386coff.c \
438 config/e-mipsecoff.c \
478 CONFIG_ATOF_CFILES = \
482 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
484 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
485 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_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
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
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
500 diststuff: $(EXTRA_DIST) info
502 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
504 # Now figure out from those variables how to compile and link.
506 BASEDIR = $(srcdir)/..
507 BFDDIR = $(BASEDIR)/bfd
508 INCDIR = $(BASEDIR)/include
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\""
519 # How to link with both our special library facilities
520 # and the system's installed libraries.
522 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
524 # Files to be copied away after each stage in building.
525 STAGESTUFF = *.o $(noinst_PROGRAMS)
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)
540 check-DEJAGNU: site.exp
541 if [ -d testsuite ]; then \
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); \
553 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
554 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
556 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
559 # The m68k operand parser.
561 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
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; \
581 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
582 if [ $$f = "m68k-parse.y" ]; then \
583 rm -f m68k-parse.y; \
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
589 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ m68k-parse.c $(NO_WERROR)
590 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
593 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
594 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
596 $(COMPILE) -c m68k-parse.c $(NO_WERROR)
599 # Don't let the .y.h rule clobber m68k-parse.h.
600 m68k-parse.h: ; @true
601 $(srcdir)/config/m68k-parse.h: ; @true
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 bfin-parse.h $(srcdir)/config/bfin-defs.h \
607 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
610 $(srcdir)/config/bfin-defs.h: ; @true
612 bfin-lex.c: $(srcdir)/config/bfin-lex.l
613 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
614 bfin-lex.o: bfin-lex.c
616 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
617 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
620 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
621 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
623 $(COMPILE) -c bfin-lex.c $(NO_WERROR)
626 # The instruction table specification lexical analyzer and parser.
628 # Disable -Werror, if it has been enabled, since old versions of bison/
629 # yacc will produce working code which contain compile time warnings.
630 itbl-lex.o: itbl-lex.c
632 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
633 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
636 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
637 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639 $(COMPILE) -c itbl-lex.c $(NO_WERROR)
642 # Disable -Werror, if it has been enabled, since old versions of bison/
643 # yacc will produce working code which contain compile time warnings.
644 itbl-parse.o: itbl-parse.c
646 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-parse.c $(NO_WERROR)
647 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
650 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
651 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
653 $(COMPILE) -c itbl-parse.c $(NO_WERROR)
656 itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
657 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
659 # stand-alone itbl assembler & disassembler
661 EXTRA_PROGRAMS = itbl-test
662 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
663 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
665 itbl-tops.o: itbl-ops.c
667 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
668 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
671 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
672 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
674 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
677 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
679 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
680 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
683 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
684 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
686 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
691 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
693 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
694 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
695 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
696 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
698 # Remake the info files.
700 MOSTLYCLEANFILES = $(STAGESTUFF) core \
701 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
702 testsuite/site.exp site.bak site.exp stage stage1 stage2
704 .PHONY: install-exec-local install-data-local
705 .PHONY: install-exec-bindir install-exec-tooldir
707 install-exec-local: install-exec-bindir @install_tooldir@
709 install-exec-bindir: $(noinst_PROGRAMS)
710 $(mkinstalldirs) $(DESTDIR)$(bindir)
711 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
712 if test -f $$p; then \
713 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
714 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
718 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
719 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
720 n=`echo as | sed '$(transform)'`; \
721 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
722 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
723 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
724 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
729 # These exist for maintenance purposes.
731 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
735 rm -f stage && ln -s stage1 stage
736 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
738 rm -f stage && ln -s stage2 stage
739 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
740 $(MAKE) comparison against=stage2
743 rm -f stage && ln -s stage1 stage
744 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
746 rm -f stage && ln -s stage2 stage
747 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
748 $(MAKE) comparison against=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
755 # Copy the object files from a particular stage into a subdirectory.
758 -mv $(STAGESTUFF) stage1
759 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
763 -mv $(STAGESTUFF) stage2
764 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
768 -mv $(STAGESTUFF) stage3
769 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
773 # This rule is derived from corresponding code in the Makefile.in for gcc.
774 # The "tail +16c" is to bypass headers which may include timestamps or
775 # temporary assembly file names.
778 for file in *.o ; do \
779 tail +16c ./$$file > tmp-foo1; \
780 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
781 if cmp tmp-foo1 tmp-foo2 ; then \
784 echo $$file differs ; \
792 .PHONY: de-stage1 de-stage2 de-stage3
795 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
799 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
803 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
806 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt