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