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