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