Update copyright year range in header of all files managed by GDB
[binutils-gdb.git] / sim / Makefile.am
blob4f74a716ffe86707da80e47c153b8e9e667d4727
1 ## Process this file with automake to generate Makefile.in
2 ##
3 #   Copyright (C) 1993-2023 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 @include_makefile@ $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
24 srccom = $(srcdir)/common
25 srcroot = $(srcdir)/..
27 SUBDIRS = @subdirs@ $(SIM_SUBDIRS)
29 SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
30 AM_MAKEFLAGS =
32 ## We don't set some of these vars here, but we need to define them so they may
33 ## be used consistently in local.mk files we include below.
34 pkginclude_HEADERS =
35 check_PROGRAMS =
36 noinst_PROGRAMS =
37 noinst_LIBRARIES =
38 EXTRA_PROGRAMS =
40 CLEANFILES =
41 DISTCLEANFILES =
42 MOSTLYCLEANFILES = core
44 AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
45 AM_CPPFLAGS = \
46         $(INCGNU) \
47         -I$(srcroot)/include \
48         -I../bfd \
49         -I.. \
50         $(SIM_HW_CFLAGS) \
51         $(SIM_INLINE)
53 AM_CPPFLAGS_FOR_BUILD = \
54         -I$(srcroot)/include \
55         $(SIM_HW_CFLAGS) \
56         $(SIM_INLINE)
57 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
58 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
60 ## Deps to add to the all-recursive target.  These are built before descending
61 ## into any subdirs.
62 SIM_ALL_RECURSIVE_DEPS =
63 ## Deps to add to the install-data-local target.
64 SIM_INSTALL_DATA_LOCAL_DEPS =
65 ## Deps to add to the install-exec-local target.
66 SIM_INSTALL_EXEC_LOCAL_DEPS =
67 ## Deps to add to the uninstall-local target.
68 SIM_UNINSTALL_LOCAL_DEPS =
70 # Generate target constants for newlib/libgloss from its source tree.
71 # This file is shipped with distributions so we build in the source dir.
72 # Use `make nltvals' to rebuild.
73 .PHONY: nltvals
74 nltvals:
75         $(srccom)/gennltvals.py --cpp "$(CPP)"
77 if ENABLE_SIM
78 pkginclude_HEADERS += \
79         $(srcroot)/include/sim/callback.h \
80         $(srcroot)/include/sim/sim.h
81 endif
83 include common/local.mk
84 if SIM_ENABLE_IGEN
85 include igen/local.mk
86 endif
87 include testsuite/local.mk
89 ## Arch includes must come after common/local.mk.
90 if SIM_ENABLE_ARCH_aarch64
91 include aarch64/local.mk
92 endif
93 if SIM_ENABLE_ARCH_arm
94 include arm/local.mk
95 endif
96 if SIM_ENABLE_ARCH_avr
97 include avr/local.mk
98 endif
99 if SIM_ENABLE_ARCH_bfin
100 include bfin/local.mk
101 endif
102 if SIM_ENABLE_ARCH_bpf
103 include bpf/local.mk
104 endif
105 if SIM_ENABLE_ARCH_cr16
106 include cr16/local.mk
107 endif
108 if SIM_ENABLE_ARCH_cris
109 include cris/local.mk
110 endif
111 if SIM_ENABLE_ARCH_d10v
112 include d10v/local.mk
113 endif
114 if SIM_ENABLE_ARCH_erc32
115 include erc32/local.mk
116 endif
117 if SIM_ENABLE_ARCH_examples
118 include example-synacor/local.mk
119 endif
120 if SIM_ENABLE_ARCH_frv
121 include frv/local.mk
122 endif
123 if SIM_ENABLE_ARCH_ft32
124 include ft32/local.mk
125 endif
126 if SIM_ENABLE_ARCH_h8300
127 include h8300/local.mk
128 endif
129 if SIM_ENABLE_ARCH_iq2000
130 include iq2000/local.mk
131 endif
132 if SIM_ENABLE_ARCH_lm32
133 include lm32/local.mk
134 endif
135 if SIM_ENABLE_ARCH_m32c
136 include m32c/local.mk
137 endif
138 if SIM_ENABLE_ARCH_m32r
139 include m32r/local.mk
140 endif
141 if SIM_ENABLE_ARCH_m68hc11
142 include m68hc11/local.mk
143 endif
144 if SIM_ENABLE_ARCH_mcore
145 include mcore/local.mk
146 endif
147 if SIM_ENABLE_ARCH_microblaze
148 include microblaze/local.mk
149 endif
150 if SIM_ENABLE_ARCH_mips
151 include mips/local.mk
152 endif
153 if SIM_ENABLE_ARCH_mn10300
154 include mn10300/local.mk
155 endif
156 if SIM_ENABLE_ARCH_moxie
157 include moxie/local.mk
158 endif
159 if SIM_ENABLE_ARCH_msp430
160 include msp430/local.mk
161 endif
162 if SIM_ENABLE_ARCH_or1k
163 include or1k/local.mk
164 endif
165 if SIM_ENABLE_ARCH_ppc
166 include ppc/local.mk
167 endif
168 if SIM_ENABLE_ARCH_pru
169 include pru/local.mk
170 endif
171 if SIM_ENABLE_ARCH_riscv
172 include riscv/local.mk
173 endif
174 if SIM_ENABLE_ARCH_rl78
175 include rl78/local.mk
176 endif
177 if SIM_ENABLE_ARCH_rx
178 include rx/local.mk
179 endif
180 if SIM_ENABLE_ARCH_sh
181 include sh/local.mk
182 endif
183 if SIM_ENABLE_ARCH_v850
184 include v850/local.mk
185 endif
187 ## Helper targets for running make from the top-level when some subdirs still
188 ## have Makefiles in subdirs.
190 %/libsim.a: | $(SIM_ALL_RECURSIVE_DEPS)
191         $(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
193 %/nrun.o: common/nrun.c | %/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
194         $(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
196 all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
198 install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)
199         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir)
200         lib=`echo sim | sed '$(program_transform_name)'`; \
201         for d in $(SIM_ENABLED_ARCHES); do \
202                 n="$$lib"; \
203                 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
204                 n="lib$$n.a"; \
205                 $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \
206         done
208 install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS)
209         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
210         run=`echo run | sed '$(program_transform_name)'`; \
211         for d in $(SIM_ENABLED_ARCHES); do \
212                 n="$$run"; \
213                 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
214                 $(LIBTOOL) --mode=install \
215                         $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \
216         done
218 uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS)
219         rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a
220         for d in $(SIM_ENABLED_ARCHES); do \
221                 rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \
222         done