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 # We have to set this, because autoconf 2.59 does not substitute YFLAGS.
14 # Autoconf 2.61 does, so this can be removed when we upgrade.
17 WARN_CFLAGS = @WARN_CFLAGS@
18 NO_WERROR = @NO_WERROR@
19 AM_CFLAGS = $(WARN_CFLAGS)
21 TARG_CPU = @target_cpu_type@
22 TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
23 TARG_CPU_O = tc-@target_cpu_type@.o
24 TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
25 OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
26 OBJ_FORMAT_O = obj-@obj_format@.o
27 OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
28 TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
29 ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
30 ATOF_TARG_O = atof-@atof@.o
32 # use @target_cpu_type@ for refering to configured target name
33 IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
34 IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
35 IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
36 IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
38 # CPU types. This is only used for dependency information.
100 # Object format types. This is only used for dependency information.
101 # We deliberately omit SOM, since it does not work as a cross assembler.
111 # This is an sh case which sets valid according to whether the CPU
112 # type in the shell variable c and the OS type in the shell variable o
113 # are supported. This helps cuts down on the amount of dependency
121 arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
126 arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
127 | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
132 mips | alpha) valid=yes ;; \
136 maxq | ns32k | tic* | z80 | z8k) valid= ;; \
140 alpha) valid=yes ;; \
152 # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
154 MULTI_CPU_TYPES = i386 mips cris
156 MULTI_CPU_OBJ_VALID = \
161 i386 | cris) valid=yes ;; \
165 i386 | mips) valid=yes ;; \
174 # Regular source files.
207 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
239 # CPU files in config.
241 TARGET_CPU_CFILES = \
267 config/tc-m68hc11.c \
272 config/tc-microblaze.c \
275 config/tc-mn10200.c \
276 config/tc-mn10300.c \
280 config/tc-openrisc.c \
296 config/tc-xstormy16.c \
301 config/xtensa-relax.c
303 TARGET_CPU_HFILES = \
329 config/tc-m68hc11.h \
334 config/tc-microblaze.h \
337 config/tc-mn10200.h \
338 config/tc-mn10300.h \
342 config/tc-openrisc.h \
358 config/tc-xstormy16.h \
363 config/xtensa-relax.h
365 # OBJ files in config
367 OBJ_FORMAT_CFILES = \
373 config/obj-fdpicelf.c \
378 OBJ_FORMAT_HFILES = \
384 config/obj-fdpicelf.h \
389 # Emulation header files in config
394 config/te-armeabi.h \
395 config/te-armlinuxeabi.h \
397 config/te-epoc-pe.h \
398 config/te-freebsd.h \
399 config/te-generic.h \
404 config/te-hppalinux64.h \
405 config/te-i386aix.h \
406 config/te-ia64aix.h \
407 config/te-interix.h \
413 config/te-nbsd532.h \
414 config/te-netware.h \
415 config/te-pc532mach.h \
419 config/te-solaris.h \
420 config/te-sparcaout.h \
423 config/te-symbian.h \
425 config/te-vxworks.h \
428 # Multi files in config
431 config/e-crisaout.c \
433 config/e-i386aout.c \
434 config/e-i386coff.c \
436 config/e-mipsecoff.c \
476 CONFIG_ATOF_CFILES = \
480 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
482 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
483 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
485 po/POTFILES.in: @MAINT@ Makefile
486 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
487 && mv tmp $(srcdir)/po/POTFILES.in
489 # Note: GASP is now deprecated and has been removed. It is still
490 # available in the CVS archive or older binutils releases if it is needed.
491 noinst_PROGRAMS = as-new
492 noinst_SCRIPTS = $(GDBINIT)
493 EXTRA_SCRIPTS = .gdbinit
495 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
496 bfin-parse.c bfin-parse.h bfin-lex.c
498 diststuff: $(EXTRA_DIST) info
500 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
502 # Now figure out from those variables how to compile and link.
504 BASEDIR = $(srcdir)/..
505 BFDDIR = $(BASEDIR)/bfd
506 INCDIR = $(BASEDIR)/include
508 # This is the variable actually used when we compile.
509 # Specify the directories to be searched for header files.
510 # Both . and srcdir are used, in that order,
511 # so that tm.h and config.h will be found in the compilation
512 # subdirectory rather than in the source directory.
513 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
514 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
515 -DLOCALEDIR="\"$(datadir)/locale\""
517 # How to link with both our special library facilities
518 # and the system's installed libraries.
520 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
522 # Files to be copied away after each stage in building.
523 STAGESTUFF = *.o $(noinst_PROGRAMS)
525 as_new_SOURCES = $(GAS_CFILES)
526 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
527 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
528 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
529 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
530 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
531 $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
532 $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
538 check-DEJAGNU: site.exp
539 if [ -d testsuite ]; then \
544 rm -f testsuite/site.exp
545 cp site.exp testsuite/site.exp
546 rootme=`pwd`; export rootme; \
547 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
548 EXPECT=${EXPECT} ; export EXPECT ; \
549 runtest=$(RUNTEST); \
551 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
552 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
554 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
557 # The m68k operand parser.
559 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
561 # If m68k-parse.y is in a different directory, then ylwrap will use an
562 # absolute path when it invokes yacc, which will cause yacc to put the
563 # absolute path into the generated file. That's a pain when it comes
564 # to generating snapshots, because it introduces spurious diffs.
565 # Since when we make the snapshots $(srcdir) = ".", we check for that
566 # case and handle it differently. This means that anybody who
567 # configures with $(srcdir) = "." will have to set their path in the
568 # debugger if they want to debug m68k-parse.y. This is bad, but on
569 # the other hand it's good that people who use the prebuilt
570 # m68k-parse.c don't get a spurious absolute path.
571 m68k-parse.c: $(srcdir)/config/m68k-parse.y
572 f=$(srcdir)/config/m68k-parse.y; \
573 if [ $$f = "./config/m68k-parse.y" ]; then \
574 ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
575 ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
576 cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
579 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
580 if [ $$f = "m68k-parse.y" ]; then \
581 rm -f m68k-parse.y; \
583 # Disable -Werror, if it has been enabled, since old versions of bison/
584 # yacc will produce working code which contain compile time warnings.
585 m68k-parse.o: m68k-parse.c
587 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ m68k-parse.c $(NO_WERROR)
588 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
591 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
592 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
594 $(COMPILE) -c m68k-parse.c $(NO_WERROR)
597 # Don't let the .y.h rule clobber m68k-parse.h.
598 m68k-parse.h: ; @true
599 $(srcdir)/config/m68k-parse.h: ; @true
601 bfin-parse.c: $(srcdir)/config/bfin-parse.y
602 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
603 bfin-parse.h: bfin-parse.c
604 bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
605 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
608 $(srcdir)/config/bfin-defs.h: ; @true
610 bfin-lex.c: $(srcdir)/config/bfin-lex.l
611 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
612 bfin-lex.o: bfin-lex.c
614 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ bfin-lex.c $(NO_WERROR)
615 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
618 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
619 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
621 $(COMPILE) -c bfin-lex.c $(NO_WERROR)
624 # The instruction table specification lexical analyzer and parser.
626 # Disable -Werror, if it has been enabled, since old versions of bison/
627 # yacc will produce working code which contain compile time warnings.
628 itbl-lex.o: itbl-lex.c
630 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-lex.c $(NO_WERROR)
631 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
634 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
635 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
637 $(COMPILE) -c itbl-lex.c $(NO_WERROR)
640 # Disable -Werror, if it has been enabled, since old versions of bison/
641 # yacc will produce working code which contain compile time warnings.
642 itbl-parse.o: itbl-parse.c
644 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ itbl-parse.c $(NO_WERROR)
645 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
648 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
649 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
651 $(COMPILE) -c itbl-parse.c $(NO_WERROR)
654 itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
655 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
657 # stand-alone itbl assembler & disassembler
659 EXTRA_PROGRAMS = itbl-test
660 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
661 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
663 itbl-tops.o: itbl-ops.c
665 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
666 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
669 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
670 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
672 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
675 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
677 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
678 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
681 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
682 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
684 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
689 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
691 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
692 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
693 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
694 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
696 # Remake the info files.
698 MOSTLYCLEANFILES = $(STAGESTUFF) core \
699 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
700 testsuite/site.exp site.bak site.exp stage stage1 stage2
702 .PHONY: install-exec-local install-data-local
703 .PHONY: install-exec-bindir install-exec-tooldir
705 install-exec-local: install-exec-bindir @install_tooldir@
707 install-exec-bindir: $(noinst_PROGRAMS)
708 $(mkinstalldirs) $(DESTDIR)$(bindir)
709 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
710 if test -f $$p; then \
711 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
712 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
716 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
717 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
718 n=`echo as | sed '$(transform)'`; \
719 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
720 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
721 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
722 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
727 # These exist for maintenance purposes.
729 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
733 rm -f stage && ln -s stage1 stage
734 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
736 rm -f stage && ln -s stage2 stage
737 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
738 $(MAKE) comparison against=stage2
741 rm -f stage && ln -s stage1 stage
742 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
744 rm -f stage && ln -s stage2 stage
745 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
746 $(MAKE) comparison against=stage2
749 rm -f stage && ln -s stage2 stage
750 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
751 $(MAKE) comparison against=stage2
753 # Copy the object files from a particular stage into a subdirectory.
756 -mv $(STAGESTUFF) stage1
757 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
761 -mv $(STAGESTUFF) stage2
762 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
766 -mv $(STAGESTUFF) stage3
767 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
771 # This rule is derived from corresponding code in the Makefile.in for gcc.
772 # The "tail +16c" is to bypass headers which may include timestamps or
773 # temporary assembly file names.
776 for file in *.o ; do \
777 tail +16c ./$$file > tmp-foo1; \
778 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
779 if cmp tmp-foo1 tmp-foo2 ; then \
782 echo $$file differs ; \
790 .PHONY: de-stage1 de-stage2 de-stage3
793 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
797 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
801 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
804 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt