Java sanitization.
[deliverable/binutils-gdb.git] / sim / common / Make-common.in
CommitLineData
f2de7dfd 1# Makefile fragment for common parts of all simulators.
3618a6e9 2# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
f2de7dfd
AC
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 2 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, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19# This Makefile fragment consists of two separate parts.
20# They are merged into the final Makefile at points denoted by
21# "## COMMON_PRE_CONFIG_FRAG" and "## COMMON_POST_CONFIG_FRAG".
22#
23# The target Makefile should look like:
24#
25#># Copyright blah blah
26#>
27#>## COMMON_PRE_CONFIG_FRAG
28#>
29#># Any overrides necessary for the SIM_FOO config vars.
30#>SIM_FOO = ...
31#>
32#>## COMMON_POST_CONFIG_FRAG
33#>
34#># Rules to build target specific .o's.
35
36## COMMON_PRE_CONFIG_FRAG
37
38VPATH = @srcdir@
39srcdir = @srcdir@
38377b3a 40srccom = $(srcdir)/../common
f2de7dfd
AC
41srcroot = $(srcdir)/../..
42
43prefix = @prefix@
44exec_prefix = @exec_prefix@
45
46host_alias = @host_alias@
47target_alias = @target_alias@
48program_transform_name = @program_transform_name@
49bindir = @bindir@
50
51libdir = @libdir@
52tooldir = $(libdir)/$(target_alias)
53
54datadir = @datadir@
55mandir = @mandir@
56man1dir = $(mandir)/man1
57infodir = @infodir@
58includedir = @includedir@
59
fc4198bb
TT
60# This can be referenced by the gettext configuration code.
61top_builddir = ..
62
08bae91b 63EXEEXT = @EXEEXT@
63330b2e 64SHELL = @SHELL@
f2de7dfd 65
6808fd61 66INSTALL = @INSTALL@
f2de7dfd
AC
67INSTALL_PROGRAM = @INSTALL_PROGRAM@
68INSTALL_DATA = @INSTALL_DATA@
f2de7dfd
AC
69
70CC = @CC@
71CC_FOR_BUILD = @CC_FOR_BUILD@
72CFLAGS = @CFLAGS@
73SIM_BSWAP = @sim_bswap@
74SIM_CFLAGS = @sim_cflags@
75SIM_DEBUG = @sim_debug@
f2de7dfd 76SIM_TRACE = @sim_trace@
717dbb29 77SIM_PROFILE = @sim_profile@
a77aa7ec 78
92f91d1f
AC
79SIM_ASSERT = @sim_assert@
80SIM_ALIGNMENT = @sim_alignment@
7456a10d 81SIM_BITSIZE = @sim_bitsize@
4141b1c6 82SIM_DEFAULT_MODEL = @sim_default_model@
92f91d1f 83SIM_ENDIAN = @sim_endian@
22469a10 84SIM_ENVIRONMENT = @sim_environment@
92f91d1f
AC
85SIM_FLOAT = @sim_float@
86SIM_HARDWARE = @sim_hardware@
63330b2e 87SIM_HW_OBJS = @sim_hw_obj@
278bda40 88SIM_HW = @sim_hw@
92f91d1f
AC
89SIM_HOSTENDIAN = @sim_hostendian@
90SIM_INLINE = @sim_inline@
91SIM_PACKAGES = @sim_packages@
92SIM_REGPARM = @sim_regparm@
93SIM_RESERVED_BITS = @sim_reserved_bits@
4141b1c6 94SIM_SCACHE = @sim_scache@
92f91d1f
AC
95SIM_SMP = @sim_smp@
96SIM_STDCALL = @sim_stdcall@
97SIM_WARNINGS = @sim_warnings@
98SIM_XOR_ENDIAN = @sim_xor_endian@
99
f2de7dfd
AC
100HDEFINES = @HDEFINES@
101TDEFINES =
102
103AR = @AR@
104AR_FLAGS = rc
105RANLIB = @RANLIB@
106MAKEINFO = makeinfo
107
f7abc1ca
DE
108DEP = $(srcroot)/mkdep
109
f2de7dfd 110# Each simulator's Makefile.in defines one or more of these variables
0f2811d1
DE
111# to override our settings as necessary. There is no need to define these
112# in the simulator's Makefile.in if one is using the default value. In fact
113# it's preferable not to.
f2de7dfd
AC
114
115# List of object files, less common parts.
116SIM_OBJS =
6808fd61
ILT
117# List of extra dependencies.
118# Generally this consists of simulator specific files included by sim-main.h.
119SIM_EXTRA_DEPS =
f2de7dfd
AC
120# List of flags to always pass to $(CC).
121SIM_EXTRA_CFLAGS =
122# List of extra libraries to link with.
123SIM_EXTRA_LIBS =
124# List of extra program dependencies.
125SIM_EXTRA_LIBDEPS =
126# List of main object files for `run'.
127SIM_RUN_OBJS = run.o
128# Dependency of `all' to build any extra files.
129SIM_EXTRA_ALL =
130# Dependency of `install' to install any extra files.
131SIM_EXTRA_INSTALL =
132# Dependency of `clean' to clean any extra files.
133SIM_EXTRA_CLEAN =
134
e5ce1670
DE
135# Every time a new general purpose source file was added every target's
136# Makefile.in needed to be updated to include the file in SIM_OBJS.
137# This doesn't scale.
138# This variable specifies all the generic stuff common to the newer simulators.
139# Things like sim-reason.o can't go here as the cpu may provide its own
140# (though hopefully in time that won't be so). Things like sim-bits.o can go
141# here. Some files are used by all simulators (e.g. callback.o).
142# Those files are specified in LIB_OBJS below.
143
144SIM_NEW_COMMON_OBJS = \
145 sim-bits.o \
146 sim-break.o \
147 sim-config.o \
148 sim-core.o \
149 sim-endian.o \
150 sim-events.o \
151 sim-fpu.o \
152 sim-io.o \
0e701ac3 153 sim-info.o \
e5ce1670
DE
154 sim-load.o \
155 sim-memopt.o \
156 sim-module.o \
157 sim-options.o \
158 sim-profile.o \
1ebc7e0e 159 sim-signal.o \
e5ce1670
DE
160 sim-trace.o \
161 sim-utils.o \
63330b2e
SG
162 sim-watch.o \
163 \
164 $(SIM_HW_OBJS) \
63330b2e 165
e5ce1670 166
f2de7dfd
AC
167## End COMMON_PRE_CONFIG_FRAG
168
169## COMMON_POST_CONFIG_FRAG
170
63330b2e
SG
171CONFIG_CFLAGS = \
172 @DEFS@ \
92f91d1f
AC
173 $(SIM_CFLAGS) \
174 $(SIM_DEBUG) \
4141b1c6 175 $(SIM_DEFAULT_MODEL) \
92f91d1f
AC
176 $(SIM_TRACE) \
177 $(SIM_PROFILE) \
178 $(SIM_BSWAP) \
179 $(SIM_ASSERT) \
180 $(SIM_ALIGNMENT) \
7456a10d 181 $(SIM_BITSIZE) \
92f91d1f 182 $(SIM_ENDIAN) \
22469a10 183 $(SIM_ENVIRONMENT) \
92f91d1f
AC
184 $(SIM_FLOAT) \
185 $(SIM_HARDWARE) \
186 $(SIM_HOSTENDIAN) \
187 $(SIM_INLINE) \
188 $(SIM_PACKAGES) \
189 $(SIM_REGPARM) \
190 $(SIM_RESERVED_BITS) \
4141b1c6 191 $(SIM_SCACHE) \
92f91d1f
AC
192 $(SIM_SMP) \
193 $(SIM_STDCALL) \
194 $(SIM_WARNINGS) \
195 $(SIM_XOR_ENDIAN) \
63330b2e 196 $(SIM_HARDWARE) \
92f91d1f
AC
197 $(SIM_EXTRA_CFLAGS) \
198 $(HDEFINES) $(TDEFINES)
38377b3a 199CSEARCH = -I. -I$(srcdir) -I../common -I$(srccom) \
f2de7dfd 200 -I../../include -I$(srcroot)/include \
a77aa7ec 201 -I../../bfd -I$(srcroot)/bfd \
3618a6e9
MM
202 -I../../opcodes -I$(srcroot)/opcodes \
203 -I../../intl -I$(srcroot)/intl
f2de7dfd
AC
204ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(CFLAGS)
205BUILD_CFLAGS = -g -O $(CSEARCH)
206
f7abc1ca
DE
207COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH)
208
f2de7dfd
AC
209LIBIBERTY_LIB = ../../libiberty/libiberty.a
210BFD_LIB = ../../bfd/libbfd.a
211OPCODES_LIB = ../../opcodes/libopcodes.a
fc4198bb
TT
212INTLLIBS = @INTLLIBS@
213INTLDEPS = @INTLDEPS@
f2de7dfd 214CONFIG_LIBS = @LIBS@
fc4198bb 215LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(INTLLIBS) $(LIBIBERTY_LIB) \
f2de7dfd 216 $(SIM_EXTRA_LIBDEPS)
fc4198bb 217EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(INTLLIBS) $(LIBIBERTY_LIB) \
f2de7dfd
AC
218 $(CONFIG_LIBS) $(SIM_EXTRA_LIBS)
219
f7abc1ca 220LIB_OBJS = callback.o syscall.o targ-map.o $(SIM_OBJS)
f2de7dfd 221
3618a6e9
MM
222RUNTESTFLAGS =
223
22469a10 224all: $(SIM_EXTRA_ALL) libsim.a run .gdbinit
f2de7dfd
AC
225
226libsim.a: $(LIB_OBJS)
227 rm -f libsim.a
fafce69a 228 $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
f2de7dfd
AC
229 $(RANLIB) libsim.a
230
231run: $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
08bae91b 232 $(CC) $(ALL_CFLAGS) -o run$(EXEEXT) \
f2de7dfd
AC
233 $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
234
38377b3a 235run.o: $(srccom)/run.c config.h tconfig.h \
22469a10 236 $(srcroot)/include/remote-sim.h $(srcroot)/include/callback.h
38377b3a 237 $(CC) -c $(srccom)/run.c $(ALL_CFLAGS)
f2de7dfd
AC
238
239# FIXME: Ideally, callback.o and friends live in a library outside of
240# both the gdb and simulator source trees (e.g. devo/remote. Not
241# devo/libremote because this directory would contain more than just
242# a library).
243
38377b3a 244callback.o: $(srccom)/callback.c config.h tconfig.h \
f2de7dfd 245 $(srcroot)/include/callback.h targ-vals.h
38377b3a 246 $(CC) -c $(srccom)/callback.c $(ALL_CFLAGS)
f2de7dfd 247
38377b3a 248syscall.o: $(srccom)/syscall.c config.h tconfig.h \
f7abc1ca 249 $(srcroot)/include/callback.h targ-vals.h
38377b3a 250 $(CC) -c $(srccom)/syscall.c $(ALL_CFLAGS)
f7abc1ca 251
f2de7dfd
AC
252targ-map.o: targ-map.c targ-vals.h
253
38377b3a
DE
254gentmap: Makefile $(srccom)/gentmap.c targ-vals.def
255 $(CC_FOR_BUILD) $(srccom)/gentmap.c -o gentmap $(BUILD_CFLAGS) $(NL_TARGET)
f2de7dfd 256
6cd37f15
DE
257targ-vals.h targ-map.c: stamp-tvals
258stamp-tvals: gentmap
259 rm -f tmp-tvals.h tmp-tmap.c
260 ./gentmap -h >tmp-tvals.h
63330b2e 261 $(SHELL) $(srcroot)/move-if-change tmp-tvals.h targ-vals.h
6cd37f15 262 ./gentmap -c >tmp-tmap.c
63330b2e 263 $(SHELL) $(srcroot)/move-if-change tmp-tmap.c targ-map.c
6cd37f15 264 touch stamp-tvals
a35e91c3
AC
265
266#
267# Rules for building sim-* components. Triggered by listing the corresponding
268# .o file in the list of simulator targets.
269#
270
6808fd61
ILT
271sim_main_headers = \
272 sim-main.h \
08bae91b 273 $(srccom)/sim-assert.h \
38377b3a
DE
274 $(srccom)/sim-base.h \
275 $(srccom)/sim-basics.h \
08bae91b
JJ
276 $(srccom)/sim-config.h \
277 $(srccom)/sim-cpu.h \
278 $(srccom)/sim-engine.h \
279 $(srccom)/sim-events.h \
280 $(srccom)/sim-inline.h \
38377b3a
DE
281 $(srccom)/sim-memopt.h \
282 $(srccom)/sim-model.h \
283 $(srccom)/sim-module.h \
38377b3a 284 $(srccom)/sim-profile.h \
08bae91b
JJ
285 $(srccom)/sim-signal.h \
286 $(srccom)/sim-trace.h \
38377b3a 287 $(srccom)/sim-watch.h \
f7abc1ca
DE
288 tconfig.h \
289 $(SIM_EXTRA_DEPS)
6808fd61 290
38377b3a
DE
291sim-assert_h = $(srccom)/sim-assert.h
292sim-endian_h = $(srccom)/sim-endian.h
293sim-n-endian_h = $(srccom)/sim-n-endian.h
294sim-bits_h = $(srccom)/sim-bits.h
295sim-config_h = $(srccom)/sim-config.h
296sim-n-bits_h = $(srccom)/sim-n-bits.h
297sim-core_h = $(srccom)/sim-core.h
298sim-n-core_h = $(srccom)/sim-n-core.h
299sim-engine_h = $(srccom)/sim-engine.h
300sim-events_h = $(srccom)/sim-events.h
301sim-fpu_h = $(srccom)/sim-fpu.h
302sim-io_h = $(srccom)/sim-io.h
303sim-options_h = $(srccom)/sim-options.h
304sim-break_h = $(srccom)/sim-break.h
1ebc7e0e 305sim-signal_h = $(srccom)/sim-signal.h
a35e91c3 306
278bda40 307# start-sanitize-am30
63330b2e
SG
308hw-base_h = $(srccom)/hw-base.h
309hw-device_h = $(srccom)/hw-device.h
310hw-handles_h = #$(srccom)/hw-handles.h
311hw-instances_h = #$(srccom)/hw-instances.h
312hw-ports_h = $(srccom)/hw-ports.h
313hw-properties_h = $(srccom)/hw-properties.h
314hw-tree_h = $(srccom)/hw-tree.h
315
316hw_base_headers = \
317 $(hw-base_h) \
318 $(hw-device_h) \
319 $(hw-instances_h) \
320 $(hw-handles_h) \
321 $(hw-ports_h) \
322 $(hw-properties_h) \
278bda40 323# end-sanitize-am30
63330b2e 324
6808fd61 325# FIXME: If this complicated way of building .o files from ../common is
c967f187 326# necessary, the reason should be documented here.
6808fd61
ILT
327
328BUILT_SRC_FROM_COMMON= \
5dcf955d 329 sim-inline.c
6808fd61 330
38377b3a 331sim-abort.o: $(srccom)/sim-abort.c \
f7abc1ca 332 $(SIM_EXTRA_DEPS)
38377b3a 333 $(CC) -c $(srccom)/sim-abort.c $(ALL_CFLAGS)
f03b093c 334
38377b3a 335sim-bits.o: $(srccom)/sim-bits.c $(sim-bits_h) $(sim-n-bits_h) \
f7abc1ca 336 $(SIM_EXTRA_DEPS)
38377b3a 337 $(CC) -c $(srccom)/sim-bits.c $(ALL_CFLAGS)
a35e91c3 338
38377b3a 339sim-config.o: $(srccom)/sim-config.c $(sim-config_h) \
189e2694 340 $(SIM_EXTRA_DEPS)
38377b3a 341 $(CC) -c $(srccom)/sim-config.c $(ALL_CFLAGS)
a35e91c3 342
189e2694
DE
343sim-core.o: $(srccom)/sim-core.c $(sim_main_headers) \
344 $(sim-core_h) $(sim-n-core_h) \
f7abc1ca 345 $(SIM_EXTRA_DEPS)
38377b3a 346 $(CC) -c $(srccom)/sim-core.c $(ALL_CFLAGS)
a35e91c3 347
08bae91b
JJ
348sim-cpu.o: $(srccom)/sim-cpu.c $(sim_main_headers) \
349 $(SIM_EXTRA_DEPS)
350 $(CC) -c $(srccom)/sim-cpu.c $(ALL_CFLAGS)
351
38377b3a 352sim-endian.o: $(srccom)/sim-endian.c $(sim-endian_h) $(sim-n-endian_h) \
f7abc1ca 353 $(SIM_EXTRA_DEPS)
38377b3a 354 $(CC) -c $(srccom)/sim-endian.c $(ALL_CFLAGS)
a35e91c3 355
38377b3a
DE
356sim-engine.o: $(srccom)/sim-engine.c $(sim_main_headers) $(sim-engine_h)
357 $(CC) -c $(srccom)/sim-engine.c $(ALL_CFLAGS)
f03b093c 358
38377b3a 359sim-events.o: $(srccom)/sim-events.c $(sim-events_h) \
f7abc1ca 360 $(SIM_EXTRA_DEPS)
38377b3a 361 $(CC) -c $(srccom)/sim-events.c $(ALL_CFLAGS)
a35e91c3 362
38377b3a 363sim-fpu.o: $(srccom)/sim-fpu.c $(sim-fpu_h) \
f7abc1ca 364 $(SIM_EXTRA_DEPS)
38377b3a 365 $(CC) -c $(srccom)/sim-fpu.c $(ALL_CFLAGS)
fafce69a 366
38377b3a 367sim-hload.o: $(srccom)/sim-hload.c $(sim-assert_h) \
22469a10 368 $(srcroot)/include/remote-sim.h \
f7abc1ca 369 $(SIM_EXTRA_DEPS)
38377b3a 370 $(CC) -c $(srccom)/sim-hload.c $(ALL_CFLAGS)
3971886a 371
22469a10
DE
372sim-hrw.o: $(srccom)/sim-hrw.c $(sim-assert_h) $(sim_core_h) \
373 $(srcroot)/include/remote-sim.h \
f7abc1ca 374 $(SIM_EXTRA_DEPS)
38377b3a 375 $(CC) -c $(srccom)/sim-hrw.c $(ALL_CFLAGS)
92f91d1f 376
278bda40
AC
377#start-sanitize-am30
378sim-hw.o: $(srccom)/sim-hw.c $(sim_main_headers) $(SIM_EXTRA_DEPS)
379 $(CC) -c $(srccom)/sim-hw.c $(ALL_CFLAGS)
380
381#end-sanitize-am30
0e701ac3
AC
382sim-info.o: $(srccom)/sim-info.c $(sim-assert_h) \
383 $(srcroot)/include/remote-sim.h \
384 $(SIM_EXTRA_DEPS)
385 $(CC) -c $(srccom)/sim-info.c $(ALL_CFLAGS)
386
38377b3a 387sim-inline.c: $(srccom)/sim-inline.c
a35e91c3 388 rm -f $@ tmp-$@
38377b3a
DE
389 echo "# 1 \"$(srccom)/$@\"" > tmp-$@
390 cat $(srccom)/$@ >> tmp-$@
63330b2e 391 $(SHELL) $(srcdir)/../../move-if-change tmp-$@ $@
a35e91c3 392
22469a10
DE
393sim-io.o: $(srccom)/sim-io.c $(sim_main_headers) $(sim-io_h) \
394 $(srcroot)/include/remote-sim.h
38377b3a 395 $(CC) -c $(srccom)/sim-io.c $(ALL_CFLAGS)
a35e91c3 396
38377b3a 397sim-memopt.o: $(srccom)/sim-memopt.c $(sim_main_headers) \
f7abc1ca 398 $(sim-io_h)
38377b3a 399 $(CC) -c $(srccom)/sim-memopt.c $(ALL_CFLAGS)
a34abff8 400
38377b3a 401sim-module.o: $(srccom)/sim-module.c $(sim_main_headers) \
f7abc1ca 402 $(sim-io_h)
38377b3a 403 $(CC) -c $(srccom)/sim-module.c $(ALL_CFLAGS)
717dbb29 404
38377b3a 405sim-options.o: $(srccom)/sim-options.c $(sim_main_headers) \
f7abc1ca 406 $(sim-options_h) $(sim-io_h)
38377b3a 407 $(CC) -c $(srccom)/sim-options.c $(ALL_CFLAGS)
0f2811d1 408
22469a10
DE
409sim-reason.o: $(srccom)/sim-reason.c $(sim_main_headers) \
410 $(srcroot)/include/remote-sim.h
38377b3a 411 $(CC) -c $(srccom)/sim-reason.c $(ALL_CFLAGS)
f03b093c 412
22469a10
DE
413sim-resume.o: $(srccom)/sim-resume.c $(sim_main_headers) \
414 $(srcroot)/include/remote-sim.h
38377b3a 415 $(CC) -c $(srccom)/sim-resume.c $(ALL_CFLAGS)
f03b093c 416
38377b3a
DE
417sim-run.o: $(srccom)/sim-run.c $(sim_main_headers)
418 $(CC) -c $(srccom)/sim-run.c $(ALL_CFLAGS)
f03b093c 419
1ebc7e0e
DE
420sim-signal.o: $(srccom)/sim-signal.c $(sim_main_headers) $(sim-signal_h)
421 $(CC) -c $(srccom)/sim-signal.c $(ALL_CFLAGS)
422
38377b3a
DE
423sim-stop.o: $(srccom)/sim-stop.c $(sim_main_headers)
424 $(CC) -c $(srccom)/sim-stop.c $(ALL_CFLAGS)
f03b093c 425
38377b3a 426sim-trace.o: $(srccom)/sim-trace.c $(sim_main_headers) \
f7abc1ca 427 $(sim-options_h) $(sim-io_h)
38377b3a 428 $(CC) -c $(srccom)/sim-trace.c $(ALL_CFLAGS)
e9b2f579 429
38377b3a 430sim-profile.o: $(srccom)/sim-profile.c $(sim_main_headers) \
f7abc1ca 431 $(sim-options_h) $(sim-io_h)
38377b3a 432 $(CC) -c $(srccom)/sim-profile.c $(ALL_CFLAGS)
717dbb29 433
38377b3a 434sim-model.o: $(srccom)/sim-model.c $(sim_main_headers) \
f7abc1ca 435 $(sim-io_h)
38377b3a 436 $(CC) -c $(srccom)/sim-model.c $(ALL_CFLAGS)
c967f187 437
38377b3a
DE
438sim-utils.o: $(srccom)/sim-utils.c $(sim_main_headers)
439 $(CC) -c $(srccom)/sim-utils.c $(ALL_CFLAGS)
a35e91c3 440
38377b3a
DE
441sim-watch.o: $(srccom)/sim-watch.c $(sim_main_headers)
442 $(CC) -c $(srccom)/sim-watch.c $(ALL_CFLAGS)
fafce69a 443
38377b3a
DE
444sim-load.o: $(srccom)/sim-load.c $(srcroot)/include/callback.h
445 $(CC) -c $(srccom)/sim-load.c $(ALL_CFLAGS)
0f2811d1 446
38377b3a 447sim-break.o: $(srccom)/sim-break.c $(sim_main_headers) \
f7abc1ca 448 $(sim_break_h)
38377b3a 449 $(CC) -c $(srccom)/sim-break.c $(ALL_CFLAGS)
b9d580a4 450
63330b2e 451
278bda40
AC
452# start-sanitize-am30
453# FIXME This is one very simple-minded way of generating the file hw-config.h
454hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
455 rm -f tmp-hw.h
456 echo "/* generated by Makefile */" > tmp-hw.h
457 for hw in $(SIM_HW) ; do \
458 echo "extern const struct hw_device_descriptor dv_$${hw}_descriptor[];" ; \
459 done >> tmp-hw.h
460 echo "const struct hw_device_descriptor *hw_descriptors[] = {" >> tmp-hw.h
461 for hw in $(SIM_HW) ; do \
462 echo " dv_$${hw}_descriptor," ; \
463 done >> tmp-hw.h
464 echo " NULL," >> tmp-hw.h
465 echo "};" >> tmp-hw.h
466 mv tmp-hw.h hw-config.h
467
63330b2e 468hw-base.o: $(srccom)/hw-base.c $(sim_main_headers) \
278bda40 469 $(hw_base_headers) hw-config.h
63330b2e
SG
470 $(CC) -c $(srccom)/hw-base.c $(ALL_CFLAGS)
471
472hw-device.o: $(srccom)/hw-device.c $(sim_main_headers) \
473 $(hw-device_h)
474 $(CC) -c $(srccom)/hw-device.c $(ALL_CFLAGS)
475
476hw-instances.o: $(srccom)/hw-instances.c $(sim_main_headers) \
477 $(hw_base_headers)
478 $(CC) -c $(srccom)/hw-instances.c $(ALL_CFLAGS)
479
480hw-handles.o: $(srccom)/hw-handles.c $(sim_main_headers) \
481 $(hw_base_headers)
482 $(CC) -c $(srccom)/hw-handles.c $(ALL_CFLAGS)
483
484hw-ports.o: $(srccom)/hw-ports.c $(sim_main_headers) \
485 $(hw-ports_h)
486 $(CC) -c $(srccom)/hw-ports.c $(ALL_CFLAGS)
487
488hw-properties.o: $(srccom)/hw-properties.c $(sim_main_headers) \
489 $(hw-properties_h)
490 $(CC) -c $(srccom)/hw-properties.c $(ALL_CFLAGS)
491
492hw-tree.o: $(srccom)/hw-tree.c $(sim_main_headers) \
493 $(hw-tree_h) $(hw_base_headers)
494 $(CC) -c $(srccom)/hw-tree.c $(ALL_CFLAGS)
495
496
497dv-core.o: $(srccom)/dv-core.c $(sim_main_headers) \
498 $(sim-main_h) $(hw_base_headers)
499 $(CC) -c $(srccom)/dv-core.c $(ALL_CFLAGS)
500
501dv-glue.o: $(srccom)/dv-glue.c $(sim_main_headers) \
502 $(sim-main_h) $(hw_base_headers)
503 $(CC) -c $(srccom)/dv-glue.c $(ALL_CFLAGS)
504
505dv-pal.o: $(srccom)/dv-pal.c $(sim_main_headers) \
506 $(sim-main_h) $(hw_base_headers)
507 $(CC) -c $(srccom)/dv-pal.c $(ALL_CFLAGS)
508
278bda40 509#end-sanitize-am30
63330b2e 510
38377b3a 511nrun.o: $(srccom)/nrun.c config.h tconfig.h \
22469a10
DE
512 $(srcroot)/include/remote-sim.h $(srcroot)/include/callback.h \
513 $(sim_main_headers)
38377b3a 514 $(CC) -c $(srccom)/nrun.c $(ALL_CFLAGS)
a35e91c3 515
84c6d152
DE
516# Devices.
517
518dv-sockser.o: $(srccom)/dv-sockser.h $(sim_main_headers)
519 $(CC) -c $(srccom)/dv-sockser.c $(ALL_CFLAGS)
520
c967f187
DE
521# CGEN support.
522
08bae91b
JJ
523cgen-scache.o: $(srccom)/cgen-scache.c $(sim_main_headers) \
524 $(srccom)/cgen-sim.h
38377b3a 525 $(CC) -c $(srccom)/cgen-scache.c $(ALL_CFLAGS)
c967f187 526
38377b3a 527cgen-trace.o: $(srccom)/cgen-trace.c $(sim_main_headers) \
08bae91b 528 $(srccom)/cgen-sim.h $(srccom)/cgen-trace.h
38377b3a 529 $(CC) -c $(srccom)/cgen-trace.c $(ALL_CFLAGS)
c967f187 530
38377b3a 531cgen-utils.o: $(srccom)/cgen-utils.c $(sim_main_headers) \
08bae91b 532 $(srccom)/cgen-sim.h $(srccom)/cgen-mem.h $(srccom)/cgen-ops.h
38377b3a 533 $(CC) -c $(srccom)/cgen-utils.c $(ALL_CFLAGS)
c967f187
DE
534
535# Support targets.
536
f2de7dfd
AC
537install: install-common $(SIM_EXTRA_INSTALL)
538
6808fd61
ILT
539install-common: installdirs
540 n=`echo run | sed '$(program_transform_name)'`; \
08bae91b
JJ
541 $(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n
542 n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \
543 $(INSTALL_DATA) libsim.a $(libdir)/$$n
6808fd61
ILT
544
545installdirs:
546 $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir)
f2de7dfd
AC
547
548check:
3618a6e9 549 cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)"
f2de7dfd
AC
550
551info:
552clean-info:
553install-info:
554
555.NOEXPORT:
556MAKEOVERRIDES=
557
558tags etags: TAGS
559
84c6d152
DE
560# Macros like EXTERN_SIM_CORE confuse tags.
561# And the sim-n-foo.h files create functions that can't be found either.
f2de7dfd 562TAGS: force
84c6d152
DE
563 cd $(srcdir) && \
564 etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
565 *.[ch] ../common/*.[ch]
f2de7dfd 566
717dbb29 567clean: $(SIM_EXTRA_CLEAN)
f2de7dfd
AC
568 rm -f *.[oa] *~ core
569 rm -f run libsim.a
6cd37f15 570 rm -f gentmap targ-map.c targ-vals.h stamp-tvals
f7abc1ca 571 if [ ! -f Make-common.in ] ; then \
5dcf955d
DE
572 rm -f $(BUILT_SRC_FROM_COMMON) ; \
573 fi
f2de7dfd 574
717dbb29 575distclean mostlyclean maintainer-clean realclean: clean
f2de7dfd 576 rm -f TAGS
88d5f8e8 577 rm -f Makefile config.cache config.log config.status .gdbinit
f2de7dfd 578 rm -f tconfig.h config.h stamp-h
0f399b0c 579 rm -f targ-vals.def
f2de7dfd
AC
580
581.c.o:
582 $(CC) -c $(ALL_CFLAGS) $<
583
584# Dummy target to force execution of dependent targets.
585force:
586
38377b3a 587Makefile: Makefile.in $(srccom)/Make-common.in config.status
f2de7dfd
AC
588 CONFIG_HEADERS= $(SHELL) ./config.status
589
590config.status: configure
591 $(SHELL) ./config.status --recheck
592
593config.h: stamp-h ; @true
594stamp-h: config.in config.status
595 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
596
38377b3a 597.gdbinit: # config.status $(srccom)/gdbinit.in
88d5f8e8
DE
598 CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status
599
36de6f40
DE
600# start-sanitize-cygnus
601
189e2694
DE
602# CGEN support
603
604SCHEME = @SCHEME@
189e2694
DE
605SCHEMEFLAGS = -s
606srccgen = $(srcroot)/cgen
607
608CGEN_VERBOSE = -v
6cd37f15
DE
609CGEN_MAIN_SCM = $(srccgen)/object.scm $(srccgen)/utils.scm \
610 $(srccgen)/attr.scm $(srccgen)/enum.scm $(srccgen)/types.scm \
611 $(srccgen)/utils-cgen.scm $(srccgen)/cpu.scm \
612 $(srccgen)/mode.scm $(srccgen)/mach.scm \
613 $(srccgen)/model.scm $(srccgen)/hardware.scm \
189e2694
DE
614 $(srccgen)/ifield.scm $(srccgen)/iformat.scm \
615 $(srccgen)/operand.scm $(srccgen)/insn.scm \
6cd37f15
DE
616 $(srccgen)/cdl-c.scm $(srccgen)/sim.scm
617CGEN_CPU_SCM = $(srccgen)/sim-cpu.scm $(srccgen)/sim-model.scm
618CGEN_DECODE_SCM = $(srccgen)/sim-decode.scm
189e2694
DE
619
620# Various choices for which cpu specific files to generate.
621CGEN_CPU_EXTR = -E tmp-ext.c1
622CGEN_CPU_READ = -R tmp-read.c1
623CGEN_CPU_SEM = -S tmp-sem.c1
624CGEN_CPU_SEMSW = -W tmp-semsw.c1
625
626# We store the generated files in the source directory until we decide to
627# ship a Scheme interpreter with gdb/binutils. Maybe we never will.
628
629cgen-arch: force
630 $(SHELL) $(srccom)/cgen.sh arch $(srcdir) \
631 $(SCHEME) $(SCHEMEFLAGS) \
632 $(srccgen) $(CGEN_VERBOSE) \
633 $(arch) "$(FLAGS)" ignored ignored ignored ignored
634
635cgen-cpu: force
636 $(SHELL) $(srccom)/cgen.sh cpu $(srcdir) \
637 $(SCHEME) $(SCHEMEFLAGS) \
638 $(srccgen) $(CGEN_VERBOSE) \
639 $(arch) "$(FLAGS)" $(cpu) $(mach) "$(SUFFIX)" "$(EXTRAFILES)"
640
641cgen-decode: force
642 $(SHELL) $(srccom)/cgen.sh decode $(srcdir) \
643 $(SCHEME) $(SCHEMEFLAGS) \
644 $(srccgen) $(CGEN_VERBOSE) \
645 $(arch) "$(FLAGS)" $(cpu) $(mach) "$(SUFFIX)" ignored
646
36de6f40
DE
647# end-sanitize-cygnus
648
f2de7dfd 649## End COMMON_POST_CONFIG_FRAG
This page took 0.094384 seconds and 4 git commands to generate.