]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/ppc/Makefile.in
* elf-bfd.h (eh_cie_fde): Add new fields: add_augmentation_size and
[thirdparty/binutils-gdb.git] / sim / ppc / Makefile.in
CommitLineData
c906108c
SS
1#
2# This file is part of the program psim.
3#
8d64d0fd 4# Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
c906108c
SS
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
21default: all
22
23VPATH = @srcdir@
24srcdir = @srcdir@
25srcroot = $(srcdir)/../..
26
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29
30host_alias = @host_alias@
31target_alias = @target_alias@
32program_transform_name = @program_transform_name@
33bindir = @bindir@
34libdir = @libdir@
35tooldir = $(libdir)/$(target_alias)
36
37datadir = @datadir@
38mandir = @mandir@
39man1dir = $(mandir)/man1
40man2dir = $(mandir)/man2
41man3dir = $(mandir)/man3
42man4dir = $(mandir)/man4
43man5dir = $(mandir)/man5
44man6dir = $(mandir)/man6
45man7dir = $(mandir)/man7
46man8dir = $(mandir)/man8
47man9dir = $(mandir)/man9
48infodir = @infodir@
49includedir = @includedir@
50
51# This can be referenced by the gettext configuration code.
52top_builddir = ..
53
54EXEEXT = @EXEEXT@
55SHELL = /bin/sh
56
57INSTALL = @INSTALL@
58INSTALL_PROGRAM = @INSTALL_PROGRAM@
59INSTALL_DATA = @INSTALL_DATA@
60
61AR = @AR@
62AR_FLAGS = rc
63CC = @CC@
64CFLAGS = @CFLAGS@
65CC_FOR_BUILD = @CC_FOR_BUILD@
66BISON = bison
67MAKEINFO = makeinfo
68RANLIB = @RANLIB@
69
70SIM_CFLAGS = @sim_cflags@
71INLINE_CFLAGS = @sim_inline@
72BSWAP_CFLAGS = @sim_bswap@
73ENDIAN_CFLAGS = @sim_endian@
74REGPARM_CFLAGS = @sim_regparm@
75STDCALL_CFLAGS = @sim_stdcall@
76HOSTENDIAN_CFLAGS = @sim_hostendian@
77SMP_CFLAGS = @sim_smp@
78XOR_ENDIAN_CFLAGS = @sim_xor_endian@
79BITSIZE_CFLAGS = @sim_bitsize@
80HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
81ENV_CFLAGS = @sim_env@
82TIMEBASE_CFLAGS = @sim_timebase@
83ALIGNMENT_CFLAGS = @sim_alignment@
84FLOAT_CFLAGS = @sim_float@
85TRACE_CFLAGS = @sim_trace@
86ASSERT_CFLAGS = @sim_assert@
87RESERVED_CFLAGS = @sim_reserved@
88MONITOR_CFLAGS = @sim_monitor@
89MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
90STDIO_CFLAGS = @sim_stdio@
91TERMIO_CFLAGS = @sim_termio@
92WARNING_CFLAGS = @sim_warnings@
93DEVZERO_CFLAGS = @sim_devzero@
94CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
95 $(ENDIAN_CFLAGS) \
96 $(REGPARM_CFLAGS) \
97 $(STDCALL_CFLAGS) \
98 $(HOSTENDIAN_CFLAGS) \
99 $(SMP_CFLAGS) \
100 $(XOR_ENDIAN_CFLAGS) \
101 $(BITSIZE_CFLAGS) \
102 $(HOSTBITSIZE_CFLAGS) \
103 $(ENV_CFLAGS) \
104 $(TIMEBASE_CFLAGS) \
105 $(ALIGNMENT_CFLAGS) \
106 $(FLOAT_CFLAGS) \
107 $(TRACE_CFLAGS) \
108 $(ASSERT_CFLAGS) \
109 $(RESERVED_CFLAGS) \
110 $(MONITOR_CFLAGS) \
111 $(MODEL_CFLAGS) \
112 $(STDIO_CFLAGS) \
113 $(TERMIO_CFLAGS) \
114 $(DEVZERO_CFLAGS)
8d64d0fd 115SIM_FPU_CFLAGS = @sim_fpu_cflags@
c906108c 116
8d64d0fd
AC
117STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
118NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(SIM_FPU_CFLAGS)
c906108c
SS
119BUILD_CFLAGS = -g -O $(INCLUDES) $(WARNING_CFLAGS)
120
121BUILD_LDFLAGS =
122
123CONFIG_FILE = @sim_config@
124IGEN_OPCODE_RULES = @sim_opcode@
125IGEN_DECODE_MECHANISM = @sim_decode_mechanism@
126IGEN_DUPLICATE = @sim_dup@
127IGEN_JUMP = @sim_jump@
128IGEN_FILTER = @sim_filter@
129IGEN_ICACHE = @sim_icache@
130IGEN_SMP = @sim_igen_smp@
131IGEN_LINE_NR = @sim_line_nr@
132DGEN_FLAGS = @sim_switch@
133
134HDEFINES = @HDEFINES@
135TDEFINES =
136IGEN_FLAGS = \
137 $(IGEN_DECODE_MECHANISM) \
138 $(IGEN_DUPLICATE) \
139 $(IGEN_JUMP) \
140 $(IGEN_FILTER) \
141 $(IGEN_ICACHE) \
142 $(IGEN_SMP) \
143 $(IGEN_LINE_NR)
144
145.NOEXPORT:
146MAKEOVERRIDES=
147
148LIB_INCLUDES = -I$(srcdir)/../../include
149BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
2a0c8810 150GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config
8d64d0fd 151
c906108c
SS
152INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
153
154LIBIBERTY_LIB = ../../libiberty/libiberty.a
155BFD_LIB = ../../bfd/libbfd.a
156
157INTLLIBS = @INTLLIBS@
158INTLDEPS = @INTLDEPS@
bf1024d6
AC
159INTL_DIR = ../../intl
160INTL_SRC = $(srcdir)/$(INTL_DIR)
161INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC)
162
c906108c
SS
163
164TARGETLIB = libsim.a
165
166all: run $(TARGETLIB) $(GDB_OBJ)
167
168.c.o:
169 $(CC) -c $(STD_CFLAGS) $<
170
171
6e9114ad
JB
172# Headers outside sim/ppc.
173ANSIDECL_H = $(srcroot)/include/ansidecl.h
174BFD_H = ../../bfd/bfd.h
6e9114ad
JB
175GDB_CALLBACK_H = $(srcroot)/include/gdb/callback.h
176GDB_REMOTE_SIM_H = $(srcroot)/include/gdb/remote-sim.h
91cd1042 177GDB_SIM_PPC_H = $(srcroot)/include/gdb/sim-ppc.h
6e9114ad
JB
178COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
179COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
180COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
181COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
182COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
183
184# Headers in sim/ppc.
185ACCONFIG_H = \
186 acconfig.h
187
188ALTIVEC_EXPRESSION_H = \
189 altivec_expression.h
190
191ALTIVEC_REGISTERS_H = \
192 altivec_registers.h
c906108c
SS
193
194BASICS_H = \
195 basics.h \
6e9114ad
JB
196 $(CONFIG_H) \
197 $(PPC_CONFIG_H) \
198 $(INLINE_H) \
199 $(SIM_CALLBACKS_H) \
200 $(DEBUG_H) \
201 $(WORDS_H) \
202 $(BITS_H) \
203 $(SIM_ENDIAN_H)
204
205BITS_H = \
c906108c 206 bits.h \
6e9114ad 207 bits.c
c906108c 208
6e9114ad
JB
209CAP_H = \
210 cap.h \
c906108c
SS
211 $(BASICS_H)
212
6e9114ad
JB
213COREFILE_H = \
214 corefile.h
c906108c 215
6e9114ad
JB
216COREFILE_N_H = \
217 corefile-n.h
c906108c
SS
218
219CPU_H = \
220 cpu.h \
221 $(BASICS_H) \
222 $(REGISTERS_H) \
6e9114ad
JB
223 $(DEVICE_H) \
224 $(COREFILE_H) \
225 $(VM_H) \
226 $(EVENTS_H) \
227 $(INTERRUPTS_H) \
228 $(PSIM_H) \
c906108c 229 $(IDECODE_H) \
6e9114ad
JB
230 $(ITABLE_H) \
231 $(OS_EMUL_H) \
232 $(MON_H) \
233 $(MODEL_H) \
234 cpu.c
235
236DEBUG_H = \
237 debug.h \
238 $(FILTER_FILENAME_H)
239
240DEVICE_H = \
241 device.h
c906108c
SS
242
243DEVICE_TABLE_H = \
c906108c 244 device_table.h \
6e9114ad
JB
245 $(BASICS_H) \
246 $(DEVICE_H) \
247 $(TREE_H) \
248 $(HW_H)
249
250E500_EXPRESSION_H = \
251 e500_expression.h
252
253E500_REGISTERS_H = \
254 e500_registers.h
255
256EMUL_BUGAPI_H = \
257 emul_bugapi.h
258
259EMUL_CHIRP_H = \
260 emul_chirp.h
c906108c
SS
261
262EMUL_GENERIC_H = \
6e9114ad 263 emul_generic.h \
c906108c
SS
264 $(CPU_H) \
265 $(IDECODE_H) \
6e9114ad
JB
266 $(OS_EMUL_H) \
267 $(TREE_H) \
268 $(BFD_H)
269
270EMUL_NETBSD_H = \
271 emul_netbsd.h
272
273EMUL_UNIX_H = \
274 emul_unix.h
275
276EVENTS_H = \
277 events.h
278
279FILTER_FILENAME_H = \
280 filter_filename.h
281
282FILTER_H = \
283 filter.h
284
285GEN_ICACHE_H = \
286 gen-icache.h
287
288GEN_IDECODE_H = \
289 gen-idecode.h
290
291GEN_ITABLE_H = \
292 gen-itable.h
293
294GEN_MODEL_H = \
295 gen-model.h
296
297GEN_SEMANTICS_H = \
298 gen-semantics.h
299
300GEN_SUPPORT_H = \
301 gen-support.h
302
303HW_CPU_H = \
304 hw_cpu.h
305
306HW_PHB_H = \
307 hw_phb.h
308
309IDECODE_BRANCH_H = \
310 idecode_branch.h
311
312IDECODE_EXPRESSION_H = \
313 idecode_expression.h \
314 $(ALTIVEC_EXPRESSION_H) \
315 $(E500_EXPRESSION_H)
316
317IDECODE_FIELDS_H = \
318 idecode_fields.h
319
320IGEN_H = \
321 igen.h
322
323INLINE_H = \
324 inline.h
325
326INTERRUPTS_H = \
327 interrupts.h
328
329LD_CACHE_H = \
330 ld-cache.h
331
332LD_DECODE_H = \
333 ld-decode.h
334
335LD_INSN_H = \
336 ld-insn.h
337
338LF_H = \
339 lf.h
340
341MISC_H = \
342 misc.h \
343 $(CONFIG_H) \
344 $(FILTER_FILENAME_H)
345
346MON_H = \
347 mon.h \
348 $(BASICS_H) \
349 $(ITABLE_H)
350
351OPTIONS_H = \
352 options.h
353
354OS_EMUL_H = \
c906108c
SS
355 os_emul.h
356
6e9114ad
JB
357PSIM_H = \
358 psim.h \
359 $(BASICS_H)
360
361REGISTERS_H = \
362 registers.h \
363 $(E500_REGISTERS_H) \
364 $(ALTIVEC_REGISTERS_H) \
365 $(SPREG_H)
366
367SIM_CALLBACKS_H = \
368 sim_callbacks.h
369
370SIM_ENDIAN_H = \
371 sim-endian.h \
372 sim-endian.c
373
374SIM_ENDIAN_N_H = \
375 sim-endian-n.h
376
377SIM_MAIN_H = \
378 sim-main.h \
379 $(COMMON_SIM_BASICS_H) \
380 $(COMMON_SIM_SIGNAL_H) \
381 $(COMMON_SIM_BASE_H)
382
383STD_CONFIG_H = \
384 std-config.h
385
386TABLE_H = \
387 table.h
388
389TREE_H = \
390 tree.h
391
392VM_H = \
393 vm.h
394
395VM_N_H = \
396 vm_n.h
397
398WORDS_H = \
399 words.h
400
401
402# Generated headers.
403CONFIG_H = \
404 config.h
405
406DEFINES_H = \
407 defines.h
408
409HW_H = \
410 hw.h
411
412ICACHE_H = \
413 icache.h
414
415IDECODE_H = \
416 idecode.h \
417 $(IDECODE_EXPRESSION_H) \
418 $(IDECODE_FIELDS_H) \
419 $(IDECODE_BRANCH_H)
420
421ITABLE_H = \
422 itable.h
423
424MODEL_H = \
425 model.h
426
427PK_H = \
428 pk.h
429
430PPC_CONFIG_H = \
431 ppc-config.h
432
433SEMANTICS_H = \
434 semantics.h
435
436SPREG_H = \
437 spreg.h
438
439SUPPORT_H = \
440 support.h \
441 support.c
442
443TARG_VALS_H = \
444 targ-vals.h
445
446TCONFIG_H = \
447 tconfig.h
c906108c
SS
448
449INLINE = \
450 inline.h \
451 inline.c
452
453BUILT_SRC_WO_CONFIG = \
454 icache.h icache.c \
455 support.h support.c \
456 idecode.h idecode.c \
457 semantics.h semantics.c \
458 itable.h itable.c \
459 spreg.h spreg.c \
460 model.h model.c \
461 support.h support.c \
462 pk.h \
463 hw.h hw.c \
464 filter_host.c \
465 @sim_targ_vals@
466
467BUILT_SRC = \
468 $(BUILT_SRC_WO_CONFIG) \
469 config.h \
470 ppc-config.h
471
472LIB_INLINE_SRC = \
473 psim.c \
474 bits.c \
475 debug.c \
476 sim-endian.c \
477 sim-endian.h \
478 sim-endian-n.h \
479 vm.c \
480 vm_n.h \
481 corefile.c \
482 events.c \
483 os_emul.c \
484 registers.c \
485 cpu.c \
486 interrupts.c \
487 device.c \
488 tree.c \
489 device_table.c \
490 cap.c \
491 mon.c \
492 options.c
493
494LIB_SRC = \
495 $(PACKAGE_SRC) \
496 $(HW_SRC) \
497 $(LIB_INLINE_SRC)
498
499MAIN_SRC = \
500 main.c \
91cd1042 501 gdb-sim.c \
c906108c
SS
502 sim_calls.c
503
504
505# NOTE: semantics, idecode and psim put last so smaller files are compiled
506# first
507LIB_OBJ = \
508 debug.o \
509 filter_filename.o \
510 bits.o \
511 sim-endian.o \
512 os_emul.o \
513 emul_generic.o \
514 emul_bugapi.o \
515 emul_chirp.o \
516 emul_netbsd.o \
517 emul_unix.o \
518 registers.o \
519 vm.o \
520 corefile.o \
521 model.o \
522 spreg.o \
523 cpu.o \
524 interrupts.o \
525 events.o \
526 cap.o \
527 device.o \
528 tree.o \
529 device_table.o \
530 itable.o \
531 mon.o \
532 icache.o \
533 semantics.o \
534 idecode.o \
535 support.o \
d29d5195 536 @sim_fpu@ \
c906108c
SS
537 psim.o \
538 $(PACKAGE_OBJ) \
539 $(HW_OBJ) \
540 options.o
541
542
91cd1042 543GDB_OBJ = gdb-sim.o sim_calls.o @sim_callback@
c906108c
SS
544
545HW_SRC = @sim_hw_src@
546HW_OBJ = @sim_hw_obj@
547
548PACKAGE_SRC = @sim_pk_src@
549PACKAGE_OBJ = @sim_pk_obj@
550
551
552psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(INTLDEPS)
553 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(INTLLIBS) $(LIBIBERTY_LIB) $(LIBS)
554
555run: psim
556 rm -f run$(EXEEXT)
557 ln psim$(EXEEXT) run$(EXEEXT)
558
559$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
560 rm -f $(TARGETLIB)
561 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
562 $(RANLIB) $(TARGETLIB)
563
6e9114ad 564psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
c906108c
SS
565
566bits.o: bits.c $(BASICS_H)
567
6e9114ad
JB
568debug.o: debug.c $(CONFIG_H) $(BASICS_H)
569filter_filename.o: filter_filename.c $(CONFIG_H) $(PPC_CONFIG_H) $(FILTER_FILENAME_H)
c906108c 570
6e9114ad 571sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
c906108c 572
6e9114ad 573os_emul.o: os_emul.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H) $(EMUL_GENERIC_H) $(EMUL_NETBSD_H) $(EMUL_UNIX_H) $(EMUL_CHIRP_H) $(EMUL_BUGAPI_H)
c906108c
SS
574emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
575
6e9114ad
JB
576emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
577emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
578emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
579emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
c906108c 580
6e9114ad 581registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
c906108c
SS
582
583cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
584
6e9114ad 585interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
c906108c
SS
586
587# Given that inlines are turned on now, rebuild idecode whenever
588# anything changes.
6e9114ad 589idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
c906108c
SS
590
591# double.o: double.c dp-bit.c
592
6e9114ad 593vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
c906108c 594
6e9114ad 595corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
c906108c 596
6e9114ad 597model.o: model.c $(CPU_H) $(MON_H)
c906108c 598
6e9114ad 599events.o: events.c $(BASICS_H) $(EVENTS_H)
c906108c 600
f37b123d 601sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
c906108c 602
91cd1042
AC
603gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H) $(GDB_SIM_PPC_H) $(SIM_CALLBACK_H)
604
6e9114ad 605spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
c906108c 606
6e9114ad 607main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
c906108c 608
6e9114ad 609device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
c906108c 610
6e9114ad 611tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
c906108c 612
6e9114ad 613device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
c906108c 614
6e9114ad 615cap.o: cap.c $(CAP_H)
c906108c 616
6e9114ad 617semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 618
6e9114ad 619icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 620
6e9114ad 621support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 622
6e9114ad 623itable.o: itable.c $(ITABLE_H)
c906108c 624
6e9114ad 625mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
c906108c
SS
626
627# GDB after 4.16 expects the default_callback structure to be setup.
628# As a kludge, build the common stuff here for now.
629gentmap: ../common/gentmap.c Makefile targ-vals.def
630 $(CC_FOR_BUILD) $(BUILD_FLAGS) -I. -I../common -I$(srcdir)/../common -o gentmap $< $(BUILD_LIBS)
631
632targ-vals.def: $(srcdir)/../common/nltvals.def
633 rm -f targ-vals.def tmp-def
634 cat $(srcdir)/../common/nltvals.def > tmp-vals.def
ae451ac6 635 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def
c906108c
SS
636
637targ-vals.h: Makefile gentmap $(srcdir)/../../move-if-change
638 rm -f tmp-vals.h
639 ./gentmap -h > tmp-vals.h
ae451ac6 640 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h
c906108c
SS
641
642targ-map.c: Makefile gentmap $(srcdir)/../../move-if-change
643 rm -f tmp-map.c
644 ./gentmap -c > tmp-map.c
ae451ac6 645 $(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c
c906108c 646
6e9114ad 647callback.o: ../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
c906108c
SS
648 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $<
649
6e9114ad 650targ-map.o: targ-map.c $(ANSIDECL_H) $(GDB_CALLBACK_H) $(TARG_VALS_H)
c906108c 651
6e9114ad 652sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H) $(TCONFIG_H)
d29d5195
MG
653 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
654
d29d5195
MG
655tconfig.h:
656 rm -f tconfig.h
657 echo > tconfig.h
658
c906108c 659# Rebuild options whenever something changes so the date/time is up to date.
6e9114ad 660options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
c906108c
SS
661 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
662
663tmp-defines: config.h Makefile
664 sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
ae451ac6 665 $(SHELL) $(srcdir)/../../move-if-change tmp-defines.h defines.h
c906108c
SS
666 touch tmp-defines
667
668#
669# Rules to create the built c source code files
670#
671
672ppc-config.h: $(CONFIG_FILE)
673 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
674
675
676tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
677 ./dgen $(DGEN_FLAGS) \
678 -r $(srcdir)/ppc-spr-table \
679 -n spreg.h -hp tmp-spreg.h \
680 -n spreg.c -p tmp-spreg.c
ae451ac6
ILT
681 $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
682 $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
c906108c
SS
683 touch tmp-dgen
684
345d88d9 685tmp-igen: igen $(srcdir)/ppc-instructions $(srcdir)/altivec.igen $(srcdir)/e500.igen $(IGEN_OPCODE_RULES) $(srcdir)/../../move-if-change tmp-ld-decode tmp-ld-cache tmp-ld-insn tmp-filter
c906108c
SS
686 ./igen $(IGEN_FLAGS) \
687 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
43c4bab0 688 -I $(srcdir) -i $(srcdir)/ppc-instructions \
c906108c
SS
689 -n icache.h -hc tmp-icache.h \
690 -n icache.c -c tmp-icache.c \
691 -n semantics.h -hs tmp-semantics.h \
692 -n semantics.c -s tmp-semantics.c \
693 -n idecode.h -hd tmp-idecode.h \
694 -n idecode.c -d tmp-idecode.c \
695 -n itable.h -ht tmp-itable.h \
696 -n itable.c -t tmp-itable.c \
697 -n model.h -hm tmp-model.h \
698 -n model.c -m tmp-model.c \
699 -n support.h -hf tmp-support.h \
700 -n support.c -f tmp-support.c
ae451ac6
ILT
701 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h
702 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c
703 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
704 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
705 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
706 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
707 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
708 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
709 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h
710 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c
711 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h
712 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c
c906108c
SS
713 touch tmp-igen
714
715# NOTE: Some versions of make don't handle files created as side-effects
716# uncomment the below if that is the case.
717
718$(TARGETLIB): tmp-igen tmp-dgen
719itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c model.h model.c support.h support.c: tmp-igen
720spreg.h spreg.c: tmp-dgen
721
722dgen: dgen.o table.o lf.o misc.o filter_host.o
723 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
724
725igen: igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o
726 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o $(BUILD_LIBS)
727
728filter_host.c: filter_filename.c
729 cat $(srcdir)/filter_filename.c > filter_host.c
730
6e9114ad 731filter_host.o: filter_host.c $(CONFIG_H) $(PPC_CONFIG_H) $(FILTER_FILENAME_H)
c906108c
SS
732 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c
733
6e9114ad 734table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
c906108c
SS
735 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c
736
6e9114ad 737lf.o: lf.c $(CONFIG_H) $(MISC_H) $(LF_H)
c906108c
SS
738 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c
739
6e9114ad 740filter.o: filter.c $(CONFIG_H) $(MISC_H) $(FILTER_H)
c906108c 741 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/filter.c
6e9114ad 742tmp-filter: filter.c $(MISC_H) misc.o
c906108c
SS
743 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-filter -DMAIN $(srcdir)/filter.c misc.o $(BUILD_LIBS)
744
6e9114ad 745ld-decode.o: ld-decode.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_DECODE_H)
c906108c
SS
746 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-decode.c
747tmp-ld-decode: ld-decode.o misc.o lf.o table.o filter_host.o
748 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-decode -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS)
749
6e9114ad 750ld-cache.o: ld-cache.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_CACHE_H)
c906108c
SS
751 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-cache.c
752tmp-ld-cache: ld-cache.o misc.o lf.o table.o filter_host.o
753 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-cache -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS)
754
6e9114ad 755ld-insn.o: ld-insn.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H)
c906108c
SS
756 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-insn.c
757tmp-ld-insn: ld-insn.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
d81bb16a 758 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-insn -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o $(BUILD_LIBS)
c906108c 759
6e9114ad 760gen-model.o: gen-model.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(GEN_MODEL_H)
c906108c
SS
761 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-model.c
762
6e9114ad 763gen-itable.o: gen-itable.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_ITABLE_H)
c906108c
SS
764 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-itable.c
765
6e9114ad 766gen-icache.o: gen-icache.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H)
c906108c
SS
767 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-icache.c
768
6e9114ad 769gen-semantics.o: gen-semantics.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_ICACHE_H) $(GEN_IDECODE_H)
c906108c
SS
770 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-semantics.c
771
6e9114ad 772gen-idecode.o: gen-idecode.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H) $(GEN_SEMANTICS_H)
c906108c
SS
773 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-idecode.c
774
6e9114ad 775gen-support.o: gen-support.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
c906108c
SS
776 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-support.c
777
6e9114ad 778dgen.o: dgen.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
c906108c
SS
779 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c
780
6e9114ad 781igen.o: igen.c $(MISC_H) $(LF_H) $(TABLE_H) $(CONFIG_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_MODEL_H) $(GEN_ICACHE_H) $(GEN_ITABLE_H) $(GEN_IDECODE_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
c906108c
SS
782 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
783
6e9114ad 784misc.o: misc.c $(CONFIG_H) $(MISC_H)
c906108c
SS
785 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
786
787
788
789# real hardware
790tmp-hw: Makefile $(HW_SRC) $(srcdir)/../../move-if-change
791 # The first for loop is to remove duplicates.
792 f=""; \
793 for i in $(HW_SRC) ; do \
794 case " $$f " in \
795 *" $$i "*) ;; \
796 *) f="$$f $$i" ;; \
797 esac ; \
798 done ; \
799 for hw in $$f ; do echo $$hw ; done \
800 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
801 -e 's/^/extern const device_descriptor /' \
802 -e 's/$$/_device_descriptor\[\];/' \
803 > tmp-hw.h
804 f=""; \
805 for i in $(HW_SRC) ; do \
806 case " $$f " in \
807 *" $$i "*) ;; \
808 *) f="$$f $$i" ;; \
809 esac ; \
810 done ; \
811 for hw in $$f ; do echo $$hw ; done \
812 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
813 -e 's/^/ /' \
814 -e 's/$$/_device_descriptor,/' \
815 > tmp-hw.c
ae451ac6
ILT
816 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.h hw.h
817 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.c hw.c
c906108c
SS
818 touch tmp-hw
819
6e9114ad
JB
820hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
821hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
822hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
c906108c 823hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
6e9114ad 824hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
c906108c 825hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
6e9114ad 826hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
c906108c
SS
827hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
828hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
829hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
830hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
54cfd411 831hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
6e9114ad
JB
832hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
833hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
c906108c 834hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
54cfd411 835hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
c906108c
SS
836# ignore this line, it stops make from getting confused
837
838
839
840# real packages
841tmp-pk: Makefile $(PACKAGE_SRC) $(srcdir)/../../move-if-change
842 # The first for loop is to remove duplicates.
843 f=""; \
844 for i in $(PACKAGE_SRC) ; do \
845 case " $$f " in \
846 *" $$i "*) ;; \
847 *) f="$$f $$i" ;; \
848 esac ; \
849 done ; \
850 for pk in $$f ; do echo $$pk ; done \
851 | sed -e 's/^.*pk_\(.*\)\.c/\1/' \
852 -e 's/^/extern package_create_instance_callback pk_/' \
853 -e 's/$$/_create_instance;/' \
854 > tmp-pk.h
ae451ac6 855 $(SHELL) $(srcdir)/../../move-if-change tmp-pk.h pk.h
c906108c
SS
856 touch tmp-pk
857
6e9114ad 858pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
c906108c
SS
859# ignore this line, it stops make from getting confused
860
861
862
863tags etags: TAGS
864
865TAGS: $(BUILT_SRC)
866 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
867
868clean mostlyclean:
869 rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG) gentmap
870
871distclean realclean: clean
872 rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
873
874maintainer-clean: distclean
875 rm -f *~ *.log ppc-config.h core *.core
876
877Makefile: Makefile.in config.status
878 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
879
880config.h: stamp-h ; @true
881stamp-h: config.in config.status
882 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
883
884config.status: configure
885 $(SHELL) ./config.status --recheck
886
887install: installdirs
888 n=`echo run | sed '$(program_transform_name)'`; \
5a645dc5 889 $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
c906108c
SS
890
891installdirs:
5a645dc5 892 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)