]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ppc/Makefile.in
9adf027636ed2fdf722b1675d8310e1b76ea65ce
[thirdparty/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 = @bindir@
34 libdir = @libdir@
35 tooldir = $(libdir)/$(target_alias)
36
37 datadir = @datadir@
38 mandir = @mandir@
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 = @infodir@
49 includedir = @includedir@
50
51 SHELL = /bin/sh
52
53 INSTALL = $(srcroot)/install.sh -c
54 INSTALL_PROGRAM = @INSTALL_PROGRAM@
55 INSTALL_DATA = @INSTALL_DATA@
56 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
57 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
58
59 AR = @AR@
60 AR_FLAGS = rc
61 CC = @CC@
62 CFLAGS = @CFLAGS@
63 CC_FOR_BUILD = @CC_FOR_BUILD@
64 BISON = bison
65 MAKEINFO = makeinfo
66 RANLIB = @RANLIB@
67
68 SIM_CFLAGS = @sim_cflags@
69 INLINE_CFLAGS = @sim_inline@
70 BSWAP_CFLAGS = @sim_bswap@
71 ENDIAN_CFLAGS = @sim_endian@
72 HOSTENDIAN_CFLAGS = @sim_hostendian@
73 SMP_CFLAGS = @sim_smp@
74 XOR_ENDIAN_CFLAGS = @sim_xor_endian@
75 BITSIZE_CFLAGS = @sim_bitsize@
76 HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
77 ENV_CFLAGS = @sim_env@
78 TIMEBASE_CFLAGS = @sim_timebase@
79 ALIGNMENT_CFLAGS = @sim_alignment@
80 FLOAT_CFLAGS = @sim_float@
81 TRACE_CFLAGS = @sim_trace@
82 ASSERT_CFLAGS = @sim_assert@
83 RESERVED_CFLAGS = @sim_reserved@
84 MONITOR_CFLAGS = @sim_monitor@
85 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
86 STDIO_CFLAGS = @sim_stdio@
87 WARNING_CFLAGS = @sim_warnings@
88 CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
89 $(ENDIAN_CFLAGS) \
90 $(HOSTENDIAN_CFLAGS) \
91 $(SMP_CFLAGS) \
92 $(XOR_ENDIAN_CFLAGS) \
93 $(BITSIZE_CFLAGS) \
94 $(HOSTBITSIZE_CFLAGS) \
95 $(ENV_CFLAGS) \
96 $(TIMEBASE_CFLAGS) \
97 $(ALIGNMENT_CFLAGS) \
98 $(FLOAT_CFLAGS) \
99 $(TRACE_CFLAGS) \
100 $(ASSERT_CFLAGS) \
101 $(RESERVED_CFLAGS) \
102 $(MONITOR_CFLAGS) \
103 $(MODEL_CFLAGS) \
104 $(STDIO_CFLAGS)
105
106 STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
107 NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
108 BUILD_CFLAGS = -O $(INCLUDES)
109
110 BUILD_LDFLAGS =
111
112 CONFIG_FILE = @sim_config@
113 IGEN_OPCODE_RULES = @sim_opcode@
114 IGEN_DUPLICATE = @sim_dup@
115 IGEN_FILTER = @sim_filter@
116 IGEN_ICACHE = @sim_icache@
117 DGEN_FLAGS = @sim_switch@
118
119 HDEFINES = @HDEFINES@
120 TDEFINES =
121 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER) $(IGEN_ICACHE)
122
123 .NOEXPORT:
124 MAKEOVERRIDES=
125
126 LIB_INCLUDES = -I$(srcdir)/../../include
127 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
128 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
129 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
130
131 LIBIBERTY_LIB = ../../libiberty/libiberty.a
132 BFD_LIB = ../../bfd/libbfd.a
133
134 TARGETLIB = libsim.a
135
136 all: run $(TARGETLIB) $(GDB_OBJ)
137
138 .c.o:
139 $(CC) -c $(STD_CFLAGS) $<
140
141
142
143 BASICS_H = \
144 basics.h \
145 config.h \
146 ppc-config.h \
147 inline.h \
148 sim_callbacks.h \
149 debug.h filter_filename.h \
150 words.h \
151 bits.h \
152 sim-endian.h
153
154 PSIM_H = \
155 psim.h \
156 $(BASICS_H)
157
158 IDECODE_H = \
159 idecode.h \
160 idecode_expression.h \
161 idecode_branch.h \
162 idecode_fields.h \
163 icache.h
164
165 REGISTERS_H = \
166 registers.h \
167 spreg.h
168
169 CPU_H = \
170 cpu.h \
171 $(BASICS_H) \
172 $(REGISTERS_H) \
173 device.h \
174 corefile.h \
175 vm.h \
176 events.h \
177 interrupts.h \
178 psim.h \
179 icache.h \
180 itable.h \
181 mon.h \
182 model.h
183
184 DEVICE_TABLE_H = \
185 $(BASICS_H) \
186 device_table.h \
187 device.h \
188 hw.h
189
190 EMUL_GENERIC_H = \
191 $(CPU_H) \
192 $(IDECODE_H) \
193 emul_generic.h \
194 os_emul.h
195
196
197 INLINE = \
198 inline.h \
199 inline.c
200
201 BUILT_SRC_WO_CONFIG = \
202 icache.h \
203 idecode.h idecode.c \
204 semantics.h semantics.c \
205 itable.h itable.c \
206 spreg.h spreg.c \
207 model.h model.c \
208 pk.h \
209 hw.h hw.c \
210 filter_host.c
211
212 BUILT_SRC = \
213 $(BUILT_SRC_WO_CONFIG) \
214 config.h \
215 ppc-config.h
216
217 LIB_SRC = \
218 psim.c \
219 bits.c \
220 debug.c \
221 sim-endian.c \
222 sim-endian.h \
223 sim-endian-n.h \
224 vm.c \
225 vm_n.h \
226 corefile.c \
227 events.c \
228 os_emul.c \
229 emul_generic.c \
230 emul_netbsd.c \
231 emul_unix.c \
232 emul_chirp.c \
233 emul_bugapi.c \
234 registers.c \
235 cpu.c \
236 interrupts.c \
237 device.c \
238 device_table.c \
239 cap.c \
240 mon.c \
241 options.c \
242 $(PACKAGE_SRC) \
243 $(HW_SRC)
244
245 MAIN_SRC = \
246 main.c \
247 sim_calls.c
248
249
250 # NOTE: semantics, idecode and psim put last so smaller files are compiled
251 # first
252 LIB_OBJ = \
253 debug.o \
254 filter_filename.o \
255 bits.o \
256 sim-endian.o \
257 os_emul.o \
258 emul_generic.o \
259 emul_netbsd.o \
260 emul_unix.o \
261 emul_chirp.o \
262 emul_bugapi.o \
263 registers.o \
264 vm.o \
265 corefile.o \
266 model.o \
267 spreg.o \
268 cpu.o \
269 interrupts.o \
270 events.o \
271 cap.o \
272 device.o \
273 device_table.o \
274 itable.o \
275 mon.o \
276 semantics.o \
277 idecode.o \
278 psim.o \
279 options.o \
280 $(PACKAGES) \
281 $(HW)
282
283
284 GDB_OBJ = sim_calls.o
285
286 HW_SRC = \
287 hw_cpu.c \
288 hw_memory.c \
289 hw_nvram.c \
290 hw_iobus.c \
291 hw_htab.c \
292 hw_disk.c \
293 hw_trace.c \
294 hw_register.c \
295 hw_vm.c \
296 hw_init.c \
297 hw_pal.c
298
299 HW = \
300 hw_cpu.o \
301 hw_memory.o \
302 hw_nvram.o \
303 hw_iobus.o \
304 hw_htab.o \
305 hw_disk.o \
306 hw_trace.o \
307 hw_register.o \
308 hw_vm.o \
309 hw_init.o \
310 hw_pal.o
311
312 PACKAGE_SRC = \
313 pk_disklabel.c
314
315 PACKAGES = \
316 pk_disklabel.o
317
318
319 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
320 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
321
322 run: psim
323 rm -f run
324 ln psim run
325
326 $(TARGETLIB): tmp-igen tmp-dgen $(HW) $(LIB_OBJ) $(GDB_OBJ)
327 rm -f $(TARGETLIB)
328 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
329 $(RANLIB) $(TARGETLIB)
330
331 # Given that inlines are turned on now, rebuild psim whenever
332 # anything changes.
333 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
334
335 bits.o: bits.c $(BASICS_H)
336
337 debug.o: debug.c $(BASICS_H)
338 filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
339
340 sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
341
342 os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
343 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
344
345 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
346 emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H)
347 emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
348 emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
349
350 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
351
352 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
353
354 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
355
356 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
357 $(CC) -c $(NOWARN_CFLAGS) $<
358
359 # double.o: double.c dp-bit.c
360
361 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
362 device.h corefile.h interrupts.h itable.h mon.h
363
364 corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) $(DEVICE_TABLE_H)
365
366 model.o: model.c $(CPU_H)
367
368 events.o: events.c events.h $(BASICS_H)
369
370 sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h
371
372 spreg.o: spreg.c spreg.h spreg.c $(BASICS_H)
373
374 main.o: main.c $(PSIM_H) itable.h options.h
375
376 device.o: device.c $(DEVICE_TABLE_H) cap.h
377
378 device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c
379
380 cap.o: cap.c cap.h $(BASICS_H)
381
382 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
383 $(CC) -c $(NOWARN_CFLAGS) $<
384
385 itable.o: itable.c itable.h
386
387 mon.o: mon.c $(CPU_H)
388
389 # Rebuild options whenever something changes so the date/time is up to date.
390 options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
391 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
392
393 #
394 # Rules to create the built c source code files
395 #
396
397 ppc-config.h: $(CONFIG_FILE)
398 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
399
400
401 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
402 ./dgen $(DGEN_FLAGS) \
403 -r $(srcdir)/ppc-spr-table \
404 -n spreg.h -P tmp-spreg.h \
405 -n spreg.c -p tmp-spreg.c
406 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
407 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
408 touch tmp-dgen
409
410
411 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
412 ./igen $(IGEN_FLAGS) \
413 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
414 -k $(srcdir)/ppc-cache-rules \
415 -i $(srcdir)/ppc-instructions \
416 -n icache.h -C tmp-icache.h \
417 -n semantics.h -S tmp-semantics.h \
418 -n semantics.c -s tmp-semantics.c \
419 -n idecode.h -D tmp-idecode.h \
420 -n idecode.c -d tmp-idecode.c \
421 -n itable.h -T tmp-itable.h \
422 -n itable.c -t tmp-itable.c \
423 -n model.h -M tmp-model.h \
424 -n model.c -m tmp-model.c
425 $(srcdir)/../../move-if-change tmp-icache.h icache.h
426 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
427 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
428 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
429 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
430 $(srcdir)/../../move-if-change tmp-itable.h itable.h
431 $(srcdir)/../../move-if-change tmp-itable.c itable.c
432 $(srcdir)/../../move-if-change tmp-model.h model.h
433 $(srcdir)/../../move-if-change tmp-model.c model.c
434 touch tmp-igen
435
436 # NOTE: Some versions of make don't handle files created as side-effects
437 # uncomment the below if that is the case.
438
439 $(TARGETLIB): tmp-igen tmp-dgen
440 itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c model.h model.c: tmp-igen
441 spreg.h spreg.c: tmp-dgen
442
443 dgen: dgen.o table.o lf.o misc.o filter_host.o
444 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
445
446 igen: igen.o table.o lf.o misc.o filter_host.o
447 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
448
449 filter_host.c: filter_filename.c
450 cat $(srcdir)/filter_filename.c > filter_host.c
451
452 filter_host.o: filter_host.c filter_filename.h config.h ppc-config.h
453 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c
454
455 table.o: table.c misc.h filter_filename.h lf.h table.h
456 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c
457
458 lf.o: lf.c misc.h filter_filename.h lf.h
459 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c
460
461 dgen.o: dgen.c misc.h filter_filename.h lf.h table.h
462 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c
463
464 igen.o: igen.c misc.h filter_filename.h lf.h table.h
465 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
466
467 misc.o: misc.c misc.h filter_filename.h
468 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
469
470 # With out this #, make thinks that misc.o doesn't have a rule
471
472 # real hardware
473 hw.h: Makefile
474 (cd $(srcdir); ls $(HW_SRC)) \
475 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
476 -e 's/^/extern const device_descriptor /' \
477 -e 's/$$/_device_descriptor\[\];/' \
478 > tmp-hw.h
479 mv tmp-hw.h hw.h
480 hw.c: Makefile
481 (cd $(srcdir); ls $(HW_SRC)) \
482 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
483 -e 's/^/ /' \
484 -e 's/$$/_device_descriptor,/' \
485 > tmp-hw.c
486 mv tmp-hw.c hw.c
487 hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H)
488 hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
489 hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
490 hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
491 hw_pal.o: hw_pal.c $(DEVICE_TABLE_H)
492 hw_htab.o: hw_htab.c $(DEVICE_TABLE_H)
493 hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) pk.h
494 hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
495 hw_register.o: hw_register.c $(DEVICE_TABLE_H)
496 hw_vm.o: hw_vm.c $(DEVICE_TABLE_H)
497 hw_init.o: hw_init.c $(DEVICE_TABLE_H)
498 # ignore this line, it stops make from getting confused
499
500
501 # real packages
502 pk.h: Makefile
503 (cd $(srcdir); ls $(PACKAGE_SRC)) \
504 | sed -e 's/^pk_\(.*\)\.c/\1/' \
505 -e 's/^/extern package_create_instance_callback pk_/' \
506 -e 's/$$/_create_instance;/' \
507 > tmp-pk.h
508 mv tmp-pk.h pk.h
509
510 pk_disklabel.o: pk.h $(DEVICE_TABLE_H)
511 # ignore this line, it stops make from getting confused
512
513 tags etags: TAGS
514
515 TAGS: $(BUILT_SRC)
516 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
517
518 clean mostlyclean:
519 rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG)
520
521 distclean realclean: clean
522 rm -f TAGS Makefile config.cache config.status config.h stamp-h
523
524 maintainer-clean: distclean
525 rm -f *~ *.log ppc-config.h core *.core
526
527 Makefile: Makefile.in config.status
528 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
529
530 config.h: stamp-h ; @true
531 stamp-h: config.in config.status
532 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
533
534 config.status: configure
535 $(SHELL) ./config.status --recheck
536
537 install:
538 $(INSTALL_XFORM) run $(bindir)/run
539