Commit | Line | Data |
---|---|---|
f2de7dfd AC |
1 | # Makefile fragment for common parts of all simulators. |
2 | # Copyright (C) 1997 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 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 | ||
38 | VPATH = @srcdir@ | |
39 | srcdir = @srcdir@ | |
38377b3a | 40 | srccom = $(srcdir)/../common |
f2de7dfd AC |
41 | srcroot = $(srcdir)/../.. |
42 | ||
43 | prefix = @prefix@ | |
44 | exec_prefix = @exec_prefix@ | |
45 | ||
46 | host_alias = @host_alias@ | |
47 | target_alias = @target_alias@ | |
48 | program_transform_name = @program_transform_name@ | |
49 | bindir = @bindir@ | |
50 | ||
51 | libdir = @libdir@ | |
52 | tooldir = $(libdir)/$(target_alias) | |
53 | ||
54 | datadir = @datadir@ | |
55 | mandir = @mandir@ | |
56 | man1dir = $(mandir)/man1 | |
57 | infodir = @infodir@ | |
58 | includedir = @includedir@ | |
59 | ||
60 | SHELL = /bin/sh | |
61 | ||
6808fd61 | 62 | INSTALL = @INSTALL@ |
f2de7dfd AC |
63 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
64 | INSTALL_DATA = @INSTALL_DATA@ | |
f2de7dfd AC |
65 | |
66 | CC = @CC@ | |
67 | CC_FOR_BUILD = @CC_FOR_BUILD@ | |
68 | CFLAGS = @CFLAGS@ | |
69 | SIM_BSWAP = @sim_bswap@ | |
70 | SIM_CFLAGS = @sim_cflags@ | |
71 | SIM_DEBUG = @sim_debug@ | |
f2de7dfd | 72 | SIM_TRACE = @sim_trace@ |
717dbb29 | 73 | SIM_PROFILE = @sim_profile@ |
a77aa7ec | 74 | |
92f91d1f AC |
75 | SIM_ASSERT = @sim_assert@ |
76 | SIM_ALIGNMENT = @sim_alignment@ | |
7456a10d | 77 | SIM_BITSIZE = @sim_bitsize@ |
4141b1c6 | 78 | SIM_DEFAULT_MODEL = @sim_default_model@ |
92f91d1f | 79 | SIM_ENDIAN = @sim_endian@ |
22469a10 | 80 | SIM_ENVIRONMENT = @sim_environment@ |
92f91d1f AC |
81 | SIM_FLOAT = @sim_float@ |
82 | SIM_HARDWARE = @sim_hardware@ | |
83 | SIM_HOSTENDIAN = @sim_hostendian@ | |
84 | SIM_INLINE = @sim_inline@ | |
85 | SIM_PACKAGES = @sim_packages@ | |
86 | SIM_REGPARM = @sim_regparm@ | |
87 | SIM_RESERVED_BITS = @sim_reserved_bits@ | |
4141b1c6 | 88 | SIM_SCACHE = @sim_scache@ |
92f91d1f AC |
89 | SIM_SMP = @sim_smp@ |
90 | SIM_STDCALL = @sim_stdcall@ | |
91 | SIM_WARNINGS = @sim_warnings@ | |
92 | SIM_XOR_ENDIAN = @sim_xor_endian@ | |
93 | ||
f2de7dfd AC |
94 | HDEFINES = @HDEFINES@ |
95 | TDEFINES = | |
96 | ||
97 | AR = @AR@ | |
98 | AR_FLAGS = rc | |
99 | RANLIB = @RANLIB@ | |
100 | MAKEINFO = makeinfo | |
101 | ||
f7abc1ca DE |
102 | DEP = $(srcroot)/mkdep |
103 | ||
f2de7dfd | 104 | # Each simulator's Makefile.in defines one or more of these variables |
0f2811d1 DE |
105 | # to override our settings as necessary. There is no need to define these |
106 | # in the simulator's Makefile.in if one is using the default value. In fact | |
107 | # it's preferable not to. | |
f2de7dfd AC |
108 | |
109 | # List of object files, less common parts. | |
110 | SIM_OBJS = | |
6808fd61 ILT |
111 | # List of extra dependencies. |
112 | # Generally this consists of simulator specific files included by sim-main.h. | |
113 | SIM_EXTRA_DEPS = | |
f2de7dfd AC |
114 | # List of flags to always pass to $(CC). |
115 | SIM_EXTRA_CFLAGS = | |
116 | # List of extra libraries to link with. | |
117 | SIM_EXTRA_LIBS = | |
118 | # List of extra program dependencies. | |
119 | SIM_EXTRA_LIBDEPS = | |
120 | # List of main object files for `run'. | |
121 | SIM_RUN_OBJS = run.o | |
122 | # Dependency of `all' to build any extra files. | |
123 | SIM_EXTRA_ALL = | |
124 | # Dependency of `install' to install any extra files. | |
125 | SIM_EXTRA_INSTALL = | |
126 | # Dependency of `clean' to clean any extra files. | |
127 | SIM_EXTRA_CLEAN = | |
128 | ||
e5ce1670 DE |
129 | # Every time a new general purpose source file was added every target's |
130 | # Makefile.in needed to be updated to include the file in SIM_OBJS. | |
131 | # This doesn't scale. | |
132 | # This variable specifies all the generic stuff common to the newer simulators. | |
133 | # Things like sim-reason.o can't go here as the cpu may provide its own | |
134 | # (though hopefully in time that won't be so). Things like sim-bits.o can go | |
135 | # here. Some files are used by all simulators (e.g. callback.o). | |
136 | # Those files are specified in LIB_OBJS below. | |
137 | ||
138 | SIM_NEW_COMMON_OBJS = \ | |
139 | sim-bits.o \ | |
140 | sim-break.o \ | |
141 | sim-config.o \ | |
142 | sim-core.o \ | |
143 | sim-endian.o \ | |
144 | sim-events.o \ | |
145 | sim-fpu.o \ | |
146 | sim-io.o \ | |
147 | sim-load.o \ | |
148 | sim-memopt.o \ | |
149 | sim-module.o \ | |
150 | sim-options.o \ | |
151 | sim-profile.o \ | |
1ebc7e0e | 152 | sim-signal.o \ |
e5ce1670 DE |
153 | sim-trace.o \ |
154 | sim-utils.o \ | |
155 | sim-watch.o | |
156 | ||
f2de7dfd AC |
157 | ## End COMMON_PRE_CONFIG_FRAG |
158 | ||
159 | ## COMMON_POST_CONFIG_FRAG | |
160 | ||
92f91d1f AC |
161 | CONFIG_CFLAGS = @DEFS@ \ |
162 | $(SIM_CFLAGS) \ | |
163 | $(SIM_DEBUG) \ | |
4141b1c6 | 164 | $(SIM_DEFAULT_MODEL) \ |
92f91d1f AC |
165 | $(SIM_TRACE) \ |
166 | $(SIM_PROFILE) \ | |
167 | $(SIM_BSWAP) \ | |
168 | $(SIM_ASSERT) \ | |
169 | $(SIM_ALIGNMENT) \ | |
7456a10d | 170 | $(SIM_BITSIZE) \ |
92f91d1f | 171 | $(SIM_ENDIAN) \ |
22469a10 | 172 | $(SIM_ENVIRONMENT) \ |
92f91d1f AC |
173 | $(SIM_FLOAT) \ |
174 | $(SIM_HARDWARE) \ | |
175 | $(SIM_HOSTENDIAN) \ | |
176 | $(SIM_INLINE) \ | |
177 | $(SIM_PACKAGES) \ | |
178 | $(SIM_REGPARM) \ | |
179 | $(SIM_RESERVED_BITS) \ | |
4141b1c6 | 180 | $(SIM_SCACHE) \ |
92f91d1f AC |
181 | $(SIM_SMP) \ |
182 | $(SIM_STDCALL) \ | |
183 | $(SIM_WARNINGS) \ | |
184 | $(SIM_XOR_ENDIAN) \ | |
185 | $(SIM_EXTRA_CFLAGS) \ | |
186 | $(HDEFINES) $(TDEFINES) | |
38377b3a | 187 | CSEARCH = -I. -I$(srcdir) -I../common -I$(srccom) \ |
f2de7dfd | 188 | -I../../include -I$(srcroot)/include \ |
a77aa7ec | 189 | -I../../bfd -I$(srcroot)/bfd \ |
f2de7dfd AC |
190 | -I../../opcodes -I$(srcroot)/opcodes |
191 | ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(CFLAGS) | |
192 | BUILD_CFLAGS = -g -O $(CSEARCH) | |
193 | ||
f7abc1ca DE |
194 | COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) |
195 | ||
f2de7dfd AC |
196 | LIBIBERTY_LIB = ../../libiberty/libiberty.a |
197 | BFD_LIB = ../../bfd/libbfd.a | |
198 | OPCODES_LIB = ../../opcodes/libopcodes.a | |
199 | CONFIG_LIBS = @LIBS@ | |
200 | LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB) \ | |
201 | $(SIM_EXTRA_LIBDEPS) | |
202 | EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB) \ | |
203 | $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) | |
204 | ||
f7abc1ca | 205 | LIB_OBJS = callback.o syscall.o targ-map.o $(SIM_OBJS) |
f2de7dfd | 206 | |
22469a10 | 207 | all: $(SIM_EXTRA_ALL) libsim.a run .gdbinit |
f2de7dfd AC |
208 | |
209 | libsim.a: $(LIB_OBJS) | |
210 | rm -f libsim.a | |
fafce69a | 211 | $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS) |
f2de7dfd AC |
212 | $(RANLIB) libsim.a |
213 | ||
214 | run: $(SIM_RUN_OBJS) libsim.a $(LIBDEPS) | |
215 | $(CC) $(ALL_CFLAGS) -o run \ | |
216 | $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS) | |
217 | ||
38377b3a | 218 | run.o: $(srccom)/run.c config.h tconfig.h \ |
22469a10 | 219 | $(srcroot)/include/remote-sim.h $(srcroot)/include/callback.h |
38377b3a | 220 | $(CC) -c $(srccom)/run.c $(ALL_CFLAGS) |
f2de7dfd AC |
221 | |
222 | # FIXME: Ideally, callback.o and friends live in a library outside of | |
223 | # both the gdb and simulator source trees (e.g. devo/remote. Not | |
224 | # devo/libremote because this directory would contain more than just | |
225 | # a library). | |
226 | ||
38377b3a | 227 | callback.o: $(srccom)/callback.c config.h tconfig.h \ |
f2de7dfd | 228 | $(srcroot)/include/callback.h targ-vals.h |
38377b3a | 229 | $(CC) -c $(srccom)/callback.c $(ALL_CFLAGS) |
f2de7dfd | 230 | |
38377b3a | 231 | syscall.o: $(srccom)/syscall.c config.h tconfig.h \ |
f7abc1ca | 232 | $(srcroot)/include/callback.h targ-vals.h |
38377b3a | 233 | $(CC) -c $(srccom)/syscall.c $(ALL_CFLAGS) |
f7abc1ca | 234 | |
f2de7dfd AC |
235 | targ-map.o: targ-map.c targ-vals.h |
236 | ||
38377b3a DE |
237 | gentmap: Makefile $(srccom)/gentmap.c targ-vals.def |
238 | $(CC_FOR_BUILD) $(srccom)/gentmap.c -o gentmap $(BUILD_CFLAGS) $(NL_TARGET) | |
f2de7dfd AC |
239 | |
240 | targ-vals.h: gentmap | |
241 | rm -f targ-vals.h | |
242 | ./gentmap -h >targ-vals.h | |
243 | ||
244 | targ-map.c: gentmap | |
245 | rm -f targ-map.c | |
246 | ./gentmap -c >targ-map.c | |
247 | ||
a35e91c3 AC |
248 | |
249 | # | |
250 | # Rules for building sim-* components. Triggered by listing the corresponding | |
251 | # .o file in the list of simulator targets. | |
252 | # | |
253 | ||
6808fd61 ILT |
254 | sim_main_headers = \ |
255 | sim-main.h \ | |
38377b3a DE |
256 | $(srccom)/sim-config.h \ |
257 | $(srccom)/sim-base.h \ | |
258 | $(srccom)/sim-basics.h \ | |
aaa11abe | 259 | $(srccom)/sim-signal.h \ |
38377b3a DE |
260 | $(srccom)/sim-memopt.h \ |
261 | $(srccom)/sim-model.h \ | |
262 | $(srccom)/sim-module.h \ | |
263 | $(srccom)/sim-trace.h \ | |
264 | $(srccom)/sim-profile.h \ | |
265 | $(srccom)/sim-engine.h \ | |
266 | $(srccom)/sim-events.h \ | |
267 | $(srccom)/sim-watch.h \ | |
268 | $(srccom)/sim-assert.h \ | |
f7abc1ca DE |
269 | tconfig.h \ |
270 | $(SIM_EXTRA_DEPS) | |
6808fd61 | 271 | |
38377b3a DE |
272 | sim-assert_h = $(srccom)/sim-assert.h |
273 | sim-endian_h = $(srccom)/sim-endian.h | |
274 | sim-n-endian_h = $(srccom)/sim-n-endian.h | |
275 | sim-bits_h = $(srccom)/sim-bits.h | |
276 | sim-config_h = $(srccom)/sim-config.h | |
277 | sim-n-bits_h = $(srccom)/sim-n-bits.h | |
278 | sim-core_h = $(srccom)/sim-core.h | |
279 | sim-n-core_h = $(srccom)/sim-n-core.h | |
280 | sim-engine_h = $(srccom)/sim-engine.h | |
281 | sim-events_h = $(srccom)/sim-events.h | |
282 | sim-fpu_h = $(srccom)/sim-fpu.h | |
283 | sim-io_h = $(srccom)/sim-io.h | |
284 | sim-options_h = $(srccom)/sim-options.h | |
285 | sim-break_h = $(srccom)/sim-break.h | |
1ebc7e0e | 286 | sim-signal_h = $(srccom)/sim-signal.h |
a35e91c3 | 287 | |
6808fd61 | 288 | # FIXME: If this complicated way of building .o files from ../common is |
c967f187 | 289 | # necessary, the reason should be documented here. |
6808fd61 ILT |
290 | |
291 | BUILT_SRC_FROM_COMMON= \ | |
5dcf955d | 292 | sim-inline.c |
6808fd61 | 293 | |
38377b3a | 294 | sim-abort.o: $(srccom)/sim-abort.c \ |
f7abc1ca | 295 | $(SIM_EXTRA_DEPS) |
38377b3a | 296 | $(CC) -c $(srccom)/sim-abort.c $(ALL_CFLAGS) |
f03b093c | 297 | |
38377b3a | 298 | sim-bits.o: $(srccom)/sim-bits.c $(sim-bits_h) $(sim-n-bits_h) \ |
f7abc1ca | 299 | $(SIM_EXTRA_DEPS) |
38377b3a | 300 | $(CC) -c $(srccom)/sim-bits.c $(ALL_CFLAGS) |
a35e91c3 | 301 | |
38377b3a | 302 | sim-config.o: $(srccom)/sim-config.c $(sim-config_h) \ |
189e2694 | 303 | $(SIM_EXTRA_DEPS) |
38377b3a | 304 | $(CC) -c $(srccom)/sim-config.c $(ALL_CFLAGS) |
a35e91c3 | 305 | |
189e2694 DE |
306 | sim-core.o: $(srccom)/sim-core.c $(sim_main_headers) \ |
307 | $(sim-core_h) $(sim-n-core_h) \ | |
f7abc1ca | 308 | $(SIM_EXTRA_DEPS) |
38377b3a | 309 | $(CC) -c $(srccom)/sim-core.c $(ALL_CFLAGS) |
a35e91c3 | 310 | |
38377b3a | 311 | sim-endian.o: $(srccom)/sim-endian.c $(sim-endian_h) $(sim-n-endian_h) \ |
f7abc1ca | 312 | $(SIM_EXTRA_DEPS) |
38377b3a | 313 | $(CC) -c $(srccom)/sim-endian.c $(ALL_CFLAGS) |
a35e91c3 | 314 | |
38377b3a DE |
315 | sim-engine.o: $(srccom)/sim-engine.c $(sim_main_headers) $(sim-engine_h) |
316 | $(CC) -c $(srccom)/sim-engine.c $(ALL_CFLAGS) | |
f03b093c | 317 | |
38377b3a | 318 | sim-events.o: $(srccom)/sim-events.c $(sim-events_h) \ |
f7abc1ca | 319 | $(SIM_EXTRA_DEPS) |
38377b3a | 320 | $(CC) -c $(srccom)/sim-events.c $(ALL_CFLAGS) |
a35e91c3 | 321 | |
38377b3a | 322 | sim-fpu.o: $(srccom)/sim-fpu.c $(sim-fpu_h) \ |
f7abc1ca | 323 | $(SIM_EXTRA_DEPS) |
38377b3a | 324 | $(CC) -c $(srccom)/sim-fpu.c $(ALL_CFLAGS) |
fafce69a | 325 | |
38377b3a | 326 | sim-hload.o: $(srccom)/sim-hload.c $(sim-assert_h) \ |
22469a10 | 327 | $(srcroot)/include/remote-sim.h \ |
f7abc1ca | 328 | $(SIM_EXTRA_DEPS) |
38377b3a | 329 | $(CC) -c $(srccom)/sim-hload.c $(ALL_CFLAGS) |
3971886a | 330 | |
22469a10 DE |
331 | sim-hrw.o: $(srccom)/sim-hrw.c $(sim-assert_h) $(sim_core_h) \ |
332 | $(srcroot)/include/remote-sim.h \ | |
f7abc1ca | 333 | $(SIM_EXTRA_DEPS) |
38377b3a | 334 | $(CC) -c $(srccom)/sim-hrw.c $(ALL_CFLAGS) |
92f91d1f | 335 | |
38377b3a | 336 | sim-inline.c: $(srccom)/sim-inline.c |
a35e91c3 | 337 | rm -f $@ tmp-$@ |
38377b3a DE |
338 | echo "# 1 \"$(srccom)/$@\"" > tmp-$@ |
339 | cat $(srccom)/$@ >> tmp-$@ | |
a35e91c3 AC |
340 | $(srcdir)/../../move-if-change tmp-$@ $@ |
341 | ||
22469a10 DE |
342 | sim-io.o: $(srccom)/sim-io.c $(sim_main_headers) $(sim-io_h) \ |
343 | $(srcroot)/include/remote-sim.h | |
38377b3a | 344 | $(CC) -c $(srccom)/sim-io.c $(ALL_CFLAGS) |
a35e91c3 | 345 | |
38377b3a | 346 | sim-memopt.o: $(srccom)/sim-memopt.c $(sim_main_headers) \ |
f7abc1ca | 347 | $(sim-io_h) |
38377b3a | 348 | $(CC) -c $(srccom)/sim-memopt.c $(ALL_CFLAGS) |
a34abff8 | 349 | |
38377b3a | 350 | sim-module.o: $(srccom)/sim-module.c $(sim_main_headers) \ |
f7abc1ca | 351 | $(sim-io_h) |
38377b3a | 352 | $(CC) -c $(srccom)/sim-module.c $(ALL_CFLAGS) |
717dbb29 | 353 | |
38377b3a | 354 | sim-options.o: $(srccom)/sim-options.c $(sim_main_headers) \ |
f7abc1ca | 355 | $(sim-options_h) $(sim-io_h) |
38377b3a | 356 | $(CC) -c $(srccom)/sim-options.c $(ALL_CFLAGS) |
0f2811d1 | 357 | |
22469a10 DE |
358 | sim-reason.o: $(srccom)/sim-reason.c $(sim_main_headers) \ |
359 | $(srcroot)/include/remote-sim.h | |
38377b3a | 360 | $(CC) -c $(srccom)/sim-reason.c $(ALL_CFLAGS) |
f03b093c | 361 | |
22469a10 DE |
362 | sim-resume.o: $(srccom)/sim-resume.c $(sim_main_headers) \ |
363 | $(srcroot)/include/remote-sim.h | |
38377b3a | 364 | $(CC) -c $(srccom)/sim-resume.c $(ALL_CFLAGS) |
f03b093c | 365 | |
38377b3a DE |
366 | sim-run.o: $(srccom)/sim-run.c $(sim_main_headers) |
367 | $(CC) -c $(srccom)/sim-run.c $(ALL_CFLAGS) | |
f03b093c | 368 | |
1ebc7e0e DE |
369 | sim-signal.o: $(srccom)/sim-signal.c $(sim_main_headers) $(sim-signal_h) |
370 | $(CC) -c $(srccom)/sim-signal.c $(ALL_CFLAGS) | |
371 | ||
38377b3a DE |
372 | sim-stop.o: $(srccom)/sim-stop.c $(sim_main_headers) |
373 | $(CC) -c $(srccom)/sim-stop.c $(ALL_CFLAGS) | |
f03b093c | 374 | |
38377b3a | 375 | sim-trace.o: $(srccom)/sim-trace.c $(sim_main_headers) \ |
f7abc1ca | 376 | $(sim-options_h) $(sim-io_h) |
38377b3a | 377 | $(CC) -c $(srccom)/sim-trace.c $(ALL_CFLAGS) |
e9b2f579 | 378 | |
38377b3a | 379 | sim-profile.o: $(srccom)/sim-profile.c $(sim_main_headers) \ |
f7abc1ca | 380 | $(sim-options_h) $(sim-io_h) |
38377b3a | 381 | $(CC) -c $(srccom)/sim-profile.c $(ALL_CFLAGS) |
717dbb29 | 382 | |
38377b3a | 383 | sim-model.o: $(srccom)/sim-model.c $(sim_main_headers) \ |
f7abc1ca | 384 | $(sim-io_h) |
38377b3a | 385 | $(CC) -c $(srccom)/sim-model.c $(ALL_CFLAGS) |
c967f187 | 386 | |
38377b3a DE |
387 | sim-utils.o: $(srccom)/sim-utils.c $(sim_main_headers) |
388 | $(CC) -c $(srccom)/sim-utils.c $(ALL_CFLAGS) | |
a35e91c3 | 389 | |
38377b3a DE |
390 | sim-watch.o: $(srccom)/sim-watch.c $(sim_main_headers) |
391 | $(CC) -c $(srccom)/sim-watch.c $(ALL_CFLAGS) | |
fafce69a | 392 | |
38377b3a DE |
393 | sim-load.o: $(srccom)/sim-load.c $(srcroot)/include/callback.h |
394 | $(CC) -c $(srccom)/sim-load.c $(ALL_CFLAGS) | |
0f2811d1 | 395 | |
38377b3a | 396 | sim-break.o: $(srccom)/sim-break.c $(sim_main_headers) \ |
f7abc1ca | 397 | $(sim_break_h) |
38377b3a | 398 | $(CC) -c $(srccom)/sim-break.c $(ALL_CFLAGS) |
b9d580a4 | 399 | |
38377b3a | 400 | nrun.o: $(srccom)/nrun.c config.h tconfig.h \ |
22469a10 DE |
401 | $(srcroot)/include/remote-sim.h $(srcroot)/include/callback.h \ |
402 | $(sim_main_headers) | |
38377b3a | 403 | $(CC) -c $(srccom)/nrun.c $(ALL_CFLAGS) |
a35e91c3 | 404 | |
c967f187 DE |
405 | # CGEN support. |
406 | ||
38377b3a | 407 | cgen-run.o: $(srccom)/cgen-run.c $(sim_main_headers) \ |
4a44afd5 | 408 | $(srccom)/cgen-mem.h $(srccom)/cgen-ops.h |
38377b3a | 409 | $(CC) -c $(srccom)/cgen-run.c $(ALL_CFLAGS) |
88d5f8e8 | 410 | |
4a44afd5 | 411 | cgen-scache.o: $(srccom)/cgen-scache.c $(sim_main_headers) |
38377b3a | 412 | $(CC) -c $(srccom)/cgen-scache.c $(ALL_CFLAGS) |
c967f187 | 413 | |
38377b3a DE |
414 | cgen-trace.o: $(srccom)/cgen-trace.c $(sim_main_headers) \ |
415 | $(srccom)/cgen-trace.h | |
416 | $(CC) -c $(srccom)/cgen-trace.c $(ALL_CFLAGS) | |
c967f187 | 417 | |
38377b3a DE |
418 | cgen-utils.o: $(srccom)/cgen-utils.c $(sim_main_headers) \ |
419 | $(srccom)/cgen-mem.h $(srccom)/cgen-ops.h | |
420 | $(CC) -c $(srccom)/cgen-utils.c $(ALL_CFLAGS) | |
c967f187 DE |
421 | |
422 | # Support targets. | |
423 | ||
f2de7dfd AC |
424 | install: install-common $(SIM_EXTRA_INSTALL) |
425 | ||
6808fd61 ILT |
426 | install-common: installdirs |
427 | n=`echo run | sed '$(program_transform_name)'`; \ | |
428 | $(INSTALL_PROGRAM) run $(bindir)/$$n | |
429 | ||
430 | installdirs: | |
431 | $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir) | |
f2de7dfd AC |
432 | |
433 | check: | |
434 | ||
435 | info: | |
436 | clean-info: | |
437 | install-info: | |
438 | ||
439 | .NOEXPORT: | |
440 | MAKEOVERRIDES= | |
441 | ||
442 | tags etags: TAGS | |
443 | ||
444 | TAGS: force | |
645ab3ec | 445 | etags --regex '/^\/[*] TAGS: .*/' *.c *.h |
f2de7dfd | 446 | |
717dbb29 | 447 | clean: $(SIM_EXTRA_CLEAN) |
f2de7dfd AC |
448 | rm -f *.[oa] *~ core |
449 | rm -f run libsim.a | |
450 | rm -f gentmap targ-map.c targ-vals.h | |
f7abc1ca | 451 | if [ ! -f Make-common.in ] ; then \ |
5dcf955d DE |
452 | rm -f $(BUILT_SRC_FROM_COMMON) ; \ |
453 | fi | |
f2de7dfd | 454 | |
717dbb29 | 455 | distclean mostlyclean maintainer-clean realclean: clean |
f2de7dfd | 456 | rm -f TAGS |
88d5f8e8 | 457 | rm -f Makefile config.cache config.log config.status .gdbinit |
f2de7dfd | 458 | rm -f tconfig.h config.h stamp-h |
0f399b0c | 459 | rm -f targ-vals.def |
f2de7dfd AC |
460 | |
461 | .c.o: | |
462 | $(CC) -c $(ALL_CFLAGS) $< | |
463 | ||
464 | # Dummy target to force execution of dependent targets. | |
465 | force: | |
466 | ||
38377b3a | 467 | Makefile: Makefile.in $(srccom)/Make-common.in config.status |
f2de7dfd AC |
468 | CONFIG_HEADERS= $(SHELL) ./config.status |
469 | ||
470 | config.status: configure | |
471 | $(SHELL) ./config.status --recheck | |
472 | ||
473 | config.h: stamp-h ; @true | |
474 | stamp-h: config.in config.status | |
475 | CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status | |
476 | ||
38377b3a | 477 | .gdbinit: # config.status $(srccom)/gdbinit.in |
88d5f8e8 DE |
478 | CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status |
479 | ||
36de6f40 DE |
480 | # start-sanitize-cygnus |
481 | ||
189e2694 DE |
482 | # CGEN support |
483 | ||
484 | SCHEME = @SCHEME@ | |
485 | SCHEME = guile-ss | |
486 | SCHEME = guile | |
487 | #SCHEMEFLAGS = -b | |
488 | SCHEMEFLAGS = -s | |
489 | srccgen = $(srcroot)/cgen | |
490 | ||
491 | CGEN_VERBOSE = -v | |
492 | CGEN_MAIN_SCM = $(srccgen)/object.scm \ | |
493 | $(srccgen)/utils.scm $(srccgen)/utils-cgen.scm \ | |
494 | $(srccgen)/mode.scm \ | |
495 | $(srccgen)/cpu.scm $(srccgen)/mach.scm \ | |
496 | $(srccgen)/ifield.scm $(srccgen)/iformat.scm \ | |
497 | $(srccgen)/operand.scm $(srccgen)/insn.scm \ | |
498 | $(srccgen)/sim.scm | |
462cfbc4 DE |
499 | CGEN_CPU_SCM = $(srccgen)/sim-cpu.scm $(srccgen)/sim-model.scm \ |
500 | $(srccgen)/sem-ccode.scm | |
189e2694 DE |
501 | CGEN_DECODE_SCM = $(srccgen)/decode.scm |
502 | ||
503 | # Various choices for which cpu specific files to generate. | |
504 | CGEN_CPU_EXTR = -E tmp-ext.c1 | |
505 | CGEN_CPU_READ = -R tmp-read.c1 | |
506 | CGEN_CPU_SEM = -S tmp-sem.c1 | |
507 | CGEN_CPU_SEMSW = -W tmp-semsw.c1 | |
508 | ||
509 | # We store the generated files in the source directory until we decide to | |
510 | # ship a Scheme interpreter with gdb/binutils. Maybe we never will. | |
511 | ||
512 | cgen-arch: force | |
513 | $(SHELL) $(srccom)/cgen.sh arch $(srcdir) \ | |
514 | $(SCHEME) $(SCHEMEFLAGS) \ | |
515 | $(srccgen) $(CGEN_VERBOSE) \ | |
516 | $(arch) "$(FLAGS)" ignored ignored ignored ignored | |
517 | ||
518 | cgen-cpu: force | |
519 | $(SHELL) $(srccom)/cgen.sh cpu $(srcdir) \ | |
520 | $(SCHEME) $(SCHEMEFLAGS) \ | |
521 | $(srccgen) $(CGEN_VERBOSE) \ | |
522 | $(arch) "$(FLAGS)" $(cpu) $(mach) "$(SUFFIX)" "$(EXTRAFILES)" | |
523 | ||
524 | cgen-decode: force | |
525 | $(SHELL) $(srccom)/cgen.sh decode $(srcdir) \ | |
526 | $(SCHEME) $(SCHEMEFLAGS) \ | |
527 | $(srccgen) $(CGEN_VERBOSE) \ | |
528 | $(arch) "$(FLAGS)" $(cpu) $(mach) "$(SUFFIX)" ignored | |
529 | ||
36de6f40 DE |
530 | # end-sanitize-cygnus |
531 | ||
f2de7dfd | 532 | ## End COMMON_POST_CONFIG_FRAG |