b8116d8996ff4941a47500d5cc5193d46b61bcf0
[deliverable/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_OBJS = @sim_hw_objs@
77 SIM_HW = @sim_hw@
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 ZLIB = $(zlibdir) -lz
220 LIBIBERTY_LIB = ../../libiberty/libiberty.a
221 BFD_LIB = ../../bfd/libbfd.a
222 OPCODES_LIB = ../../opcodes/libopcodes.a
223 CONFIG_LIBS = $(COMMON_LIBS) @LIBS@ $(ZLIB)
224 LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB)
225 EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
226 $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
227
228 COMMON_OBJS_NAMES = \
229 portability.o \
230 sim-load.o \
231 version.o
232 COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
233
234 LIB_OBJS = callback.o modules.o syscall.o targ-map.o $(COMMON_OBJS) $(SIM_OBJS)
235
236 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
237 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
238
239 RUNTESTFLAGS =
240
241 callback_h = $(srcroot)/include/sim/callback.h
242 remote_sim_h = $(srcroot)/include/sim/sim.h
243
244 all: libsim.a run$(EXEEXT) .gdbinit
245
246 libsim.a: $(LIB_OBJS)
247 rm -f libsim.a
248 $(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
249 $(ECHO_RANLIB) $(RANLIB) libsim.a
250
251 run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
252 $(ECHO_CCLD) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
253 $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
254
255 # FIXME: Ideally, callback.o and friends live in a library outside of
256 # both the gdb and simulator source trees (e.g. devo/remote. Not
257 # devo/libremote because this directory would contain more than just
258 # a library).
259
260 gentmap.o: Makefile $(srccom)/gentmap.c $(srccom)/nltvals.def
261 $(ECHO_CC) $(COMPILE_FOR_BUILD) -o $@ -c $(srccom)/gentmap.c $(NL_TARGET)
262
263 gentmap: gentmap.o
264 $(ECHO_CC) $(LINK_FOR_BUILD) $<
265
266 targ-vals.h targ-map.c: stamp-tvals
267 stamp-tvals: gentmap
268 rm -f tmp-tvals.h tmp-tmap.c
269 ./gentmap -h >tmp-tvals.h
270 $(SHELL) $(srcroot)/move-if-change tmp-tvals.h targ-vals.h
271 ./gentmap -c >tmp-tmap.c
272 $(SHELL) $(srcroot)/move-if-change tmp-tmap.c targ-map.c
273 touch stamp-tvals
274
275 #
276 # Rules for building sim-* components. Triggered by listing the corresponding
277 # .o file in the list of simulator targets.
278 #
279
280 sim_main_headers = \
281 sim-main.h \
282 $(sim-assert_h) \
283 $(sim-base_h) \
284 $(sim-cpu_h) \
285 $(sim-engine_h) \
286 $(sim-events_h) \
287 $(sim-memopt_h) \
288 $(sim-model_h) \
289 $(sim-module_h) \
290 $(sim-profile_h) \
291 $(sim-trace_h) \
292 $(sim-watch_h) \
293 $(sim-basics_h) \
294 $(SIM_EXTRA_DEPS)
295
296 # Exported version of sim_main_headers.
297 SIM_MAIN_DEPS = \
298 $(sim_main_headers)
299
300 sim-alu_h = $(srccom)/sim-alu.h
301 sim-arange_h = $(srccom)/sim-arange.h
302 sim-assert_h = $(srccom)/sim-assert.h
303 sim-base_h = $(srccom)/sim-base.h \
304 $(sim-module_h) \
305 $(sim-trace_h) \
306 $(sim-core_h) \
307 $(sim-events_h) \
308 $(sim-profile_h) \
309 $(sim-model_h) \
310 $(sim-io_h) \
311 $(sim-engine_h) \
312 $(sim-watch_h) \
313 $(sim-memopt_h) \
314 $(sim-cpu_h)
315 sim-basics_h = $(srccom)/sim-basics.h \
316 $(sim-config_h) \
317 $(callback_h) \
318 $(sim-inline_h) \
319 $(sim-types_h) \
320 $(sim-bits_h) \
321 $(sim-endian_h) \
322 $(sim-signal_h) \
323 $(sim-arange_h) \
324 $(sim-utils_h)
325 sim-bits_h = $(srccom)/sim-bits.h \
326 $(srccom)/sim-bits.c
327 sim-config_h = $(srccom)/sim-config.h
328 sim-core_h = $(srccom)/sim-core.h
329 sim-cpu_h = $(srccom)/sim-cpu.h
330 sim-endian_h = $(srccom)/sim-endian.h \
331 $(srccom)/sim-endian.c
332 sim-engine_h = $(srccom)/sim-engine.h
333 sim-events_h = $(srccom)/sim-events.h
334 sim-fpu_h = $(srccom)/sim-fpu.h
335 sim-hw_h = $(srccom)/sim-hw.h
336 sim-inline_h = $(srccom)/sim-inline.h
337 sim-io_h = $(srccom)/sim-io.h
338 sim-memopt_h = $(srccom)/sim-memopt.h
339 sim-model_h = $(srccom)/sim-model.h
340 sim-module_h = $(srccom)/sim-module.h
341 sim-n-bits_h = $(srccom)/sim-n-bits.h
342 sim-n-core_h = $(srccom)/sim-n-core.h
343 sim-n-endian_h = $(srccom)/sim-n-endian.h
344 sim-options_h = $(srccom)/sim-options.h
345 sim-profile_h = $(srccom)/sim-profile.h
346 sim-signal_h = $(srccom)/sim-signal.h
347 sim-trace_h = $(srccom)/sim-trace.h
348 sim-types_h = $(srccom)/sim-types.h
349 sim-utils_h = $(srccom)/sim-utils.h
350 sim-watch_h = $(srccom)/sim-watch.h
351
352 hw-alloc_h = $(srccom)/hw-alloc.h
353 hw-base_h = $(srccom)/hw-base.h
354 hw-device_h = $(srccom)/hw-device.h
355 hw-events_h = $(srccom)/hw-events.h
356 hw-handles_h = $(srccom)/hw-handles.h
357 hw-instances_h = $(srccom)/hw-instances.h
358 hw-ports_h = $(srccom)/hw-ports.h
359 hw-properties_h = $(srccom)/hw-properties.h
360 hw-tree_h = $(srccom)/hw-tree.h
361
362 hw_main_headers = \
363 $(srccom)/hw-main.h \
364 $(hw-alloc_h) \
365 $(hw-base_h) \
366 $(hw-device_h) \
367 $(hw-events_h) \
368 $(hw-instances_h) \
369 $(hw-handles_h) \
370 $(hw-ports_h) \
371 $(hw-properties_h) \
372
373 #
374 # Dependency tracking. Most of this is conditional on GNU Make being
375 # found by configure; if GNU Make is not found, we fall back to a
376 # simpler scheme.
377 #
378
379 ifeq ($(DEPMODE),depmode=gcc3)
380 # Note that we put the dependencies into a .Tpo file, then move them
381 # into place if the compile succeeds. We need this because gcc does
382 # not atomically write the dependency output file.
383 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
384 -MF $(DEPDIR)/$(basename $(@F)).Tpo
385 override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
386 $(DEPDIR)/$(basename $(@F)).Po
387 else
388 override COMPILE.pre = source='$<' object='$@' libtool=no \
389 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
390 # depcomp handles atomicity for us, so we don't need a postcompile
391 # step.
392 override POSTCOMPILE =
393 endif
394
395 all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
396 generated_files = \
397 $(SIM_EXTRA_DEPS) \
398 hw-config.h \
399 modules.c \
400 targ-map.c \
401 targ-vals.h
402
403 # Ensure that generated files are created early. Use order-only
404 # dependencies if available. They require GNU make 3.80 or newer,
405 # and the .VARIABLES variable was introduced at the same time.
406 ifdef .VARIABLES
407 $(all_object_files): | $(generated_files)
408 else
409 $(all_object_files) : $(generated_files)
410 endif
411
412 # Dependencies.
413 -include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
414
415 # FIXME This is one very simple-minded way of generating the file hw-config.h
416 hw-config.h: stamp-hw ; @true
417 stamp-hw: Makefile.in $(srccom)/Make-common.in config.status Makefile
418 rm -f tmp-hw.h
419 echo "/* generated by Makefile */" > tmp-hw.h
420 sim_hw="$(SIM_HW)"; \
421 for hw in $$sim_hw ; do \
422 echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \
423 done >> tmp-hw.h
424 echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h
425 sim_hw="$(SIM_HW)"; \
426 for hw in $$sim_hw ; do \
427 echo " dv_$${hw}_descriptor," ; \
428 done >> tmp-hw.h
429 echo " NULL," >> tmp-hw.h
430 echo "};" >> tmp-hw.h
431 $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw-config.h
432 @echo stamp > stamp-hw
433
434 test-hw-events: $(srccom)/hw-events.c libsim.a
435 $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
436 $(srccom)/hw-events.c libsim.a $(EXTRA_LIBS)
437
438 # See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
439 modules.c: stamp-modules ; @true
440 stamp-modules: Makefile $(SIM_OBJS:.o=.c)
441 @echo Generating $@
442 @LANG=C ; export LANG ; \
443 LC_ALL=C ; export LC_ALL ; \
444 sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ | sort >$@.l-tmp
445 @set -e; (\
446 echo '/* Do not modify this file. */'; \
447 echo '/* It is created automatically by the Makefile. */'; \
448 echo '#include "libiberty.h"'; \
449 echo '#include "sim-module.h"'; \
450 sed -e 's:\(.*\):extern __attribute__((__weak__)) MODULE_INIT_FN \1;:' $@.l-tmp; \
451 echo 'MODULE_INSTALL_FN * const sim_modules_detected[] = {'; \
452 sed -e 's:\(.*\): \1,:' $@.l-tmp; \
453 echo '};'; \
454 echo 'const int sim_modules_detected_len = ARRAY_SIZE (sim_modules_detected);'; \
455 ) >$@.tmp
456 $(SHELL) $(srcroot)/move-if-change $@.tmp modules.c
457 @rm -f $@.l-tmp $@.tmp
458 touch $@
459
460 # CGEN support.
461
462 # For use in Makefile.in for cpu-specific files.
463 CGEN_MAIN_CPU_DEPS = \
464 $(SIM_MAIN_DEPS) \
465 $(srccom)/cgen-ops.h \
466 $(srccom)/cgen-mem.h
467
468 # Support targets.
469
470 install: install-common $(SIM_EXTRA_INSTALL)
471
472 install-common: installdirs
473 a=`basename "$$(pwd)"`; \
474 n=`echo run | sed '$(program_transform_name)'`; \
475 [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
476 $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
477 n="$(target_alias)-sim"; \
478 a=`basename "$$(pwd)"`; \
479 [ "$(SIM_PRIMARY_TARGET)" = "$$a" ] || n="$$n-$$a"; \
480 n="lib$$n.a"; \
481 $(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \
482 ( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n )
483
484 installdirs:
485 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)
486 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir)
487
488 check:
489
490 html:
491 clean-html:
492 install-html:
493
494 info:
495 clean-info:
496 install-info:
497
498 pdf:
499 clean-pdf:
500 install-pdf:
501
502 .NOEXPORT:
503 MAKEOVERRIDES=
504
505 tags etags: TAGS
506
507 # Macros like EXTERN_SIM_CORE confuse tags.
508 # And the sim-n-foo.h files create functions that can't be found either.
509 TAGS: force
510 cd $(srcdir) && \
511 etags --regex '/^\([[:lower:]_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
512 *.[ch] ../common/*.[ch]
513
514 mostlyclean clean: $(SIM_EXTRA_CLEAN)
515 rm -f *.[oa] *~ core
516 rm -f run$(EXEEXT) libsim.a
517 rm -f hw-config.h stamp-hw
518 rm -f modules.c stamp-modules
519 rm -f gentmap targ-map.c targ-vals.h stamp-tvals
520 rm -f tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
521
522 distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
523 rm -f TAGS
524 rm -f Makefile config.cache config.log config.status .gdbinit
525
526 .c.o:
527 $(COMPILE) $<
528 $(POSTCOMPILE)
529
530 # Dummy target to force execution of dependent targets.
531 force:
532
533 Makefile: Makefile.in $(srccom)/Make-common.in config.status
534 CONFIG_HEADERS= $(SHELL) ./config.status
535
536 config.status: configure
537 $(SHELL) ./config.status --recheck
538
539 .gdbinit: # config.status $(srccom)/gdbinit.in
540 CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status
541
542
543 # CGEN support
544
545 CGENDIR = @cgendir@
546 CGEN = "`if [ -f ../../guile/libguile/guile ]; then echo ../../guile/libguile/guile; else echo guile ; fi` -l $(CGENDIR)/guile.scm -s"
547 CGENFLAGS = -v
548 CGEN_CPU_DIR = $(CGENDIR)/cpu
549
550 # Most ports use the files here instead of cgen/cpu.
551 CPU_DIR = $(srcroot)/cpu
552
553 CGEN_READ_SCM = $(CGENDIR)/sim.scm
554 CGEN_ARCH_SCM = $(CGENDIR)/sim-arch.scm
555 CGEN_CPU_SCM = $(CGENDIR)/sim-cpu.scm $(CGENDIR)/sim-model.scm
556 CGEN_DECODE_SCM = $(CGENDIR)/sim-decode.scm
557 CGEN_DESC_SCM = $(CGENDIR)/desc.scm $(CGENDIR)/desc-cpu.scm
558
559 # Various choices for which cpu specific files to generate.
560 # These are passed to cgen.sh in the "extrafiles" argument.
561 CGEN_CPU_EXTR = /extr/
562 CGEN_CPU_READ = /read/
563 CGEN_CPU_WRITE = /write/
564 CGEN_CPU_SEM = /sem/
565 CGEN_CPU_SEMSW = /semsw/
566
567 CGEN_FLAGS_TO_PASS = \
568 CGEN='$(CGEN)' \
569 CGENFLAGS="$(CGENFLAGS)"
570
571 # We store the generated files in the source directory until we decide to
572 # ship a Scheme interpreter with gdb/binutils. Maybe we never will.
573
574 cgen-arch: force
575 $(SHELL) $(srccom)/cgen.sh arch $(srcdir) \
576 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
577 $(arch) "$(FLAGS)" ignored "$(isa)" $(mach) ignored \
578 $(archfile) ignored
579
580 cgen-cpu: force
581 $(SHELL) $(srccom)/cgen.sh cpu $(srcdir) \
582 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
583 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
584 $(archfile) "$(EXTRAFILES)"
585
586 cgen-defs: force
587 $(SHELL) $(srccom)/cgen.sh defs $(srcdir) \
588 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
589 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
590 $(archfile) ignored
591
592 cgen-decode: force
593 $(SHELL) $(srccom)/cgen.sh decode $(srcdir) \
594 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
595 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
596 $(archfile) "$(EXTRAFILES)"
597
598 cgen-cpu-decode: force
599 $(SHELL) $(srccom)/cgen.sh cpu-decode $(srcdir) \
600 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
601 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
602 $(archfile) "$(EXTRAFILES)"
603
604 cgen-desc: force
605 $(SHELL) $(srccom)/cgen.sh desc $(srcdir) \
606 $(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
607 $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
608 $(archfile) ignored $(opcfile)
609
610 ## End COMMON_POST_CONFIG_FRAG
This page took 0.043411 seconds and 4 git commands to generate.