1## Process this file with automake to generate Makefile.in 2## 3# Copyright (C) 1993-2024 Free Software Foundation, Inc. 4# 5# This program 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. 9# 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. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects 19ACLOCAL_AMFLAGS = -Im4 -I.. -I../config 20 21GNULIB_PARENT_DIR = .. 22@am__include@ @am__quote@$(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc@am__quote@ 23 24srccom = $(srcdir)/common 25srcroot = $(srcdir)/.. 26 27SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@ 28 29## We don't set some of these vars here, but we need to define them so they may 30## be used consistently in local.mk files we include below. 31pkginclude_HEADERS = 32check_PROGRAMS = 33noinst_PROGRAMS = 34EXTRA_LIBRARIES = 35noinst_LIBRARIES = 36EXTRA_PROGRAMS = 37BUILT_SOURCES = 38 39CLEANFILES = 40DISTCLEANFILES = 41MOSTLYCLEANFILES = core 42## We build some objects ourselves directly that Automake doesn't track, so 43## make sure all objects in subdirs get cleaned up. 44MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o) 45 46CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh 47 48AM_CFLAGS = \ 49 $(WERROR_CFLAGS) \ 50 $(WARN_CFLAGS) \ 51 $(AM_CFLAGS_$(subst -,_,$(@D))) \ 52 $(AM_CFLAGS_$(subst -,_,$(@D)_$(@F))) 53AM_CPPFLAGS = \ 54 $(INCGNU) \ 55 -I$(srcroot) \ 56 -I$(srcroot)/include \ 57 -I../bfd \ 58 -I.. \ 59 -I$(@D) \ 60 -I$(srcdir)/$(@D) \ 61 $(SIM_HW_CFLAGS) \ 62 $(SIM_INLINE) \ 63 $(AM_CPPFLAGS_$(subst -,_,$(@D))) \ 64 $(AM_CPPFLAGS_$(subst -,_,$(@D)_$(@F))) 65 66AM_CPPFLAGS_FOR_BUILD = \ 67 -I$(srcroot)/include \ 68 $(SIM_HW_CFLAGS) \ 69 $(SIM_INLINE) 70COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(BUILD_WERROR_CFLAGS) $(BUILD_WARN_CFLAGS) 71LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ 72 73## Deps to add to the install-data-local target. 74SIM_INSTALL_DATA_LOCAL_DEPS = 75## Deps to add to the install-exec-local target. 76SIM_INSTALL_EXEC_LOCAL_DEPS = 77## Deps to add to the uninstall-local target. 78SIM_UNINSTALL_LOCAL_DEPS = 79 80# Generate target constants for newlib/libgloss from its source tree. 81# This file is shipped with distributions so we build in the source dir. 82# Use `make nltvals' to rebuild. 83.PHONY: nltvals 84nltvals: 85 $(srccom)/gennltvals.py --cpp "$(CPP)" 86 87if ENABLE_SIM 88pkginclude_HEADERS += \ 89 $(srcroot)/include/sim/callback.h \ 90 $(srcroot)/include/sim/sim.h 91endif 92 93## Used for our custom rules to calculate the dependency output base name. 94## This form aligns with Automake's default rules. 95SIM_DEPBASE = $(@D)/$(DEPDIR)/$(@F:.o=) 96## Actual full compile command like Automake's default rules. 97SIM_COMPILE = \ 98 $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(SIM_DEPBASE).Tpo -c -o $@ $< && \ 99 $(am__mv) $(SIM_DEPBASE).Tpo $(SIM_DEPBASE).Po 100 101include common/local.mk 102include igen/local.mk 103include testsuite/local.mk 104 105## Arch includes must come after common/local.mk. 106if SIM_ENABLE_ARCH_aarch64 107include aarch64/local.mk 108endif 109if SIM_ENABLE_ARCH_arm 110include arm/local.mk 111endif 112if SIM_ENABLE_ARCH_avr 113include avr/local.mk 114endif 115if SIM_ENABLE_ARCH_bfin 116include bfin/local.mk 117endif 118if SIM_ENABLE_ARCH_bpf 119include bpf/local.mk 120endif 121if SIM_ENABLE_ARCH_cr16 122include cr16/local.mk 123endif 124if SIM_ENABLE_ARCH_cris 125include cris/local.mk 126endif 127if SIM_ENABLE_ARCH_d10v 128include d10v/local.mk 129endif 130if SIM_ENABLE_ARCH_erc32 131include erc32/local.mk 132endif 133if SIM_ENABLE_ARCH_examples 134include example-synacor/local.mk 135endif 136if SIM_ENABLE_ARCH_frv 137include frv/local.mk 138endif 139if SIM_ENABLE_ARCH_ft32 140include ft32/local.mk 141endif 142if SIM_ENABLE_ARCH_h8300 143include h8300/local.mk 144endif 145if SIM_ENABLE_ARCH_iq2000 146include iq2000/local.mk 147endif 148if SIM_ENABLE_ARCH_lm32 149include lm32/local.mk 150endif 151if SIM_ENABLE_ARCH_m32c 152include m32c/local.mk 153endif 154if SIM_ENABLE_ARCH_m32r 155include m32r/local.mk 156endif 157if SIM_ENABLE_ARCH_m68hc11 158include m68hc11/local.mk 159endif 160if SIM_ENABLE_ARCH_mcore 161include mcore/local.mk 162endif 163if SIM_ENABLE_ARCH_microblaze 164include microblaze/local.mk 165endif 166if SIM_ENABLE_ARCH_mips 167include mips/local.mk 168endif 169if SIM_ENABLE_ARCH_mn10300 170include mn10300/local.mk 171endif 172if SIM_ENABLE_ARCH_moxie 173include moxie/local.mk 174endif 175if SIM_ENABLE_ARCH_msp430 176include msp430/local.mk 177endif 178if SIM_ENABLE_ARCH_or1k 179include or1k/local.mk 180endif 181if SIM_ENABLE_ARCH_ppc 182include ppc/local.mk 183endif 184if SIM_ENABLE_ARCH_pru 185include pru/local.mk 186endif 187if SIM_ENABLE_ARCH_riscv 188include riscv/local.mk 189endif 190if SIM_ENABLE_ARCH_rl78 191include rl78/local.mk 192endif 193if SIM_ENABLE_ARCH_rx 194include rx/local.mk 195endif 196if SIM_ENABLE_ARCH_sh 197include sh/local.mk 198endif 199if SIM_ENABLE_ARCH_v850 200include v850/local.mk 201endif 202 203install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS) 204 $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir) 205 lib=`echo sim | sed '$(program_transform_name)'`; \ 206 for d in $(SIM_ENABLED_ARCHES); do \ 207 n="$$lib"; \ 208 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ 209 n="lib$$n.a"; \ 210 $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \ 211 done 212 213install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS) 214 $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) 215 run=`echo run | sed '$(program_transform_name)'`; \ 216 for d in $(SIM_ENABLED_ARCHES); do \ 217 n="$$run"; \ 218 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ 219 $(LIBTOOL) --mode=install \ 220 $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \ 221 done 222 223uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS) 224 rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a 225 for d in $(SIM_ENABLED_ARCHES); do \ 226 rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \ 227 done 228