]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/common/Make-common.in
x86: Print {bad} on invalid broadcast in OP_E_memory
[thirdparty/binutils-gdb.git] / sim / common / Make-common.in
CommitLineData
c906108c 1# Makefile fragment for common parts of all simulators.
3666a048 2# Copyright 1997-2021 Free Software Foundation, Inc.
c906108c
SS
3# Contributed by Cygnus Support.
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
4744ac1b 7# the Free Software Foundation; either version 3 of the License, or
c906108c 8# (at your option) any later version.
4744ac1b 9#
c906108c
SS
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.
4744ac1b 14#
c906108c 15# You should have received a copy of the GNU General Public License
4744ac1b 16# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
17
18# This Makefile fragment consists of two separate parts.
19# They are merged into the final Makefile at points denoted by
20# "## COMMON_PRE_CONFIG_FRAG" and "## COMMON_POST_CONFIG_FRAG".
21#
22# The target Makefile should look like:
23#
24#># Copyright blah blah
25#>
26#>## COMMON_PRE_CONFIG_FRAG
27#>
28#># Any overrides necessary for the SIM_FOO config vars.
29#>SIM_FOO = ...
30#>
31#>## COMMON_POST_CONFIG_FRAG
32#>
33#># Rules to build target specific .o's.
34
35## COMMON_PRE_CONFIG_FRAG
36
b3408412 37srcdir = @abs_srcdir@
36bb57e4 38VPATH = $(srcdir):$(srccom)
c906108c
SS
39srccom = $(srcdir)/../common
40srcroot = $(srcdir)/../..
7b064844 41srcsim = $(srcdir)/..
c906108c 42
36bb57e4
MF
43@SIM_COMMON_BUILD_FALSE@config.status = config.status
44@SIM_COMMON_BUILD_TRUE@config.status = ../config.status
45
7daf500d
SM
46include $(srcroot)/gdb/silent-rules.mk
47
5c9e84c2 48# Helper code from gnulib.
483ab96a
MF
49GNULIB_PARENT_DIR = ../..
50include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
5c9e84c2 51
3f8414df
MF
52# Settings from top-level configure.
53include ../arch-subdir.mk
54
c906108c
SS
55prefix = @prefix@
56exec_prefix = @exec_prefix@
57
c906108c
SS
58bindir = @bindir@
59
60libdir = @libdir@
61tooldir = $(libdir)/$(target_alias)
62
63datadir = @datadir@
1428dced 64datarootdir = @datarootdir@
c906108c
SS
65mandir = @mandir@
66man1dir = $(mandir)/man1
67infodir = @infodir@
68includedir = @includedir@
69
70# This can be referenced by the gettext configuration code.
71top_builddir = ..
72
c906108c
SS
73SHELL = @SHELL@
74
c906108c 75SIM_BITSIZE = @sim_bitsize@
c906108c 76SIM_FLOAT = @sim_float@
d4f3574e
SS
77SIM_WARN_CFLAGS = $(WARN_CFLAGS)
78SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
c906108c 79
db2e4d67 80# Dependency tracking information.
db2e4d67
MF
81depcomp = $(SHELL) $(srcroot)/depcomp
82
83# Note that these are overridden by GNU make-specific code below if
84# GNU make is used. The overrides implement dependency tracking.
46f900c0 85COMPILE.pre = $(CC) $(C_DIALECT)
db2e4d67 86COMPILE.post = -c -o $@
7daf500d 87COMPILE = $(ECHO_CC) $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
db2e4d67 88POSTCOMPILE = @true
c906108c 89
2b8d134b
SM
90# igen leaks memory, and therefore makes AddressSanitizer unhappy. Disable
91# leak detection while running it.
a55b92be
MF
92IGEN = ../igen/igen$(EXEEXT)
93IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN)
2b8d134b 94
c906108c
SS
95# Each simulator's Makefile.in defines one or more of these variables
96# to override our settings as necessary. There is no need to define these
97# in the simulator's Makefile.in if one is using the default value. In fact
98# it's preferable not to.
99
100# List of object files, less common parts.
101SIM_OBJS =
102# List of extra dependencies.
103# Generally this consists of simulator specific files included by sim-main.h.
104SIM_EXTRA_DEPS =
105# List of flags to always pass to $(CC).
106SIM_EXTRA_CFLAGS =
107# List of extra libraries to link with.
108SIM_EXTRA_LIBS =
c906108c 109# List of main object files for `run'.
465fb143 110SIM_RUN_OBJS = nrun.o
c906108c
SS
111# Dependency of `install' to install any extra files.
112SIM_EXTRA_INSTALL =
113# Dependency of `clean' to clean any extra files.
114SIM_EXTRA_CLEAN =
d690312f
CD
115# Likewise `distclean'
116SIM_EXTRA_DISTCLEAN =
c906108c
SS
117
118# Every time a new general purpose source file was added every target's
119# Makefile.in needed to be updated to include the file in SIM_OBJS.
120# This doesn't scale.
121# This variable specifies all the generic stuff common to the newer simulators.
122# Things like sim-reason.o can't go here as the cpu may provide its own
123# (though hopefully in time that won't be so). Things like sim-bits.o can go
124# here. Some files are used by all simulators (e.g. callback.o).
125# Those files are specified in LIB_OBJS below.
126
127SIM_COMMON_HW_OBJS = \
128 hw-alloc.o \
129 hw-base.o \
130 hw-device.o \
131 hw-events.o \
132 hw-handles.o \
133 hw-instances.o \
134 hw-ports.o \
135 hw-properties.o \
136 hw-tree.o \
137 sim-hw.o \
138
139SIM_NEW_COMMON_OBJS = \
140 sim-arange.o \
141 sim-bits.o \
6e4f085c 142 sim-close.o \
2419798b 143 sim-command.o \
c906108c
SS
144 sim-config.o \
145 sim-core.o \
78e9aa70 146 sim-cpu.o \
c906108c 147 sim-endian.o \
122bbfb5 148 sim-engine.o \
c906108c
SS
149 sim-events.o \
150 sim-fpu.o \
5e744ef8 151 sim-hload.o \
122bbfb5 152 sim-hrw.o \
c906108c
SS
153 sim-io.o \
154 sim-info.o \
c906108c 155 sim-memopt.o \
0d585950 156 sim-model.o \
c906108c
SS
157 sim-module.o \
158 sim-options.o \
159 sim-profile.o \
797eee42
MF
160 sim-reason.o \
161 sim-reg.o \
c906108c 162 sim-signal.o \
797eee42 163 sim-stop.o \
61a0c964 164 sim-syscall.o \
c906108c
SS
165 sim-trace.o \
166 sim-utils.o \
167 sim-watch.o \
168 \
169 $(SIM_HW_OBJS) \
170
80532737
DE
171# cgen-sim.h and the headers it includes
172CGEN_SIM_DEPS = \
173 $(srccom)/cgen-sim.h \
c906108c 174 $(srccom)/cgen-defs.h \
c906108c 175 $(srccom)/cgen-scache.h \
80532737
DE
176 $(srccom)/cgen-fpu.h \
177 $(srccom)/cgen-par.h \
178 $(srccom)/cgen-cpu.h \
c906108c 179 $(srccom)/cgen-trace.h \
80532737
DE
180 cpuall.h
181
182# Add this to SIM_EXTRA_DEPS.
183CGEN_INCLUDE_DEPS = \
184 $(CGEN_SIM_DEPS) \
185 $(srccom)/cgen-engine.h \
c906108c
SS
186 $(srccom)/cgen-types.h \
187 $(srcdir)/../../include/opcode/cgen.h
188
189## End COMMON_PRE_CONFIG_FRAG
190
191## COMMON_POST_CONFIG_FRAG
192
193CONFIG_CFLAGS = \
52d37d2c 194 -DHAVE_CONFIG_H \
c906108c 195 $(SIM_BITSIZE) \
c906108c
SS
196 $(SIM_FLOAT) \
197 $(SIM_HW_CFLAGS) \
c906108c 198 $(SIM_INLINE) \
d4f3574e
SS
199 $(SIM_WARN_CFLAGS) \
200 $(SIM_WERROR_CFLAGS) \
10737236 201 $(SIM_HARDWARE)
c906108c
SS
202CSEARCH = -I. -I$(srcdir) -I../common -I$(srccom) \
203 -I../../include -I$(srcroot)/include \
204 -I../../bfd -I$(srcroot)/bfd \
205 -I../../opcodes -I$(srcroot)/opcodes \
5c9e84c2 206 -I../.. \
ce3ec98a 207 $(INTL_CFLAGS)
5c9e84c2 208ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(INCGNU) $(SIM_EXTRA_CFLAGS) $(CFLAGS)
c2783492 209BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
c906108c 210
10737236 211COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
c906108c 212
be0387ee 213SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES)
be0387ee 214
b5689863 215ZLIB = $(zlibdir) -lz
c906108c 216LIBIBERTY_LIB = ../../libiberty/libiberty.a
79730a3b 217BFD_LIB = ../../bfd/libbfd.a
c906108c 218OPCODES_LIB = ../../opcodes/libopcodes.a
07490bf8 219CONFIG_LIBS = $(COMMON_LIBS) @LIBS@ $(ZLIB)
ed30adf7 220LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB)
20e95c23 221EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
b25370aa 222 $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
c906108c 223
dd8e16ea 224COMMON_OBJS_NAMES = \
ad9cc209 225 portability.o \
dd8e16ea
MF
226 sim-load.o \
227 version.o
228COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
5bea0c32
MF
229
230LIB_OBJS = callback.o modules.o syscall.o targ-map.o $(COMMON_OBJS) $(SIM_OBJS)
c906108c 231
c6c7769d 232COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
e7d9022b 233LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
c6c7769d 234
c906108c
SS
235RUNTESTFLAGS =
236
df68e12b
MF
237callback_h = $(srcroot)/include/sim/callback.h
238remote_sim_h = $(srcroot)/include/sim/sim.h
3c25f8c7 239
f8069d55 240all: libsim.a run$(EXEEXT) .gdbinit
c906108c
SS
241
242libsim.a: $(LIB_OBJS)
243 rm -f libsim.a
7daf500d
SM
244 $(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
245 $(ECHO_RANLIB) $(RANLIB) libsim.a
c906108c 246
4ec242d7 247run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
7daf500d 248 $(ECHO_CCLD) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
c906108c
SS
249 $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
250
c906108c
SS
251# FIXME: Ideally, callback.o and friends live in a library outside of
252# both the gdb and simulator source trees (e.g. devo/remote. Not
253# devo/libremote because this directory would contain more than just
254# a library).
255
c6c7769d 256gentmap.o: Makefile $(srccom)/gentmap.c $(srccom)/nltvals.def
7daf500d 257 $(ECHO_CC) $(COMPILE_FOR_BUILD) -o $@ -c $(srccom)/gentmap.c $(NL_TARGET)
c6c7769d
MF
258
259gentmap: gentmap.o
7daf500d 260 $(ECHO_CC) $(LINK_FOR_BUILD) $<
c906108c
SS
261
262targ-vals.h targ-map.c: stamp-tvals
263stamp-tvals: gentmap
264 rm -f tmp-tvals.h tmp-tmap.c
265 ./gentmap -h >tmp-tvals.h
266 $(SHELL) $(srcroot)/move-if-change tmp-tvals.h targ-vals.h
267 ./gentmap -c >tmp-tmap.c
268 $(SHELL) $(srcroot)/move-if-change tmp-tmap.c targ-map.c
269 touch stamp-tvals
270
271#
272# Rules for building sim-* components. Triggered by listing the corresponding
273# .o file in the list of simulator targets.
274#
275
276sim_main_headers = \
277 sim-main.h \
08cd3760
RE
278 $(sim-assert_h) \
279 $(sim-base_h) \
280 $(sim-cpu_h) \
281 $(sim-engine_h) \
282 $(sim-events_h) \
283 $(sim-memopt_h) \
284 $(sim-model_h) \
285 $(sim-module_h) \
286 $(sim-profile_h) \
287 $(sim-trace_h) \
288 $(sim-watch_h) \
289 $(sim-basics_h) \
c906108c
SS
290 $(SIM_EXTRA_DEPS)
291
292# Exported version of sim_main_headers.
293SIM_MAIN_DEPS = \
294 $(sim_main_headers)
295
08cd3760 296sim-alu_h = $(srccom)/sim-alu.h
ef986697 297sim-arange_h = $(srccom)/sim-arange.h
c906108c 298sim-assert_h = $(srccom)/sim-assert.h
08cd3760
RE
299sim-base_h = $(srccom)/sim-base.h \
300 $(sim-module_h) \
301 $(sim-trace_h) \
302 $(sim-core_h) \
303 $(sim-events_h) \
304 $(sim-profile_h) \
305 $(sim-model_h) \
306 $(sim-io_h) \
307 $(sim-engine_h) \
308 $(sim-watch_h) \
309 $(sim-memopt_h) \
310 $(sim-cpu_h)
311sim-basics_h = $(srccom)/sim-basics.h \
08cd3760 312 $(sim-config_h) \
70ae6611 313 $(callback_h) \
08cd3760
RE
314 $(sim-inline_h) \
315 $(sim-types_h) \
316 $(sim-bits_h) \
317 $(sim-endian_h) \
318 $(sim-signal_h) \
319 $(sim-arange_h) \
320 $(sim-utils_h)
321sim-bits_h = $(srccom)/sim-bits.h \
322 $(srccom)/sim-bits.c
c906108c 323sim-config_h = $(srccom)/sim-config.h
c906108c 324sim-core_h = $(srccom)/sim-core.h
08cd3760
RE
325sim-cpu_h = $(srccom)/sim-cpu.h
326sim-endian_h = $(srccom)/sim-endian.h \
327 $(srccom)/sim-endian.c
c906108c
SS
328sim-engine_h = $(srccom)/sim-engine.h
329sim-events_h = $(srccom)/sim-events.h
330sim-fpu_h = $(srccom)/sim-fpu.h
08cd3760
RE
331sim-hw_h = $(srccom)/sim-hw.h
332sim-inline_h = $(srccom)/sim-inline.h
c906108c 333sim-io_h = $(srccom)/sim-io.h
08cd3760
RE
334sim-memopt_h = $(srccom)/sim-memopt.h
335sim-model_h = $(srccom)/sim-model.h
336sim-module_h = $(srccom)/sim-module.h
337sim-n-bits_h = $(srccom)/sim-n-bits.h
338sim-n-core_h = $(srccom)/sim-n-core.h
339sim-n-endian_h = $(srccom)/sim-n-endian.h
c906108c 340sim-options_h = $(srccom)/sim-options.h
08cd3760 341sim-profile_h = $(srccom)/sim-profile.h
c906108c 342sim-signal_h = $(srccom)/sim-signal.h
08cd3760
RE
343sim-trace_h = $(srccom)/sim-trace.h
344sim-types_h = $(srccom)/sim-types.h
345sim-utils_h = $(srccom)/sim-utils.h
346sim-watch_h = $(srccom)/sim-watch.h
c906108c
SS
347
348hw-alloc_h = $(srccom)/hw-alloc.h
349hw-base_h = $(srccom)/hw-base.h
350hw-device_h = $(srccom)/hw-device.h
351hw-events_h = $(srccom)/hw-events.h
352hw-handles_h = $(srccom)/hw-handles.h
353hw-instances_h = $(srccom)/hw-instances.h
354hw-ports_h = $(srccom)/hw-ports.h
355hw-properties_h = $(srccom)/hw-properties.h
356hw-tree_h = $(srccom)/hw-tree.h
357
358hw_main_headers = \
359 $(srccom)/hw-main.h \
360 $(hw-alloc_h) \
361 $(hw-base_h) \
362 $(hw-device_h) \
363 $(hw-events_h) \
364 $(hw-instances_h) \
365 $(hw-handles_h) \
366 $(hw-ports_h) \
367 $(hw-properties_h) \
368
db2e4d67
MF
369#
370# Dependency tracking. Most of this is conditional on GNU Make being
371# found by configure; if GNU Make is not found, we fall back to a
372# simpler scheme.
373#
374
efd82ac7 375ifeq ($(DEPMODE),depmode=gcc3)
db2e4d67
MF
376# Note that we put the dependencies into a .Tpo file, then move them
377# into place if the compile succeeds. We need this because gcc does
378# not atomically write the dependency output file.
efd82ac7
TT
379override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
380 -MF $(DEPDIR)/$(basename $(@F)).Tpo
381override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
382 $(DEPDIR)/$(basename $(@F)).Po
383else
384override COMPILE.pre = source='$<' object='$@' libtool=no \
385 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
db2e4d67
MF
386# depcomp handles atomicity for us, so we don't need a postcompile
387# step.
efd82ac7
TT
388override POSTCOMPILE =
389endif
db2e4d67
MF
390
391all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
392generated_files = \
393 $(SIM_EXTRA_DEPS) \
394 hw-config.h \
8e5f1516 395 modules.c \
db2e4d67 396 targ-map.c \
5bea0c32 397 targ-vals.h
db2e4d67
MF
398
399# Ensure that generated files are created early. Use order-only
400# dependencies if available. They require GNU make 3.80 or newer,
401# and the .VARIABLES variable was introduced at the same time.
efd82ac7
TT
402ifdef .VARIABLES
403$(all_object_files): | $(generated_files)
404else
db2e4d67 405$(all_object_files) : $(generated_files)
efd82ac7 406endif
db2e4d67
MF
407
408# Dependencies.
efd82ac7 409-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
c906108c 410
c906108c 411# FIXME This is one very simple-minded way of generating the file hw-config.h
b396d3a1 412hw-config.h: stamp-hw ; @true
36bb57e4 413stamp-hw: Makefile.in $(srccom)/Make-common.in $(config.status) Makefile
c906108c
SS
414 rm -f tmp-hw.h
415 echo "/* generated by Makefile */" > tmp-hw.h
be0387ee 416 sim_hw="$(SIM_HW_DEVICES)"; \
96987c2b 417 for hw in $$sim_hw ; do \
c906108c
SS
418 echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \
419 done >> tmp-hw.h
420 echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h
be0387ee 421 sim_hw="$(SIM_HW_DEVICES)"; \
96987c2b 422 for hw in $$sim_hw ; do \
c906108c
SS
423 echo " dv_$${hw}_descriptor," ; \
424 done >> tmp-hw.h
425 echo " NULL," >> tmp-hw.h
426 echo "};" >> tmp-hw.h
b396d3a1
TT
427 $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw-config.h
428 @echo stamp > stamp-hw
c906108c 429
c906108c
SS
430test-hw-events: $(srccom)/hw-events.c libsim.a
431 $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
432 $(srccom)/hw-events.c libsim.a $(EXTRA_LIBS)
433
8e5f1516 434# See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
015f7b74
MF
435modules.c: stamp-modules ; @true
436stamp-modules: Makefile $(SIM_OBJS:.o=.c)
8e5f1516
MF
437 @echo Generating $@
438 @LANG=C ; export LANG ; \
439 LC_ALL=C ; export LC_ALL ; \
440 sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ | sort >$@.l-tmp
441 @set -e; (\
442 echo '/* Do not modify this file. */'; \
443 echo '/* It is created automatically by the Makefile. */'; \
444 echo '#include "libiberty.h"'; \
445 echo '#include "sim-module.h"'; \
446 sed -e 's:\(.*\):extern __attribute__((__weak__)) MODULE_INIT_FN \1;:' $@.l-tmp; \
447 echo 'MODULE_INSTALL_FN * const sim_modules_detected[] = {'; \
448 sed -e 's:\(.*\): \1,:' $@.l-tmp; \
449 echo '};'; \
450 echo 'const int sim_modules_detected_len = ARRAY_SIZE (sim_modules_detected);'; \
451 ) >$@.tmp
015f7b74 452 $(SHELL) $(srcroot)/move-if-change $@.tmp modules.c
8e5f1516 453 @rm -f $@.l-tmp $@.tmp
b50a658a 454 touch $@
8e5f1516 455
c906108c
SS
456# CGEN support.
457
458# For use in Makefile.in for cpu-specific files.
459CGEN_MAIN_CPU_DEPS = \
460 $(SIM_MAIN_DEPS) \
c906108c 461 $(srccom)/cgen-ops.h \
80532737 462 $(srccom)/cgen-mem.h
c906108c 463
c906108c
SS
464# Support targets.
465
466install: install-common $(SIM_EXTRA_INSTALL)
467
468install-common: installdirs
a0e674c1 469 a=`basename "$$(pwd)"`; \
c906108c 470 n=`echo run | sed '$(program_transform_name)'`; \
a0e674c1 471 [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
149cfe5b 472 $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
a0e674c1
MF
473 n="$(target_alias)-sim"; \
474 a=`basename "$$(pwd)"`; \
475 [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
476 n="lib$$n.a"; \
149cfe5b
DJ
477 $(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \
478 ( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n )
c906108c
SS
479
480installdirs:
149cfe5b
DJ
481 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)
482 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir)
c906108c
SS
483
484check:
c906108c 485
0d0878d7
MF
486html:
487clean-html:
488install-html:
489
c906108c
SS
490info:
491clean-info:
492install-info:
493
0d0878d7
MF
494pdf:
495clean-pdf:
496install-pdf:
497
c906108c
SS
498.NOEXPORT:
499MAKEOVERRIDES=
500
501tags etags: TAGS
502
503# Macros like EXTERN_SIM_CORE confuse tags.
504# And the sim-n-foo.h files create functions that can't be found either.
505TAGS: force
506 cd $(srcdir) && \
509deab2 507 etags --regex '/^\([[:lower:]_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
c906108c
SS
508 *.[ch] ../common/*.[ch]
509
be866656 510mostlyclean clean: $(SIM_EXTRA_CLEAN)
c906108c 511 rm -f *.[oa] *~ core
4ec242d7 512 rm -f run$(EXEEXT) libsim.a
b396d3a1 513 rm -f hw-config.h stamp-hw
015f7b74 514 rm -f modules.c stamp-modules
c906108c 515 rm -f gentmap targ-map.c targ-vals.h stamp-tvals
c906108c
SS
516 rm -f tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
517
be866656 518distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
c906108c
SS
519 rm -f TAGS
520 rm -f Makefile config.cache config.log config.status .gdbinit
c906108c
SS
521
522.c.o:
db2e4d67
MF
523 $(COMPILE) $<
524 $(POSTCOMPILE)
c906108c
SS
525
526# Dummy target to force execution of dependent targets.
527force:
528
36bb57e4
MF
529Makefile: Makefile.in $(srccom)/Make-common.in $(config.status)
530@SIM_COMMON_BUILD_FALSE@ CONFIG_HEADERS= $(SHELL) ./config.status
cc717561
MF
531@SIM_COMMON_BUILD_TRUE@ pwd=`pwd` && subdir=`basename "$$pwd"` && cd .. && \
532@SIM_COMMON_BUILD_TRUE@ $(SHELL) ./config.status Make-common.sim $$subdir/Makefile.sim $$subdir/Makefile
c906108c 533
36bb57e4
MF
534@SIM_COMMON_BUILD_FALSE@config.status: configure
535@SIM_COMMON_BUILD_FALSE@ $(SHELL) ./config.status --recheck
c906108c 536
c906108c 537.gdbinit: # config.status $(srccom)/gdbinit.in
36bb57e4 538@SIM_COMMON_BUILD_FALSE@ CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status
c906108c
SS
539
540
604259a0
FCE
541# CGEN support
542
2fe36d31
MF
543GUILE = `if [ -f ../../guile/libguile/guile ]; then echo ../../guile/libguile/guile; else echo guile ; fi`
544CGEN = "$(GUILE) -l $(CGENDIR)/guile.scm -s"
604259a0 545CGENFLAGS = -v
e3e473da 546CGEN_CPU_DIR = $(CGENDIR)/cpu
604259a0 547
6a8b8615
DE
548# Most ports use the files here instead of cgen/cpu.
549CPU_DIR = $(srcroot)/cpu
550
7ede505a 551CGEN_READ_SCM = $(CGENDIR)/sim.scm
e3e473da
BE
552CGEN_ARCH_SCM = $(CGENDIR)/sim-arch.scm
553CGEN_CPU_SCM = $(CGENDIR)/sim-cpu.scm $(CGENDIR)/sim-model.scm
554CGEN_DECODE_SCM = $(CGENDIR)/sim-decode.scm
555CGEN_DESC_SCM = $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm
604259a0
FCE
556
557# Various choices for which cpu specific files to generate.
2c2a86d7
DE
558# These are passed to cgen.sh in the "extrafiles" argument.
559CGEN_CPU_EXTR = /extr/
560CGEN_CPU_READ = /read/
561CGEN_CPU_WRITE = /write/
562CGEN_CPU_SEM = /sem/
563CGEN_CPU_SEMSW = /semsw/
604259a0
FCE
564
565CGEN_FLAGS_TO_PASS = \
9ab46d53 566 CGEN='$(CGEN)' \
604259a0
FCE
567 CGENFLAGS="$(CGENFLAGS)"
568
569# We store the generated files in the source directory until we decide to
570# ship a Scheme interpreter with gdb/binutils. Maybe we never will.
571
572cgen-arch: force
573 $(SHELL) $(srccom)/cgen.sh arch $(srcdir) \
574 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81
DB
575 $(arch) "$(FLAGS)" ignored "$(isa)" $(mach) ignored \
576 $(archfile) ignored
3c25f8c7 577
604259a0
FCE
578cgen-cpu: force
579 $(SHELL) $(srccom)/cgen.sh cpu $(srcdir) \
580 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81
DB
581 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
582 $(archfile) "$(EXTRAFILES)"
604259a0 583
c79688eb
BE
584cgen-defs: force
585 $(SHELL) $(srccom)/cgen.sh defs $(srcdir) \
586 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81
DB
587 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
588 $(archfile) ignored
c79688eb 589
604259a0
FCE
590cgen-decode: force
591 $(SHELL) $(srccom)/cgen.sh decode $(srcdir) \
592 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81
DB
593 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
594 $(archfile) "$(EXTRAFILES)"
604259a0
FCE
595
596cgen-cpu-decode: force
597 $(SHELL) $(srccom)/cgen.sh cpu-decode $(srcdir) \
598 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81
DB
599 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
600 $(archfile) "$(EXTRAFILES)"
604259a0
FCE
601
602cgen-desc: force
603 $(SHELL) $(srccom)/cgen.sh desc $(srcdir) \
604 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
ea52ff81 605 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
ad6e5d2e 606 $(archfile) ignored $(opcfile)
604259a0 607
c906108c 608## End COMMON_POST_CONFIG_FRAG