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