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