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