Automatic date update in version.in
[binutils-gdb.git] / sim / Makefile.am
blobb42926070dbd0503ed903dcb018286672a3ab4fd
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 @am__include@ @am__quote@$(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc@am__quote@
24 srccom = $(srcdir)/common
25 srcroot = $(srcdir)/..
27 SUBDIRS = @subdirs@
29 SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
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.
33 pkginclude_HEADERS =
34 check_PROGRAMS =
35 noinst_PROGRAMS =
36 EXTRA_LIBRARIES =
37 noinst_LIBRARIES =
38 EXTRA_PROGRAMS =
39 BUILT_SOURCES =
41 CLEANFILES =
42 DISTCLEANFILES =
43 MOSTLYCLEANFILES = core
44 ## We build some objects ourselves directly that Automake doesn't track, so
45 ## make sure all objects in subdirs get cleaned up.
46 MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o)
48 CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh
50 AM_CFLAGS = \
51         $(WERROR_CFLAGS) \
52         $(WARN_CFLAGS) \
53         $(AM_CFLAGS_$(subst -,_,$(@D))) \
54         $(AM_CFLAGS_$(subst -,_,$(@D)_$(@F)))
55 AM_CPPFLAGS = \
56         $(INCGNU) \
57         -I$(srcroot) \
58         -I$(srcroot)/include \
59         -I../bfd \
60         -I.. \
61         -I$(@D) \
62         -I$(srcdir)/$(@D) \
63         $(SIM_HW_CFLAGS) \
64         $(SIM_INLINE) \
65         $(AM_CPPFLAGS_$(subst -,_,$(@D))) \
66         $(AM_CPPFLAGS_$(subst -,_,$(@D)_$(@F)))
68 AM_CPPFLAGS_FOR_BUILD = \
69         -I$(srcroot)/include \
70         $(SIM_HW_CFLAGS) \
71         $(SIM_INLINE)
72 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
73 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
75 ## Deps to add to the all-recursive target.  These are built before descending
76 ## into any subdirs.
77 SIM_ALL_RECURSIVE_DEPS =
78 ## Deps to add to the install-data-local target.
79 SIM_INSTALL_DATA_LOCAL_DEPS =
80 ## Deps to add to the install-exec-local target.
81 SIM_INSTALL_EXEC_LOCAL_DEPS =
82 ## Deps to add to the uninstall-local target.
83 SIM_UNINSTALL_LOCAL_DEPS =
85 # Generate target constants for newlib/libgloss from its source tree.
86 # This file is shipped with distributions so we build in the source dir.
87 # Use `make nltvals' to rebuild.
88 .PHONY: nltvals
89 nltvals:
90         $(srccom)/gennltvals.py --cpp "$(CPP)"
92 if ENABLE_SIM
93 pkginclude_HEADERS += \
94         $(srcroot)/include/sim/callback.h \
95         $(srcroot)/include/sim/sim.h
96 endif
98 ## Used for our custom rules to calculate the dependency output base name.
99 ## This form aligns with Automake's default rules.
100 SIM_DEPBASE = $(@D)/$(DEPDIR)/$(@F:.o=)
101 ## Actual full compile command like Automake's default rules.
102 SIM_COMPILE = \
103         $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(SIM_DEPBASE).Tpo -c -o $@ $< && \
104         $(am__mv) $(SIM_DEPBASE).Tpo $(SIM_DEPBASE).Po
106 include common/local.mk
107 include igen/local.mk
108 include testsuite/local.mk
110 ## Arch includes must come after common/local.mk.
111 if SIM_ENABLE_ARCH_aarch64
112 include aarch64/local.mk
113 endif
114 if SIM_ENABLE_ARCH_arm
115 include arm/local.mk
116 endif
117 if SIM_ENABLE_ARCH_avr
118 include avr/local.mk
119 endif
120 if SIM_ENABLE_ARCH_bfin
121 include bfin/local.mk
122 endif
123 if SIM_ENABLE_ARCH_bpf
124 include bpf/local.mk
125 endif
126 if SIM_ENABLE_ARCH_cr16
127 include cr16/local.mk
128 endif
129 if SIM_ENABLE_ARCH_cris
130 include cris/local.mk
131 endif
132 if SIM_ENABLE_ARCH_d10v
133 include d10v/local.mk
134 endif
135 if SIM_ENABLE_ARCH_erc32
136 include erc32/local.mk
137 endif
138 if SIM_ENABLE_ARCH_examples
139 include example-synacor/local.mk
140 endif
141 if SIM_ENABLE_ARCH_frv
142 include frv/local.mk
143 endif
144 if SIM_ENABLE_ARCH_ft32
145 include ft32/local.mk
146 endif
147 if SIM_ENABLE_ARCH_h8300
148 include h8300/local.mk
149 endif
150 if SIM_ENABLE_ARCH_iq2000
151 include iq2000/local.mk
152 endif
153 if SIM_ENABLE_ARCH_lm32
154 include lm32/local.mk
155 endif
156 if SIM_ENABLE_ARCH_m32c
157 include m32c/local.mk
158 endif
159 if SIM_ENABLE_ARCH_m32r
160 include m32r/local.mk
161 endif
162 if SIM_ENABLE_ARCH_m68hc11
163 include m68hc11/local.mk
164 endif
165 if SIM_ENABLE_ARCH_mcore
166 include mcore/local.mk
167 endif
168 if SIM_ENABLE_ARCH_microblaze
169 include microblaze/local.mk
170 endif
171 if SIM_ENABLE_ARCH_mips
172 include mips/local.mk
173 endif
174 if SIM_ENABLE_ARCH_mn10300
175 include mn10300/local.mk
176 endif
177 if SIM_ENABLE_ARCH_moxie
178 include moxie/local.mk
179 endif
180 if SIM_ENABLE_ARCH_msp430
181 include msp430/local.mk
182 endif
183 if SIM_ENABLE_ARCH_or1k
184 include or1k/local.mk
185 endif
186 if SIM_ENABLE_ARCH_ppc
187 include ppc/local.mk
188 endif
189 if SIM_ENABLE_ARCH_pru
190 include pru/local.mk
191 endif
192 if SIM_ENABLE_ARCH_riscv
193 include riscv/local.mk
194 endif
195 if SIM_ENABLE_ARCH_rl78
196 include rl78/local.mk
197 endif
198 if SIM_ENABLE_ARCH_rx
199 include rx/local.mk
200 endif
201 if SIM_ENABLE_ARCH_sh
202 include sh/local.mk
203 endif
204 if SIM_ENABLE_ARCH_v850
205 include v850/local.mk
206 endif
208 ## Helper targets for running make from the top-level when some subdirs still
209 ## have Makefiles in subdirs.
211 all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
213 install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)
214         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir)
215         lib=`echo sim | sed '$(program_transform_name)'`; \
216         for d in $(SIM_ENABLED_ARCHES); do \
217                 n="$$lib"; \
218                 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
219                 n="lib$$n.a"; \
220                 $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \
221         done
223 install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS)
224         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
225         run=`echo run | sed '$(program_transform_name)'`; \
226         for d in $(SIM_ENABLED_ARCHES); do \
227                 n="$$run"; \
228                 [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \
229                 $(LIBTOOL) --mode=install \
230                         $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \
231         done
233 uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS)
234         rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a
235         for d in $(SIM_ENABLED_ARCHES); do \
236                 rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \
237         done