1 ## Process this file with automake to generate Makefile.in
3 # Copyright (C) 2012-2023 Free Software Foundation, Inc.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
20 AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects info-in-builddir no-texinfo.tex
21 ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
23 MAINTAINERCLEANFILES =
27 tooldir = $(exec_prefix)/$(target_alias)
29 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
30 # -I../zlib, unless we were configured with --with-system-zlib, in which
31 # case both are empty.
35 YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi`
36 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
38 # Automake 1.10+ disables lex and yacc output file regeneration if
39 # maintainer mode is disabled. Avoid this.
43 WARN_CFLAGS = @WARN_CFLAGS@ @WARN_WRITE_STRINGS@
44 NO_WERROR = @NO_WERROR@
45 AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) $(ZSTD_CFLAGS)
47 TARG_CPU = @target_cpu_type@
48 TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
49 TARG_CPU_O = config/tc-@target_cpu_type@.@OBJEXT@
50 TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
51 OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
52 OBJ_FORMAT_O = config/obj-@obj_format@.@OBJEXT@
53 OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
54 TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
55 ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
56 ATOF_TARG_O = config/atof-@atof@.@OBJEXT@
58 # use @target_cpu_type@ for refering to configured target name
59 IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
60 IT_SRCS=itbl-parse.c itbl-lex-wrapper.c $(srcdir)/itbl-ops.c
61 IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
62 IT_OBJS=itbl-parse.@OBJEXT@ itbl-lex.@OBJEXT@ itbl-ops.@OBJEXT@
65 # Regular source files.
102 CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
136 # CPU files in config.
138 TARGET_CPU_CFILES = \
139 config/tc-aarch64.c \
153 config/tc-epiphany.c \
165 config/tc-loongarch.c \
168 config/tc-m68hc11.c \
174 config/tc-microblaze.c \
177 config/tc-mn10200.c \
178 config/tc-mn10300.c \
203 config/tc-tilepro.c \
208 config/tc-xstormy16.c \
214 TARGET_CPU_HFILES = \
215 config/tc-aarch64.h \
229 config/tc-epiphany.h \
243 config/tc-m68hc11.h \
249 config/tc-microblaze.h \
252 config/tc-mn10200.h \
253 config/tc-mn10300.h \
277 config/tc-tilepro.h \
282 config/tc-xstormy16.h \
288 TARGET_EXTRA_FILES = \
289 config/bfin-lex-wrapper.c \
290 config/xtensa-relax.c \
291 config/xtensa-relax.h \
295 # OBJ files in config
297 OBJ_FORMAT_CFILES = \
303 config/obj-fdpicelf.c \
308 OBJ_FORMAT_HFILES = \
314 config/obj-fdpicelf.h \
319 # Emulation header files in config
324 config/te-armeabi.h \
325 config/te-armfbsdeabi.h \
326 config/te-armfbsdvfp.h \
327 config/te-armlinuxeabi.h \
328 config/te-csky_abiv1.h \
329 config/te-csky_abiv1_linux.h \
330 config/te-csky_abiv2.h \
331 config/te-csky_abiv2_linux.h \
332 config/te-freebsd.h \
333 config/te-generic.h \
338 config/te-hppalinux64.h \
339 config/te-ia64aix.h \
340 config/te-interix.h \
344 config/te-nbsd532.h \
345 config/te-pc532mach.h \
347 config/te-solaris.h \
349 config/te-vxworks.h \
355 # Multi files in config
358 config/e-crisaout.c \
360 config/e-i386aout.c \
361 config/e-i386coff.c \
365 CONFIG_ATOF_CFILES = \
369 POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) \
370 $(TARG_ENV_HFILES) $(TARG_ENV_CFILES) $(OBJ_FORMAT_HFILES) \
371 $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
372 $(TARGET_EXTRA_FILES) $(HFILES) $(CFILES)
373 po/POTFILES.in: @MAINT@ Makefile
374 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
375 && mv tmp $(srcdir)/po/POTFILES.in
377 # Note: GASP is now deprecated and has been removed. It is still
378 # available in the CVS archive or older binutils releases if it is needed.
379 noinst_PROGRAMS = as-new
380 noinst_SCRIPTS = $(GDBINIT)
381 EXTRA_SCRIPTS = .gdbinit
383 EXTRA_DIST = config/m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
384 config/bfin-parse.c config/bfin-parse.h config/bfin-lex.c \
385 config/rl78-parse.c config/rl78-parse.h \
386 config/rx-parse.c config/rx-parse.h \
387 config/loongarch-parse.c config/loongarch-parse.h config/loongarch-lex.c
389 diststuff: $(EXTRA_DIST) info
391 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
393 # Now figure out from those variables how to compile and link.
395 BASEDIR = $(srcdir)/..
396 BFDDIR = $(BASEDIR)/bfd
397 INCDIR = $(BASEDIR)/include
399 # This is the variable actually used when we compile.
400 # Specify the directories to be searched for header files.
401 # Both . and srcdir are used, in that order,
402 # so that tm.h and config.h will be found in the compilation
403 # subdirectory rather than in the source directory.
404 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
405 -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ @LARGEFILE_CPPFLAGS@ \
406 -DLOCALEDIR="\"$(datadir)/locale\""
408 # How to link with both our special library facilities
409 # and the system's installed libraries.
411 GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
413 # Files to be copied away after each stage in building.
414 STAGESTUFF = *.@OBJEXT@ $(noinst_PROGRAMS)
416 as_new_SOURCES = $(GAS_CFILES)
417 as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
418 $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM) $(ZLIB) $(ZSTD_LIBS)
419 as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
420 $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
421 EXTRA_as_new_SOURCES = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
422 $(TARGET_CPU_HFILES) $(TARGET_EXTRA_FILES) $(TARG_ENV_CFILES) \
423 $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) \
424 $(CONFIG_ATOF_CFILES) $(MULTI_CFILES)
430 check-DEJAGNU: site.exp
431 if [ -d testsuite ]; then \
436 rm -f testsuite/site.exp
437 cp site.exp testsuite/site.exp
438 rootme=`pwd`; export rootme; \
439 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
440 LC_ALL=C; export LC_ALL; \
441 EXPECT=${EXPECT} ; export EXPECT ; \
442 runtest=$(RUNTEST); \
444 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
445 $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
447 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
450 development.exp: $(BFDDIR)/development.sh
451 $(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \
452 | $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
454 config/tc-i386.o: $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h
456 i386_tbl_deps = $(srcdir)/../opcodes/i386-opc.tbl \
457 $(srcdir)/../opcodes/i386-reg.tbl \
458 $(srcdir)/../opcodes/i386-gen.c $(srcdir)/../opcodes/i386-opc.h
460 $(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h $(srcdir)/../opcodes/i386%mnem.h: @MAINT@ $(i386_tbl_deps)
461 @echo '"$@" is outdated wrt "$?"' >&2
462 @echo 'Please rebuild from the top level or in $(CURDIR)/../opcodes/' >&2
465 EXTRA_as_new_SOURCES += config/m68k-parse.y
466 config/m68k-parse.c: $(srcdir)/config/m68k-parse.y
467 $(SHELL) $(YLWRAP) $(srcdir)/config/m68k-parse.y y.tab.c $@ -- $(YACCCOMPILE)
468 config/m68k-parse.h: config/m68k-parse.c
471 EXTRA_as_new_SOURCES += config/bfin-parse.y
472 config/bfin-parse.c: $(srcdir)/config/bfin-parse.y
473 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c $@ y.tab.h config/bfin-parse.h -- $(YACCCOMPILE) -d ;
474 config/bfin-parse.h: config/bfin-parse.c
477 EXTRA_as_new_SOURCES += config/bfin-lex.l
478 config/bfin-lex.c: $(srcdir)/config/bfin-lex.l
479 $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c $@ -- $(LEXCOMPILE)
481 config/bfin-lex-wrapper.@OBJEXT@: config/bfin-lex.c config/bfin-parse.h
483 EXTRA_as_new_SOURCES += config/rl78-parse.y
484 config/rl78-parse.c: $(srcdir)/config/rl78-parse.y
485 $(SHELL) $(YLWRAP) $(srcdir)/config/rl78-parse.y y.tab.c $@ y.tab.h config/rl78-parse.h -- $(YACCCOMPILE) -d ;
486 config/rl78-parse.h: config/rl78-parse.c
489 EXTRA_as_new_SOURCES += config/rx-parse.y
490 config/rx-parse.c: $(srcdir)/config/rx-parse.y
491 $(SHELL) $(YLWRAP) $(srcdir)/config/rx-parse.y y.tab.c $@ y.tab.h config/rx-parse.h -- $(YACCCOMPILE) -d ;
492 config/rx-parse.h: config/rx-parse.c
495 # The LoongArch lexical analyzer and parser.
496 EXTRA_as_new_SOURCES += config/loongarch-parse.y
497 config/loongarch-parse.c: $(srcdir)/config/loongarch-parse.y
498 $(SHELL) $(YLWRAP) $(srcdir)/config/loongarch-parse.y y.tab.c $@ y.tab.h config/loongarch-parse.h -- $(YACCCOMPILE) -d ;
499 config/loongarch-parse.h: config/loongarch-parse.c
502 EXTRA_as_new_SOURCES += config/loongarch-lex.l
503 config/loongarch-lex.c: $(srcdir)/config/loongarch-lex.l
504 $(SHELL) $(YLWRAP) $(srcdir)/config/loongarch-lex.l lex.yy.c $@ -- $(LEXCOMPILE)
506 config/loongarch-lex-wrapper.@OBJEXT@: config/loongarch-lex.c config/loongarch-parse.h
508 # The mips instruction table specification lexical analyzer and parser.
510 itbl-lex-wrapper.@OBJEXT@: itbl-lex.c itbl-parse.h
512 itbl-parse.c: $(srcdir)/itbl-parse.y
513 $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c $@ y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
515 itbl-parse.h: itbl-parse.c
518 itbl-ops.@OBJEXT@: itbl-parse.h
520 # stand-alone itbl assembler & disassembler
522 EXTRA_PROGRAMS = itbl-test
523 itbl_test_SOURCES = itbl-parse.y itbl-lex.l
524 itbl_test_LDADD = itbl-tops.@OBJEXT@ itbl-test.@OBJEXT@ $(GASLIBS) @LEXLIB@
526 itbl-tops.@OBJEXT@: itbl-ops.c itbl-parse.h
528 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ -c -DSTAND_ALONE $(srcdir)/itbl-ops.c
529 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
532 source='itbl-ops.c' object='$@' libtool=no @AMDEPBACKSLASH@
533 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
535 $(COMPILE) -o $@ -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
538 itbl-test.@OBJEXT@: $(srcdir)/testsuite/gas/all/itbl-test.c
540 $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
541 mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
544 source='itbl-test.c' object='$@' libtool=no @AMDEPBACKSLASH@
545 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
547 $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
552 CGEN_CPU_PREFIX = @cgen_cpu_prefix@
554 cgen.@OBJEXT@: cgen.c cgen.h cgen-desc.h subsegs.h \
555 $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
556 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
557 $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
559 # Remake the info files.
561 MOSTLYCLEANFILES = $(STAGESTUFF) core \
562 testsuite/*.@OBJEXT@ testsuite/*.out testsuite/gas.log testsuite/gas.sum \
563 testsuite/site.exp site.bak site.exp development.exp stage stage1 stage2
565 .PHONY: install-exec-local install-data-local
566 .PHONY: install-exec-bindir install-exec-tooldir
568 install-exec-local: install-exec-bindir @install_tooldir@
570 install-exec-bindir: $(noinst_PROGRAMS)
571 $(mkinstalldirs) $(DESTDIR)$(bindir)
572 @list='$(noinst_PROGRAMS)'; for p in $$list; do \
573 if test -f $$p; then \
574 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
575 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
579 install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
580 $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
581 n=`echo as | sed '$(transform)'`; \
582 if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
583 rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
584 ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
585 || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
590 # These exist for maintenance purposes.
592 .PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
594 bootstrap: as-new$(EXEEXT)
596 rm -f stage && ln -s stage1 stage
597 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
599 rm -f stage && ln -s stage2 stage
600 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
601 $(MAKE) comparison against=stage2
604 rm -f stage && ln -s stage1 stage
605 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
607 rm -f stage && ln -s stage2 stage
608 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
609 $(MAKE) comparison against=stage2
612 rm -f stage && ln -s stage2 stage
613 $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
614 $(MAKE) comparison against=stage2
616 # Copy the object files from a particular stage into a subdirectory.
619 -mv $(STAGESTUFF) stage1
620 if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
624 -mv $(STAGESTUFF) stage2
625 if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
629 -mv $(STAGESTUFF) stage3
630 if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
636 for file in *.@OBJEXT@ ; do \
637 f1=./$$file; f2=${against}/$$file; \
638 $(do_compare) > /dev/null 2>&1; \
639 if test $$? -ne 0; then \
640 echo $$file differs ; \
647 .PHONY: de-stage1 de-stage2 de-stage3
650 - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
654 - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
658 - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
661 # Reconfigure if configure.tgt changes.
662 # development.sh is used to determine -Werror default.
663 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.tgt $(BFDDIR)/development.sh
665 EXTRA_DEJAGNU_SITE_CONFIG = development.exp