Add --enable-sim-stdio to make console I/O use stdio, not printf_filtered and polling...
[deliverable/binutils-gdb.git] / sim / ppc / Makefile.in
1 #
2 # This file is part of the program psim.
3 #
4 # Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #
20
21 default: all
22
23 VPATH = @srcdir@
24 srcdir = @srcdir@
25 srcroot = $(srcdir)/../..
26
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29
30 host_alias = @host_alias@
31 target_alias = @target_alias@
32 program_transform_name = @program_transform_name@
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
35 tooldir = $(libdir)/$(target_alias)
36
37 datadir = $(prefix)/lib
38 mandir = $(prefix)/man
39 man1dir = $(mandir)/man1
40 man2dir = $(mandir)/man2
41 man3dir = $(mandir)/man3
42 man4dir = $(mandir)/man4
43 man5dir = $(mandir)/man5
44 man6dir = $(mandir)/man6
45 man7dir = $(mandir)/man7
46 man8dir = $(mandir)/man8
47 man9dir = $(mandir)/man9
48 infodir = $(prefix)/info
49 includedir = $(prefix)/include
50 docdir = $(datadir)/doc
51
52 SHELL = /bin/sh
53
54 INSTALL = $(srcroot)/install.sh -c
55 INSTALL_PROGRAM = $(INSTALL)
56 INSTALL_DATA = $(INSTALL)
57 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
58 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
59
60 AR = @AR@
61 AR_FLAGS = rc
62 CC = @CC@
63 CFLAGS = @CFLAGS@
64 CC_FOR_BUILD = @CC_FOR_BUILD@
65 BISON = bison
66 MAKEINFO = makeinfo
67 RANLIB = @RANLIB@
68
69 SIM_CFLAGS = @sim_cflags@
70 INLINE_CFLAGS = @sim_inline@
71 BSWAP_CFLAGS = @sim_bswap@
72 ENDIAN_CFLAGS = @sim_endian@
73 HOSTENDIAN_CFLAGS = @sim_hostendian@
74 SMP_CFLAGS = @sim_smp@
75 XOR_ENDIAN_CFLAGS = @sim_xor_endian@
76 BITSIZE_CFLAGS = @sim_bitsize@
77 HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
78 ENV_CFLAGS = @sim_env@
79 TIMEBASE_CFLAGS = @sim_timebase@
80 ALIGNMENT_CFLAGS = @sim_alignment@
81 FLOAT_CFLAGS = @sim_float@
82 TRACE_CFLAGS = @sim_trace@
83 ASSERT_CFLAGS = @sim_assert@
84 RESERVED_CFLAGS = @sim_reserved@
85 MONITOR_CFLAGS = @sim_monitor@
86 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
87 STDIO_CFLAGS = @sim_stdio@
88 WARNING_CFLAGS = @sim_warnings@
89 CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
90 $(ENDIAN_CFLAGS) \
91 $(HOSTENDIAN_CFLAGS) \
92 $(SMP_CFLAGS) \
93 $(XOR_ENDIAN_CFLAGS) \
94 $(BITSIZE_CFLAGS) \
95 $(HOSTBITSIZE_CFLAGS) \
96 $(ENV_CFLAGS) \
97 $(TIMEBASE_CFLAGS) \
98 $(ALIGNMENT_CFLAGS) \
99 $(FLOAT_CFLAGS) \
100 $(TRACE_CFLAGS) \
101 $(ASSERT_CFLAGS) \
102 $(RESERVED_CFLAGS) \
103 $(MONITOR_CFLAGS) \
104 $(MODEL_CFLAGS) \
105 $(STDIO_CFLAGS)
106
107 STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
108 NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
109
110 CONFIG_FILE = @sim_config@
111 IGEN_OPCODE_RULES = @sim_opcode@
112 IGEN_DUPLICATE = @sim_dup@
113 IGEN_FILTER = @sim_filter@
114 IGEN_ICACHE = @sim_icache@
115 DGEN_FLAGS = @sim_switch@
116
117 HDEFINES = @HDEFINES@
118 TDEFINES =
119 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER) $(IGEN_ICACHE)
120
121 .NOEXPORT:
122 MAKEOVERRIDES=
123
124 LIB_INCLUDES = -I$(srcdir)/../../include
125 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
126 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
127 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
128
129 LIBIBERTY_LIB = ../../libiberty/libiberty.a
130 BFD_LIB = ../../bfd/libbfd.a
131
132 TARGETLIB = libsim.a
133
134 all: run $(TARGETLIB) $(GDB_OBJ)
135
136 .c.o:
137 $(CC) -c $(STD_CFLAGS) $<
138
139
140
141 BASICS_H = \
142 basics.h \
143 config.h \
144 ppc-config.h \
145 inline.h \
146 sim_callbacks.h \
147 debug.h filter_filename.h \
148 words.h \
149 bits.h \
150 sim-endian.h
151
152 PSIM_H = \
153 psim.h \
154 $(BASICS_H)
155
156 IDECODE_H = \
157 idecode.h \
158 idecode_expression.h \
159 idecode_branch.h \
160 idecode_fields.h \
161 icache.h
162
163 REGISTERS_H = \
164 registers.h \
165 spreg.h
166
167 CPU_H = \
168 cpu.h \
169 $(BASICS_H) \
170 $(REGISTERS_H) \
171 device.h \
172 corefile.h \
173 vm.h \
174 events.h \
175 interrupts.h \
176 psim.h \
177 icache.h \
178 itable.h \
179 mon.h \
180 model.h
181
182 DEVICE_TABLE_H = \
183 $(BASICS_H) \
184 device_table.h \
185 device.h
186
187 EMUL_GENERIC_H = \
188 $(CPU_H) \
189 $(IDECODE_H) \
190 emul_generic.h \
191 os_emul.h
192
193
194 INLINE = \
195 inline.h \
196 inline.c
197
198 BUILT_SRC_WO_CONFIG = \
199 icache.h \
200 idecode.h idecode.c \
201 semantics.h semantics.c \
202 itable.h itable.c \
203 spreg.h spreg.c \
204 model.h model.c
205
206 BUILT_SRC = \
207 $(BUILT_SRC_WO_CONFIG) \
208 config.h \
209 ppc-config.h
210
211 LIB_SRC = \
212 psim.c \
213 bits.c \
214 debug.c \
215 sim-endian.c \
216 sim-endian.h \
217 sim-endian-n.h \
218 vm.c \
219 vm_n.h \
220 corefile.c \
221 events.c \
222 os_emul.c \
223 emul_generic.c \
224 emul_netbsd.c \
225 emul_chirp.c \
226 emul_bugapi.c \
227 registers.c \
228 cpu.c \
229 interrupts.c \
230 device.c \
231 device_table.c \
232 cap.c \
233 mon.c \
234 options.c
235
236 MAIN_SRC = \
237 main.c \
238 sim_calls.c
239
240
241 # NOTE: semantics, idecode and psim put last so smaller files are compiled
242 # first
243 LIB_OBJ = \
244 debug.o \
245 filter_filename.o \
246 bits.o \
247 sim-endian.o \
248 os_emul.o \
249 emul_generic.o \
250 emul_netbsd.o \
251 emul_chirp.o \
252 emul_bugapi.o \
253 registers.o \
254 vm.o \
255 corefile.o \
256 model.o \
257 spreg.o \
258 cpu.o \
259 interrupts.o \
260 events.o \
261 cap.o \
262 device.o \
263 device_table.o \
264 itable.o \
265 mon.o \
266 semantics.o \
267 idecode.o \
268 psim.o \
269 options.o
270
271
272 GDB_OBJ = sim_calls.o
273
274
275 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
276 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
277
278 run: psim
279 rm -f run
280 ln psim run
281
282 $(TARGETLIB): tmp-igen tmp-dgen $(LIB_OBJ) $(GDB_OBJ)
283 rm -f $(TARGETLIB)
284 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
285 $(RANLIB) $(TARGETLIB)
286
287 # Given that inlines are turned on now, rebuild psim whenever
288 # anything changes.
289 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
290
291 bits.o: bits.c $(BASICS_H)
292
293 debug.o: debug.c $(BASICS_H)
294 filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
295
296 sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
297
298 os_emul.o: os_emul.c emul_netbsd.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
299 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
300
301 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
302 emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
303 emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
304
305 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
306
307 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
308
309 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
310
311 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
312 $(CC) -c $(NOWARN_CFLAGS) $<
313
314 # double.o: double.c dp-bit.c
315
316 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
317 device.h corefile.h interrupts.h itable.h mon.h
318
319 corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) device.h
320
321 model.o: model.c $(CPU_H)
322
323 events.o: events.c events.h $(BASICS_H)
324
325 sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h
326
327 spreg.o: spreg.h spreg.c $(BASICS_H)
328
329 main.o: main.c $(PSIM_H) itable.h options.h
330
331 device.o: device.c $(DEVICE_TABLE_H) cap.h
332
333 device_table.o: device_table.c $(DEVICE_TABLE_H) events.h
334
335 cap.o: cap.c cap.h $(BASICS_H)
336
337 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
338 $(CC) -c $(NOWARN_CFLAGS) $<
339
340 itable.o: itable.c itable.h
341
342 mon.o: mon.c $(CPU_H)
343
344 # Rebuild options whenever something changes so the date/time is up to date.
345 options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
346 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
347
348 #
349 # Rules to create the built c source code files
350 #
351
352 ppc-config.h: $(CONFIG_FILE)
353 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
354
355
356 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
357 ./dgen $(DGEN_FLAGS) \
358 -r $(srcdir)/ppc-spr-table \
359 -n spreg.h -P tmp-spreg.h \
360 -n spreg.c -p tmp-spreg.c
361 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
362 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
363 touch tmp-dgen
364
365
366 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
367 ./igen $(IGEN_FLAGS) \
368 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
369 -k $(srcdir)/ppc-cache-rules \
370 -i $(srcdir)/ppc-instructions \
371 -n icache.h -C tmp-icache.h \
372 -n semantics.h -S tmp-semantics.h \
373 -n semantics.c -s tmp-semantics.c \
374 -n idecode.h -D tmp-idecode.h \
375 -n idecode.c -d tmp-idecode.c \
376 -n itable.h -T tmp-itable.h \
377 -n itable.c -t tmp-itable.c \
378 -n model.h -M tmp-model.h \
379 -n model.c -m tmp-model.c
380 $(srcdir)/../../move-if-change tmp-icache.h icache.h
381 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
382 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
383 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
384 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
385 $(srcdir)/../../move-if-change tmp-itable.h itable.h
386 $(srcdir)/../../move-if-change tmp-itable.c itable.c
387 $(srcdir)/../../move-if-change tmp-model.h model.h
388 $(srcdir)/../../move-if-change tmp-model.c model.c
389 touch tmp-igen
390
391 # NOTE: Some versions of make don't handle files created as side-effects
392 # uncomment the below if that is the case.
393
394 $(TARGETLIB): tmp-igen tmp-dgen
395 itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c model.h model.c: tmp-igen
396 spreg.h spreg.c: tmp-dgen
397
398 dgen: dgen.o table.o lf.o misc.o filter_filename.o
399 $(CC_FOR_BUILD) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
400
401 igen: igen.o table.o lf.o misc.o filter_filename.o
402 $(CC_FOR_BUILD) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
403
404 table.o: misc.h filter_filename.h lf.h table.h
405 lf.o: misc.h filter_filename.h lf.h
406 dgen.o igen.o: misc.h filter_filename.h lf.h table.h
407 misc.o: misc.h filter_filename.h
408 # With out this #, make thinks that misc.o doesn't have a rule
409
410 tags etags: TAGS
411
412 TAGS: $(BUILT_SRC)
413 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
414
415 clean mostlyclean:
416 rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG)
417
418 distclean realclean: clean
419 rm -f TAGS Makefile config.cache config.status config.h stamp-h
420
421 maintainer-clean: distclean
422 rm -f *~ *.log ppc-config.h core *.core
423
424 Makefile: Makefile.in config.status
425 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
426
427 config.h: stamp-h ; @true
428 stamp-h: config.in config.status
429 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
430
431 config.status: configure
432 $(SHELL) ./config.status --recheck
433
434 install:
435 $(INSTALL_XFORM) run $(bindir)/run
436
This page took 0.04338 seconds and 5 git commands to generate.