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