daily update
[deliverable/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
20e95c23
DJ
158LIBINTL = @LIBINTL@
159LIBINTL_DEP = @LIBINTL_DEP@
160INTL_CFLAGS = @INCINTL@
bf1024d6 161
c906108c
SS
162
163TARGETLIB = libsim.a
164
165all: run $(TARGETLIB) $(GDB_OBJ)
166
167.c.o:
168 $(CC) -c $(STD_CFLAGS) $<
169
170
6e9114ad
JB
171# Headers outside sim/ppc.
172ANSIDECL_H = $(srcroot)/include/ansidecl.h
173BFD_H = ../../bfd/bfd.h
6e9114ad
JB
174GDB_CALLBACK_H = $(srcroot)/include/gdb/callback.h
175GDB_REMOTE_SIM_H = $(srcroot)/include/gdb/remote-sim.h
91cd1042 176GDB_SIM_PPC_H = $(srcroot)/include/gdb/sim-ppc.h
6e9114ad
JB
177COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
178COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
179COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
180COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
181COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
182
183# Headers in sim/ppc.
184ACCONFIG_H = \
185 acconfig.h
186
187ALTIVEC_EXPRESSION_H = \
188 altivec_expression.h
189
190ALTIVEC_REGISTERS_H = \
191 altivec_registers.h
c906108c
SS
192
193BASICS_H = \
194 basics.h \
6e9114ad
JB
195 $(CONFIG_H) \
196 $(PPC_CONFIG_H) \
197 $(INLINE_H) \
198 $(SIM_CALLBACKS_H) \
199 $(DEBUG_H) \
200 $(WORDS_H) \
201 $(BITS_H) \
202 $(SIM_ENDIAN_H)
203
204BITS_H = \
c906108c 205 bits.h \
6e9114ad 206 bits.c
c906108c 207
6e9114ad
JB
208CAP_H = \
209 cap.h \
c906108c
SS
210 $(BASICS_H)
211
6e9114ad
JB
212COREFILE_H = \
213 corefile.h
c906108c 214
6e9114ad
JB
215COREFILE_N_H = \
216 corefile-n.h
c906108c
SS
217
218CPU_H = \
219 cpu.h \
220 $(BASICS_H) \
221 $(REGISTERS_H) \
6e9114ad
JB
222 $(DEVICE_H) \
223 $(COREFILE_H) \
224 $(VM_H) \
225 $(EVENTS_H) \
226 $(INTERRUPTS_H) \
227 $(PSIM_H) \
c906108c 228 $(IDECODE_H) \
6e9114ad
JB
229 $(ITABLE_H) \
230 $(OS_EMUL_H) \
231 $(MON_H) \
232 $(MODEL_H) \
233 cpu.c
234
235DEBUG_H = \
236 debug.h \
237 $(FILTER_FILENAME_H)
238
239DEVICE_H = \
240 device.h
c906108c
SS
241
242DEVICE_TABLE_H = \
c906108c 243 device_table.h \
6e9114ad
JB
244 $(BASICS_H) \
245 $(DEVICE_H) \
246 $(TREE_H) \
247 $(HW_H)
248
249E500_EXPRESSION_H = \
250 e500_expression.h
251
252E500_REGISTERS_H = \
253 e500_registers.h
254
255EMUL_BUGAPI_H = \
256 emul_bugapi.h
257
258EMUL_CHIRP_H = \
259 emul_chirp.h
c906108c
SS
260
261EMUL_GENERIC_H = \
6e9114ad 262 emul_generic.h \
c906108c
SS
263 $(CPU_H) \
264 $(IDECODE_H) \
6e9114ad
JB
265 $(OS_EMUL_H) \
266 $(TREE_H) \
267 $(BFD_H)
268
269EMUL_NETBSD_H = \
270 emul_netbsd.h
271
272EMUL_UNIX_H = \
273 emul_unix.h
274
275EVENTS_H = \
276 events.h
277
278FILTER_FILENAME_H = \
279 filter_filename.h
280
281FILTER_H = \
282 filter.h
283
284GEN_ICACHE_H = \
285 gen-icache.h
286
287GEN_IDECODE_H = \
288 gen-idecode.h
289
290GEN_ITABLE_H = \
291 gen-itable.h
292
293GEN_MODEL_H = \
294 gen-model.h
295
296GEN_SEMANTICS_H = \
297 gen-semantics.h
298
299GEN_SUPPORT_H = \
300 gen-support.h
301
302HW_CPU_H = \
303 hw_cpu.h
304
305HW_PHB_H = \
306 hw_phb.h
307
308IDECODE_BRANCH_H = \
309 idecode_branch.h
310
311IDECODE_EXPRESSION_H = \
312 idecode_expression.h \
313 $(ALTIVEC_EXPRESSION_H) \
314 $(E500_EXPRESSION_H)
315
316IDECODE_FIELDS_H = \
317 idecode_fields.h
318
319IGEN_H = \
320 igen.h
321
322INLINE_H = \
323 inline.h
324
325INTERRUPTS_H = \
326 interrupts.h
327
328LD_CACHE_H = \
329 ld-cache.h
330
331LD_DECODE_H = \
332 ld-decode.h
333
334LD_INSN_H = \
335 ld-insn.h
336
337LF_H = \
338 lf.h
339
340MISC_H = \
341 misc.h \
342 $(CONFIG_H) \
343 $(FILTER_FILENAME_H)
344
345MON_H = \
346 mon.h \
347 $(BASICS_H) \
348 $(ITABLE_H)
349
350OPTIONS_H = \
351 options.h
352
353OS_EMUL_H = \
c906108c
SS
354 os_emul.h
355
6e9114ad
JB
356PSIM_H = \
357 psim.h \
358 $(BASICS_H)
359
360REGISTERS_H = \
361 registers.h \
362 $(E500_REGISTERS_H) \
363 $(ALTIVEC_REGISTERS_H) \
364 $(SPREG_H)
365
366SIM_CALLBACKS_H = \
367 sim_callbacks.h
368
369SIM_ENDIAN_H = \
370 sim-endian.h \
371 sim-endian.c
372
373SIM_ENDIAN_N_H = \
374 sim-endian-n.h
375
376SIM_MAIN_H = \
377 sim-main.h \
378 $(COMMON_SIM_BASICS_H) \
379 $(COMMON_SIM_SIGNAL_H) \
380 $(COMMON_SIM_BASE_H)
381
382STD_CONFIG_H = \
383 std-config.h
384
385TABLE_H = \
386 table.h
387
388TREE_H = \
389 tree.h
390
391VM_H = \
392 vm.h
393
394VM_N_H = \
395 vm_n.h
396
397WORDS_H = \
398 words.h
399
400
401# Generated headers.
402CONFIG_H = \
403 config.h
404
405DEFINES_H = \
406 defines.h
407
408HW_H = \
409 hw.h
410
411ICACHE_H = \
412 icache.h
413
414IDECODE_H = \
415 idecode.h \
416 $(IDECODE_EXPRESSION_H) \
417 $(IDECODE_FIELDS_H) \
418 $(IDECODE_BRANCH_H)
419
420ITABLE_H = \
421 itable.h
422
423MODEL_H = \
424 model.h
425
426PK_H = \
427 pk.h
428
429PPC_CONFIG_H = \
430 ppc-config.h
431
432SEMANTICS_H = \
433 semantics.h
434
435SPREG_H = \
436 spreg.h
437
438SUPPORT_H = \
439 support.h \
440 support.c
441
442TARG_VALS_H = \
443 targ-vals.h
444
445TCONFIG_H = \
446 tconfig.h
c906108c
SS
447
448INLINE = \
449 inline.h \
450 inline.c
451
452BUILT_SRC_WO_CONFIG = \
453 icache.h icache.c \
454 support.h support.c \
455 idecode.h idecode.c \
456 semantics.h semantics.c \
457 itable.h itable.c \
458 spreg.h spreg.c \
459 model.h model.c \
460 support.h support.c \
461 pk.h \
462 hw.h hw.c \
463 filter_host.c \
464 @sim_targ_vals@
465
466BUILT_SRC = \
467 $(BUILT_SRC_WO_CONFIG) \
468 config.h \
469 ppc-config.h
470
471LIB_INLINE_SRC = \
472 psim.c \
473 bits.c \
474 debug.c \
475 sim-endian.c \
476 sim-endian.h \
477 sim-endian-n.h \
478 vm.c \
479 vm_n.h \
480 corefile.c \
481 events.c \
482 os_emul.c \
483 registers.c \
484 cpu.c \
485 interrupts.c \
486 device.c \
487 tree.c \
488 device_table.c \
489 cap.c \
490 mon.c \
491 options.c
492
493LIB_SRC = \
494 $(PACKAGE_SRC) \
495 $(HW_SRC) \
496 $(LIB_INLINE_SRC)
497
498MAIN_SRC = \
499 main.c \
91cd1042 500 gdb-sim.c \
c906108c
SS
501 sim_calls.c
502
503
504# NOTE: semantics, idecode and psim put last so smaller files are compiled
505# first
506LIB_OBJ = \
507 debug.o \
508 filter_filename.o \
509 bits.o \
510 sim-endian.o \
511 os_emul.o \
512 emul_generic.o \
513 emul_bugapi.o \
514 emul_chirp.o \
515 emul_netbsd.o \
516 emul_unix.o \
517 registers.o \
518 vm.o \
519 corefile.o \
520 model.o \
521 spreg.o \
522 cpu.o \
523 interrupts.o \
524 events.o \
525 cap.o \
526 device.o \
527 tree.o \
528 device_table.o \
529 itable.o \
530 mon.o \
531 icache.o \
532 semantics.o \
533 idecode.o \
534 support.o \
d29d5195 535 @sim_fpu@ \
c906108c
SS
536 psim.o \
537 $(PACKAGE_OBJ) \
538 $(HW_OBJ) \
539 options.o
540
541
91cd1042 542GDB_OBJ = gdb-sim.o sim_calls.o @sim_callback@
c906108c
SS
543
544HW_SRC = @sim_hw_src@
545HW_OBJ = @sim_hw_obj@
546
547PACKAGE_SRC = @sim_pk_src@
548PACKAGE_OBJ = @sim_pk_obj@
549
550
20e95c23
DJ
551psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
552 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
c906108c
SS
553
554run: psim
555 rm -f run$(EXEEXT)
556 ln psim$(EXEEXT) run$(EXEEXT)
557
558$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
559 rm -f $(TARGETLIB)
560 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
561 $(RANLIB) $(TARGETLIB)
562
6e9114ad 563psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
c906108c
SS
564
565bits.o: bits.c $(BASICS_H)
566
6e9114ad
JB
567debug.o: debug.c $(CONFIG_H) $(BASICS_H)
568filter_filename.o: filter_filename.c $(CONFIG_H) $(PPC_CONFIG_H) $(FILTER_FILENAME_H)
c906108c 569
6e9114ad 570sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
c906108c 571
6e9114ad 572os_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
573emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
574
6e9114ad
JB
575emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
576emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
577emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
578emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
c906108c 579
6e9114ad 580registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
c906108c
SS
581
582cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
583
6e9114ad 584interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
c906108c
SS
585
586# Given that inlines are turned on now, rebuild idecode whenever
587# anything changes.
6e9114ad 588idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
c906108c
SS
589
590# double.o: double.c dp-bit.c
591
6e9114ad 592vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
c906108c 593
6e9114ad 594corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
c906108c 595
6e9114ad 596model.o: model.c $(CPU_H) $(MON_H)
c906108c 597
6e9114ad 598events.o: events.c $(BASICS_H) $(EVENTS_H)
c906108c 599
f37b123d 600sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
c906108c 601
91cd1042
AC
602gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H) $(GDB_SIM_PPC_H) $(SIM_CALLBACK_H)
603
6e9114ad 604spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
c906108c 605
6e9114ad 606main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
c906108c 607
6e9114ad 608device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
c906108c 609
6e9114ad 610tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
c906108c 611
6e9114ad 612device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
c906108c 613
6e9114ad 614cap.o: cap.c $(CAP_H)
c906108c 615
6e9114ad 616semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 617
6e9114ad 618icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 619
6e9114ad 620support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
c906108c 621
6e9114ad 622itable.o: itable.c $(ITABLE_H)
c906108c 623
6e9114ad 624mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
c906108c
SS
625
626# GDB after 4.16 expects the default_callback structure to be setup.
627# As a kludge, build the common stuff here for now.
628gentmap: ../common/gentmap.c Makefile targ-vals.def
4b164edf 629 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -I. -I../common -I$(srcdir)/../common -o gentmap $< $(BUILD_LIBS)
c906108c
SS
630
631targ-vals.def: $(srcdir)/../common/nltvals.def
632 rm -f targ-vals.def tmp-def
633 cat $(srcdir)/../common/nltvals.def > tmp-vals.def
ae451ac6 634 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def
c906108c
SS
635
636targ-vals.h: Makefile gentmap $(srcdir)/../../move-if-change
637 rm -f tmp-vals.h
638 ./gentmap -h > tmp-vals.h
ae451ac6 639 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h
c906108c
SS
640
641targ-map.c: Makefile gentmap $(srcdir)/../../move-if-change
642 rm -f tmp-map.c
643 ./gentmap -c > tmp-map.c
ae451ac6 644 $(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c
c906108c 645
6e9114ad 646callback.o: ../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
c906108c
SS
647 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $<
648
6e9114ad 649targ-map.o: targ-map.c $(ANSIDECL_H) $(GDB_CALLBACK_H) $(TARG_VALS_H)
c906108c 650
6e9114ad 651sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H) $(TCONFIG_H)
d29d5195
MG
652 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
653
d29d5195
MG
654tconfig.h:
655 rm -f tconfig.h
656 echo > tconfig.h
657
c906108c 658# Rebuild options whenever something changes so the date/time is up to date.
6e9114ad 659options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
c906108c
SS
660 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
661
99b57276 662defines.h: tmp-defines; @true
c906108c
SS
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 746 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-decode.c
d8006e05 747tmp-ld-decode: ld-decode.c misc.o lf.o table.o filter_host.o
c906108c
SS
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 751 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-cache.c
d8006e05 752tmp-ld-cache: ld-cache.c misc.o lf.o table.o filter_host.o
c906108c
SS
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 756 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-insn.c
d8006e05 757tmp-ld-insn: ld-insn.c ld-cache.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
99b57276 790hw.c hw.h: tmp-hw; @true
c906108c
SS
791tmp-hw: Makefile $(HW_SRC) $(srcdir)/../../move-if-change
792 # The first for loop is to remove duplicates.
793 f=""; \
794 for i in $(HW_SRC) ; do \
795 case " $$f " in \
796 *" $$i "*) ;; \
797 *) f="$$f $$i" ;; \
798 esac ; \
799 done ; \
800 for hw in $$f ; do echo $$hw ; done \
801 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
802 -e 's/^/extern const device_descriptor /' \
803 -e 's/$$/_device_descriptor\[\];/' \
804 > tmp-hw.h
805 f=""; \
806 for i in $(HW_SRC) ; do \
807 case " $$f " in \
808 *" $$i "*) ;; \
809 *) f="$$f $$i" ;; \
810 esac ; \
811 done ; \
812 for hw in $$f ; do echo $$hw ; done \
813 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
814 -e 's/^/ /' \
815 -e 's/$$/_device_descriptor,/' \
816 > tmp-hw.c
ae451ac6
ILT
817 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.h hw.h
818 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.c hw.c
c906108c
SS
819 touch tmp-hw
820
6e9114ad 821hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
38edcf8a 822hw_com.o: hw_com.c $(DEVICE_TABLE_H)
6e9114ad
JB
823hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
824hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
38edcf8a 825hw_eeprom.o: hw_eeprom.c $(DEVICE_TABLE_H)
c906108c 826hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
6e9114ad 827hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
c906108c 828hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
6e9114ad 829hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
c906108c
SS
830hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
831hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
832hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
833hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
54cfd411 834hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
6e9114ad
JB
835hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
836hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
c906108c 837hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
54cfd411 838hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
c906108c
SS
839# ignore this line, it stops make from getting confused
840
841
842
843# real packages
99b57276 844pk.h: tmp-pk; @true
c906108c
SS
845tmp-pk: Makefile $(PACKAGE_SRC) $(srcdir)/../../move-if-change
846 # The first for loop is to remove duplicates.
847 f=""; \
848 for i in $(PACKAGE_SRC) ; do \
849 case " $$f " in \
850 *" $$i "*) ;; \
851 *) f="$$f $$i" ;; \
852 esac ; \
853 done ; \
854 for pk in $$f ; do echo $$pk ; done \
855 | sed -e 's/^.*pk_\(.*\)\.c/\1/' \
856 -e 's/^/extern package_create_instance_callback pk_/' \
857 -e 's/$$/_create_instance;/' \
858 > tmp-pk.h
ae451ac6 859 $(SHELL) $(srcdir)/../../move-if-change tmp-pk.h pk.h
c906108c
SS
860 touch tmp-pk
861
6e9114ad 862pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
c906108c
SS
863# ignore this line, it stops make from getting confused
864
865
866
867tags etags: TAGS
868
869TAGS: $(BUILT_SRC)
870 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
871
872clean mostlyclean:
873 rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG) gentmap
874
875distclean realclean: clean
876 rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
877
878maintainer-clean: distclean
879 rm -f *~ *.log ppc-config.h core *.core
880
881Makefile: Makefile.in config.status
882 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
883
884config.h: stamp-h ; @true
885stamp-h: config.in config.status
886 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
887
888config.status: configure
889 $(SHELL) ./config.status --recheck
890
891install: installdirs
892 n=`echo run | sed '$(program_transform_name)'`; \
5a645dc5 893 $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
c906108c
SS
894
895installdirs:
5a645dc5 896 $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)
This page took 0.398465 seconds and 4 git commands to generate.