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