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
40 # Regular source files.
73 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
105 # CPU files in config.
107 TARGET_CPU_CFILES = \
133 config/tc-m68hc11.c \
138 config/tc-microblaze.c \
141 config/tc-mn10200.c \
142 config/tc-mn10300.c \
147 config/tc-openrisc.c \
164 config/tc-xstormy16.c \
169 config/xtensa-relax.c
171 TARGET_CPU_HFILES = \
197 config/tc-m68hc11.h \
202 config/tc-microblaze.h \
205 config/tc-mn10200.h \
206 config/tc-mn10300.h \
210 config/tc-openrisc.h \
227 config/tc-xstormy16.h \
232 config/xtensa-relax.h
234 # OBJ files in config
236 OBJ_FORMAT_CFILES = \
242 config/obj-fdpicelf.c \
247 OBJ_FORMAT_HFILES = \
253 config/obj-fdpicelf.h \
258 # Emulation header files in config
263 config/te-armeabi.h \
264 config/te-armlinuxeabi.h \
266 config/te-epoc-pe.h \
267 config/te-freebsd.h \
268 config/te-generic.h \
273 config/te-hppalinux64.h \
274 config/te-i386aix.h \
275 config/te-ia64aix.h \
276 config/te-interix.h \
282 config/te-nbsd532.h \
283 config/te-netware.h \
284 config/te-pc532mach.h \
288 config/te-solaris.h \
289 config/te-sparcaout.h \
292 config/te-symbian.h \
294 config/te-vxworks.h \
300 # Multi files in config
303 config/e-crisaout.c \
305 config/e-i386aout.c \
306 config/e-i386coff.c \
308 config/e-mipsecoff.c \
348 CONFIG_ATOF_CFILES = \
352 OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
354 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) \
355 $(TARG_ENV_HFILES) $(TARG_ENV_CFILES) $(OBJ_FORMAT_HFILES) \
356 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
358 po/POTFILES.in: @MAINT@ Makefile
359 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
360 && mv tmp $(srcdir)/po/POTFILES.in
362 # Note: GASP is now deprecated and has been removed. It is still
363 # available in the CVS archive or older binutils releases if it is needed.
364 noinst_PROGRAMS = as-new
365 noinst_SCRIPTS = $(GDBINIT)
366 EXTRA_SCRIPTS = .gdbinit
368 EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
369 bfin-parse.c bfin-parse.h bfin-lex.c \
370 rx-parse.c rx-parse.h
372 diststuff: $(EXTRA_DIST) info
374 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
376 # Now figure out from those variables how to compile and link.
378 BASEDIR = $(srcdir)/..
379 BFDDIR = $(BASEDIR)/bfd
380 INCDIR = $(BASEDIR)/include
382 # This is the variable actually used when we compile.
383 # Specify the directories to be searched for header files.
384 # Both . and srcdir are used, in that order,
385 # so that tm.h and config.h will be found in the compilation
386 # subdirectory rather than in the source directory.
387 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
388 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
389 -DLOCALEDIR="\"$(datadir)/locale\""
391 # How to link with both our special library facilities
392 # and the system's installed libraries.
394 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
396 # Files to be copied away after each stage in building.
397 STAGESTUFF = *.o $(noinst_PROGRAMS)
399 as_new_SOURCES = $(GAS_CFILES)
400 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
401 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
402 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
403 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
404 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
405 $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
406 $(TARG_ENV_CFILES) $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
412 check-DEJAGNU: site.exp
413 if [ -d testsuite ]; then \
418 rm -f testsuite/site.exp
419 cp site.exp testsuite/site.exp
420 rootme=`pwd`; export rootme; \
421 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
422 EXPECT=${EXPECT} ; export EXPECT ; \
423 runtest=$(RUNTEST); \
425 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
426 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
428 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
431 # The m68k operand parser.
433 EXTRA_as_new_SOURCES += config/m68k-parse.y config/bfin-parse.y
435 # If m68k-parse.y is in a different directory, then ylwrap will use an
436 # absolute path when it invokes yacc, which will cause yacc to put the
437 # absolute path into the generated file. That's a pain when it comes
438 # to generating snapshots, because it introduces spurious diffs.
439 # Since when we make the snapshots $(srcdir) = ".", we check for that
440 # case and handle it differently. This means that anybody who
441 # configures with $(srcdir) = "." will have to set their path in the
442 # debugger if they want to debug m68k-parse.y. This is bad, but on
443 # the other hand it's good that people who use the prebuilt
444 # m68k-parse.c don't get a spurious absolute path.
445 m68k-parse.c: $(srcdir)/config/m68k-parse.y
446 f=$(srcdir)/config/m68k-parse.y; \
447 if [ $$f = "./config/m68k-parse.y" ]; then \
448 ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
449 ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
450 cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
453 $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
454 if [ $$f = "m68k-parse.y" ]; then \
455 rm -f m68k-parse.y; \
457 # Disable -Werror, if it has been enabled, since old versions of bison/
458 # yacc will produce working code which contain compile time warnings.
459 m68k-parse.o: m68k-parse.c
461 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
462 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
465 source='m68k-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
466 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
468 $(COMPILE) -c `test -f m68k-parse.c || echo $(srcdir)/`m68k-parse.c $(NO_WERROR)
471 # Don't let the .y.h rule clobber m68k-parse.h.
472 m68k-parse.h: ; @true
473 $(srcdir)/config/m68k-parse.h: ; @true
475 bfin-parse.c: $(srcdir)/config/bfin-parse.y
476 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
477 bfin-parse.h: bfin-parse.c
478 bfin-parse.o: bfin-parse.c \
479 $(srcdir)/config/bfin-aux.h $(srcdir)/config/bfin-defs.h \
480 $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
482 bfin-parse.h: ; @true
483 $(srcdir)/config/bfin-parse.h: ; @true
485 bfin-lex.c: $(srcdir)/config/bfin-lex.l
486 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
487 bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
489 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
490 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
493 source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
494 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
496 $(COMPILE) -c `test -f bfin-lex.c || echo $(srcdir)/`bfin-lex.c $(NO_WERROR)
499 rx-parse.c: $(srcdir)/config/rx-parse.y
500 $(SHELL) $(YLWRAP) $(srcdir)/config/rx-parse.y y.tab.c rx-parse.c y.tab.h rx-parse.h -- $(YACCCOMPILE) -d ;
501 rx-parse.h: rx-parse.c
502 rx-parse.o: rx-parse.c rx-parse.h $(srcdir)/config/rx-defs.h \
503 $(INCDIR)/elf/common.h $(INCDIR)/elf/rx.h $(BFDDIR)/libbfd.h
506 $(srcdir)/config/rx-defs.h: ; @true
508 # The instruction table specification lexical analyzer and parser.
510 # Disable -Werror, if it has been enabled, since old versions of bison/
511 # yacc will produce working code which contain compile time warnings.
512 itbl-lex.o: itbl-lex.c itbl-parse.h
514 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
515 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
518 source='itbl-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
519 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
521 $(COMPILE) -c `test -f itbl-lex.c || echo $(srcdir)/`itbl-lex.c $(NO_WERROR)
524 # Disable -Werror, if it has been enabled, since old versions of bison/
525 # yacc will produce working code which contain compile time warnings.
526 itbl-parse.o: itbl-parse.c
528 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
529 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
532 source='itbl-parse.c' object='$@' libtool=no @AMDEPBACKSLASH@
533 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
535 $(COMPILE) -c `test -f itbl-parse.c || echo $(srcdir)/`itbl-parse.c $(NO_WERROR)
538 itbl-parse.c: $(srcdir)/itbl-parse.y
539 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
541 itbl-parse.h: itbl-parse.c ; @true
543 itbl-ops.o: itbl-parse.h
545 # stand-alone itbl assembler & disassembler
547 EXTRA_PROGRAMS = itbl-test
548 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
549 itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
551 itbl-tops.o: itbl-ops.c itbl-parse.h
553 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
554 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
557 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
558 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
560 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
563 itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c
565 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
566 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
569 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
570 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
572 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
577 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
579 cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
580 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
581 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
582 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
584 # Remake the info files.
586 MOSTLYCLEANFILES = $(STAGESTUFF) core \
587 testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
588 testsuite/site.exp site.bak site.exp stage stage1 stage2
590 .PHONY: install-exec-local install-data-local
591 .PHONY: install-exec-bindir install-exec-tooldir
593 install-exec-local: install-exec-bindir @install_tooldir@
595 install-exec-bindir: $(noinst_PROGRAMS)
596 $(mkinstalldirs) $(DESTDIR)$(bindir)
597 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
598 if test -f $$p; then \
599 echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
600 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
604 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
605 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
606 n=`echo as | sed '$(transform)'`; \
607 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
608 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
609 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
610 || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
615 # These exist for maintenance purposes.
617 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
621 rm -f stage && ln -s stage1 stage
622 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
624 rm -f stage && ln -s stage2 stage
625 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
626 $(MAKE) comparison against=stage2
629 rm -f stage && ln -s stage1 stage
630 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
632 rm -f stage && ln -s stage2 stage
633 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
634 $(MAKE) comparison against=stage2
637 rm -f stage && ln -s stage2 stage
638 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
639 $(MAKE) comparison against=stage2
641 # Copy the object files from a particular stage into a subdirectory.
644 -mv $(STAGESTUFF) stage1
645 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
649 -mv $(STAGESTUFF) stage2
650 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
654 -mv $(STAGESTUFF) stage3
655 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
659 # This rule is derived from corresponding code in the Makefile.in for gcc.
660 # The "tail +16c" is to bypass headers which may include timestamps or
661 # temporary assembly file names.
664 for file in *.o ; do \
665 tail +16c ./$$file > tmp-foo1; \
666 if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
667 if cmp tmp-foo1 tmp-foo2 ; then \
670 echo $$file differs ; \
678 .PHONY: de-stage1 de-stage2 de-stage3
681 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
685 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
689 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
692 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt