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