1 ## Process this file with automake to generate Makefile.in
3 # Copyright (C) 1993-2025 Free Software Foundation, Inc.
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.
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. If not, see <http://www.gnu.org/licenses/>.
18 AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects
19 ACLOCAL_AMFLAGS = -Im4 -I.. -I../config
21 GNULIB_PARENT_DIR = ..
22 @am__include@ @am__quote@$(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc@am__quote@
24 srccom = $(srcdir)/common
25 srcroot = $(srcdir)/..
27 SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
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.
41 MOSTLYCLEANFILES = core
42 ## We build some objects ourselves directly that Automake doesn't track, so
43 ## make sure all objects in subdirs get cleaned up.
44 MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o)
46 CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh
51 $(AM_CFLAGS_$(subst -,_,$(@D))) \
52 $(AM_CFLAGS_$(subst -,_,$(@D)_$(@F)))
56 -I$(srcroot)/include \
63 $(AM_CPPFLAGS_$(subst -,_,$(@D))) \
64 $(AM_CPPFLAGS_$(subst -,_,$(@D)_$(@F)))
66 AM_CPPFLAGS_FOR_BUILD = \
67 -I$(srcroot)/include \
70 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(BUILD_WERROR_CFLAGS) $(BUILD_WARN_CFLAGS)
71 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
73 ## Deps to add to the install-data-local target.
74 SIM_INSTALL_DATA_LOCAL_DEPS =
75 ## Deps to add to the install-exec-local target.
76 SIM_INSTALL_EXEC_LOCAL_DEPS =
77 ## Deps to add to the uninstall-local target.
78 SIM_UNINSTALL_LOCAL_DEPS =
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.
85 $(srccom)/gennltvals.py --cpp "$(CPP)"
88 pkginclude_HEADERS += \
89 $(srcroot)/include/sim/callback.h \
90 $(srcroot)/include/sim/sim.h
93 ## Used for our custom rules to calculate the dependency output base name.
94 ## This form aligns with Automake's default rules.
95 SIM_DEPBASE = $(@D)/$(DEPDIR)/$(@F:.o=)
96 ## Actual full compile command like Automake's default rules.
98 $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(SIM_DEPBASE).Tpo -c -o $@ $< && \
99 $(am__mv) $(SIM_DEPBASE).Tpo $(SIM_DEPBASE).Po
101 include common/local.mk
102 include igen/local.mk
103 include testsuite/local.mk
105 ## Arch includes must come after common/local.mk.
106 if SIM_ENABLE_ARCH_aarch64
107 include aarch64/local.mk
109 if SIM_ENABLE_ARCH_avr
112 if SIM_ENABLE_ARCH_bfin
113 include bfin/local.mk
115 if SIM_ENABLE_ARCH_bpf
118 if SIM_ENABLE_ARCH_cr16
119 include cr16/local.mk
121 if SIM_ENABLE_ARCH_cris
122 include cris/local.mk
124 if SIM_ENABLE_ARCH_d10v
125 include d10v/local.mk
127 if SIM_ENABLE_ARCH_erc32
128 include erc32/local.mk
130 if SIM_ENABLE_ARCH_examples
131 include example-synacor/local.mk
133 if SIM_ENABLE_ARCH_frv
136 if SIM_ENABLE_ARCH_ft32
137 include ft32/local.mk
139 if SIM_ENABLE_ARCH_h8300
140 include h8300/local.mk
142 if SIM_ENABLE_ARCH_iq2000
143 include iq2000/local.mk
145 if SIM_ENABLE_ARCH_lm32
146 include lm32/local.mk
148 if SIM_ENABLE_ARCH_m32c
149 include m32c/local.mk
151 if SIM_ENABLE_ARCH_m32r
152 include m32r/local.mk
154 if SIM_ENABLE_ARCH_m68hc11
155 include m68hc11/local.mk
157 if SIM_ENABLE_ARCH_mcore
158 include mcore/local.mk
160 if SIM_ENABLE_ARCH_microblaze
161 include microblaze/local.mk
163 if SIM_ENABLE_ARCH_mips
164 include mips/local.mk
166 if SIM_ENABLE_ARCH_mn10300
167 include mn10300/local.mk
169 if SIM_ENABLE_ARCH_moxie
170 include moxie/local.mk
172 if SIM_ENABLE_ARCH_msp430
173 include msp430/local.mk
175 if SIM_ENABLE_ARCH_or1k
176 include or1k/local.mk
178 if SIM_ENABLE_ARCH_ppc
181 if SIM_ENABLE_ARCH_pru
184 if SIM_ENABLE_ARCH_riscv
185 include riscv/local.mk
187 if SIM_ENABLE_ARCH_rl78
188 include rl78/local.mk
190 if SIM_ENABLE_ARCH_rx
193 if SIM_ENABLE_ARCH_sh
196 if SIM_ENABLE_ARCH_v850
197 include v850/local.mk
200 install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)
201 $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir)
202 lib=`echo sim | sed '$(program_transform_name)'`; \
203 for d in $(SIM_ENABLED_ARCHES); do \
205 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
207 $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \
210 install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS)
211 $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
212 run=`echo run | sed '$(program_transform_name)'`; \
213 for d in $(SIM_ENABLED_ARCHES); do \
215 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
216 $(LIBTOOL) --mode=install \
217 $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \
220 uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS)
221 rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a
222 for d in $(SIM_ENABLED_ARCHES); do \
223 rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \