1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
|
#
# This file is part of the program psim.
#
# Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
default: all
VPATH = @srcdir@
srcdir = @srcdir@
srccom = $(srcdir)/../common
srcroot = $(srcdir)/../..
srcsim = $(srcdir)/..
include $(srcroot)/gdb/silent-rules.mk
# Helper code from gnulib.
GNULIB_PARENT_DIR = ../..
include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
# Settings from top-level configure.
include ../arch-subdir.mk
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
includedir = @includedir@
# This can be referenced by the gettext configuration code.
top_builddir = ..
SHELL = /bin/sh
BISON = bison
MAKEINFO = makeinfo
INLINE_CFLAGS = $(SIM_INLINE)
SMP_CFLAGS = @sim_smp@
XOR_ENDIAN_CFLAGS = @sim_xor_endian@
BITSIZE_CFLAGS = @sim_bitsize@
HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
TIMEBASE_CFLAGS = @sim_timebase@
FLOAT_CFLAGS = @sim_float@
MONITOR_CFLAGS = @sim_monitor@
MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
TERMIO_CFLAGS = @sim_termio@
SWITCH_CFLAGS = @sim_switch@
CONFIG_CFLAGS = \
$(SMP_CFLAGS) \
$(XOR_ENDIAN_CFLAGS) \
$(BITSIZE_CFLAGS) \
$(HOSTBITSIZE_CFLAGS) \
$(TIMEBASE_CFLAGS) \
$(FLOAT_CFLAGS) \
$(MONITOR_CFLAGS) \
$(MODEL_CFLAGS) \
$(TERMIO_CFLAGS) \
$(SWITCH_CFLAGS)
SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
STD_CFLAGS = $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(SIM_FPU_CFLAGS)
NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FPU_CFLAGS)
BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARN_CFLAGS)
LIBS = $(COMMON_LIBS) @LIBS@ $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
IGEN_OPCODE_RULES = @sim_opcode@
IGEN_DECODE_MECHANISM = @sim_decode_mechanism@
IGEN_DUPLICATE = @sim_dup@
IGEN_JUMP = @sim_jump@
IGEN_FILTER = @sim_filter@
IGEN_ICACHE = @sim_icache@
IGEN_SMP = @sim_igen_smp@
IGEN_LINE_NR = @sim_line_nr@
IGEN_FLAGS = \
$(IGEN_DECODE_MECHANISM) \
$(IGEN_DUPLICATE) \
$(IGEN_JUMP) \
$(IGEN_FILTER) \
$(IGEN_ICACHE) \
$(IGEN_SMP) \
$(IGEN_LINE_NR)
# igen leaks memory, and therefore makes AddressSanitizer unhappy. Disable
# leak detection while running it.
IGEN = ASAN_OPTIONS=detect_leaks=0 ./igen
.NOEXPORT:
MAKEOVERRIDES=
LIB_INCLUDES = -I$(srcdir)/../../include
BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config
INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) -I../..
LIBIBERTY_LIB = ../../libiberty/libiberty.a
BFD_LIB = ../../bfd/libbfd.la
TARGETLIB = libsim.a
all: main.o $(TARGETLIB) $(GDB_OBJ)
.c.o:
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
# Headers outside sim/ppc.
ANSIDECL_H = $(srcroot)/include/ansidecl.h
BFD_H = ../../bfd/bfd.h
GDB_CALLBACK_H = $(srcroot)/include/sim/callback.h
GDB_REMOTE_SIM_H = $(srcroot)/include/sim/sim.h
GDB_SIM_PPC_H = $(srcroot)/include/gdb/sim-ppc.h
COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
# Headers in sim/ppc.
ACCONFIG_H = \
acconfig.h
ALTIVEC_EXPRESSION_H = \
altivec_expression.h
ALTIVEC_REGISTERS_H = \
altivec_registers.h
BASICS_H = \
basics.h \
$(CONFIG_H) \
$(INLINE_H) \
$(SIM_CALLBACKS_H) \
$(DEBUG_H) \
$(WORDS_H) \
$(BITS_H) \
$(SIM_ENDIAN_H)
BITS_H = \
bits.h \
bits.c
CAP_H = \
cap.h \
$(BASICS_H)
COREFILE_H = \
corefile.h
COREFILE_N_H = \
corefile-n.h
CPU_H = \
cpu.h \
$(BASICS_H) \
$(REGISTERS_H) \
$(DEVICE_H) \
$(COREFILE_H) \
$(VM_H) \
$(EVENTS_H) \
$(INTERRUPTS_H) \
$(PSIM_H) \
$(IDECODE_H) \
$(ITABLE_H) \
$(OS_EMUL_H) \
$(MON_H) \
$(MODEL_H) \
cpu.c
DEBUG_H = \
debug.h \
$(FILTER_FILENAME_H)
DEVICE_H = \
device.h
DEVICE_TABLE_H = \
device_table.h \
$(BASICS_H) \
$(DEVICE_H) \
$(TREE_H) \
$(HW_H)
E500_EXPRESSION_H = \
e500_expression.h
E500_REGISTERS_H = \
e500_registers.h
EMUL_BUGAPI_H = \
emul_bugapi.h
EMUL_CHIRP_H = \
emul_chirp.h
EMUL_GENERIC_H = \
emul_generic.h \
$(CPU_H) \
$(IDECODE_H) \
$(OS_EMUL_H) \
$(TREE_H) \
$(BFD_H)
EMUL_NETBSD_H = \
emul_netbsd.h
EMUL_UNIX_H = \
emul_unix.h
EVENTS_H = \
events.h
FILTER_FILENAME_H = \
filter_filename.h
FILTER_H = \
filter.h
GEN_ICACHE_H = \
gen-icache.h
GEN_IDECODE_H = \
gen-idecode.h
GEN_ITABLE_H = \
gen-itable.h
GEN_MODEL_H = \
gen-model.h
GEN_SEMANTICS_H = \
gen-semantics.h
GEN_SUPPORT_H = \
gen-support.h
HW_CPU_H = \
hw_cpu.h
HW_PHB_H = \
hw_phb.h
IDECODE_BRANCH_H = \
idecode_branch.h
IDECODE_EXPRESSION_H = \
idecode_expression.h \
$(ALTIVEC_EXPRESSION_H) \
$(E500_EXPRESSION_H)
IDECODE_FIELDS_H = \
idecode_fields.h
IGEN_H = \
igen.h
INLINE_H = \
inline.h
INTERRUPTS_H = \
interrupts.h
LD_CACHE_H = \
ld-cache.h
LD_DECODE_H = \
ld-decode.h
LD_INSN_H = \
ld-insn.h
LF_H = \
lf.h
MISC_H = \
misc.h \
$(CONFIG_H) \
$(FILTER_FILENAME_H)
MON_H = \
mon.h \
$(BASICS_H) \
$(ITABLE_H)
OPTIONS_H = \
options.h
OS_EMUL_H = \
os_emul.h
PSIM_H = \
psim.h \
$(BASICS_H)
REGISTERS_H = \
registers.h \
$(E500_REGISTERS_H) \
$(ALTIVEC_REGISTERS_H) \
$(SPREG_H)
SIM_CALLBACKS_H = \
sim_callbacks.h
SIM_ENDIAN_H = \
sim-endian.h \
sim-endian.c
SIM_ENDIAN_N_H = \
sim-endian-n.h
SIM_MAIN_H = \
sim-main.h \
$(COMMON_SIM_BASICS_H) \
$(COMMON_SIM_SIGNAL_H) \
$(COMMON_SIM_BASE_H)
STD_CONFIG_H = \
std-config.h
TABLE_H = \
table.h
TREE_H = \
tree.h
VM_H = \
vm.h
VM_N_H = \
vm_n.h
WORDS_H = \
words.h
# Generated headers.
CONFIG_H = \
config.h
DEFINES_H = \
defines.h
HW_H = \
hw.h
ICACHE_H = \
icache.h
IDECODE_H = \
idecode.h \
$(IDECODE_EXPRESSION_H) \
$(IDECODE_FIELDS_H) \
$(IDECODE_BRANCH_H)
ITABLE_H = \
itable.h
MODEL_H = \
model.h
PK_H = \
pk.h
SEMANTICS_H = \
semantics.h
SPREG_H = \
spreg.h
SUPPORT_H = \
support.h \
support.c
INLINE = \
inline.h \
inline.c
BUILT_SRC_WO_CONFIG = \
icache.h icache.c \
support.h support.c \
idecode.h idecode.c \
semantics.h semantics.c \
itable.h itable.c \
model.h model.c \
support.h support.c \
pk.h \
hw.h hw.c \
filter_host.c
BUILT_SRC = \
$(BUILT_SRC_WO_CONFIG) \
config.h
LIB_INLINE_SRC = \
psim.c \
bits.c \
debug.c \
sim-endian.c \
sim-endian.h \
sim-endian-n.h \
vm.c \
vm_n.h \
corefile.c \
events.c \
os_emul.c \
registers.c \
cpu.c \
interrupts.c \
device.c \
tree.c \
device_table.c \
cap.c \
mon.c \
options.c
LIB_SRC = \
$(PACKAGE_SRC) \
$(HW_SRC) \
$(LIB_INLINE_SRC)
MAIN_SRC = \
main.c \
gdb-sim.c \
sim_calls.c
COMMON_OBJS_NAMES = \
callback.o \
target-newlib-errno.o \
target-newlib-open.o \
target-newlib-signal.o \
target-newlib-syscall.o \
version.o
COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/%)
# NOTE: semantics, idecode and psim put last so smaller files are compiled
# first
LIB_OBJ = \
debug.o \
filter_filename.o \
bits.o \
sim-endian.o \
os_emul.o \
emul_generic.o \
emul_bugapi.o \
emul_chirp.o \
emul_netbsd.o \
emul_unix.o \
registers.o \
vm.o \
corefile.o \
model.o \
spreg.o \
cpu.o \
interrupts.o \
events.o \
cap.o \
device.o \
tree.o \
device_table.o \
itable.o \
mon.o \
icache.o \
semantics.o \
idecode.o \
support.o \
sim-fpu.o \
psim.o \
$(COMMON_OBJS) \
$(PACKAGE_OBJ) \
$(HW_OBJ) \
options.o
GDB_OBJ = gdb-sim.o sim_calls.o
HW_SRC = @sim_hw_src@
HW_OBJ = @sim_hw_obj@
PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
$(TARGETLIB): tmp-igen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
bits.o: bits.c $(BASICS_H)
debug.o: debug.c $(CONFIG_H) $(BASICS_H)
filter_filename.o: filter_filename.c $(CONFIG_H) $(FILTER_FILENAME_H)
sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
os_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)
emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
# Given that inlines are turned on now, rebuild idecode whenever
# anything changes.
idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
# double.o: double.c dp-bit.c
vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
model.o: model.c $(CPU_H) $(MON_H)
events.o: events.c $(BASICS_H) $(EVENTS_H)
sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H) $(GDB_SIM_PPC_H) $(SIM_CALLBACK_H)
spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
cap.o: cap.c $(CAP_H)
semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
itable.o: itable.c $(ITABLE_H)
mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H)
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
# Rebuild options whenever something changes so the date/time is up to date.
options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' $(srcdir)/options.c
defines.h: tmp-defines; @true
tmp-defines: config.h Makefile
$(ECHO_GEN) sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-defines.h defines.h
$(SILENCE) touch $@
#
# Rules to create the built c source code files
#
tmp-igen: igen $(srcdir)/powerpc.igen $(srcdir)/altivec.igen $(srcdir)/e500.igen $(IGEN_OPCODE_RULES) $(srcroot)/move-if-change
$(ECHO_GEN) $(IGEN) $(IGEN_FLAGS) \
-o $(srcdir)/$(IGEN_OPCODE_RULES) \
-I $(srcdir) -i $(srcdir)/powerpc.igen \
-n icache.h -hc tmp-icache.h \
-n icache.c -c tmp-icache.c \
-n semantics.h -hs tmp-semantics.h \
-n semantics.c -s tmp-semantics.c \
-n idecode.h -hd tmp-idecode.h \
-n idecode.c -d tmp-idecode.c \
-n itable.h -ht tmp-itable.h \
-n itable.c -t tmp-itable.c \
-n model.h -hm tmp-model.h \
-n model.c -m tmp-model.c \
-n support.h -hf tmp-support.h \
-n support.c -f tmp-support.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.h icache.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-icache.c icache.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.h idecode.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-idecode.c idecode.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.h semantics.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-semantics.c semantics.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.h itable.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-itable.c itable.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.h model.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-model.c model.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.h support.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-support.c support.c
$(SILENCE) touch $@
# NOTE: Some versions of make don't handle files created as side-effects
# uncomment the below if that is the case.
$(TARGETLIB): tmp-igen
itable.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
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
$(ECHO_CCLD) $(LINK_FOR_BUILD) 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
filter_host.c: filter_filename.c
$(ECHO_GEN) cat $(srcdir)/filter_filename.c > filter_host.c
filter_host.o: filter_host.c $(CONFIG_H) $(FILTER_FILENAME_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c filter_host.c
table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/table.c
lf.o: lf.c $(CONFIG_H) $(MISC_H) $(LF_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/lf.c
filter.o: filter.c $(CONFIG_H) $(MISC_H) $(FILTER_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/filter.c
tmp-filter: filter.c $(MISC_H) misc.o
$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/filter.c misc.o
ld-decode.o: ld-decode.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_DECODE_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-decode.c
tmp-ld-decode: ld-decode.c misc.o lf.o table.o filter_host.o
$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o
ld-cache.o: ld-cache.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_CACHE_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-cache.c
tmp-ld-cache: ld-cache.c misc.o lf.o table.o filter_host.o
$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o
ld-insn.o: ld-insn.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/ld-insn.c
tmp-ld-insn: ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
$(ECHO_CCLD) $(LINK_FOR_BUILD) -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-model.c
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-itable.c
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-icache.c
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-semantics.c
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-idecode.c
gen-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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/gen-support.c
igen.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)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/igen.c
misc.o: misc.c $(CONFIG_H) $(MISC_H)
$(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/misc.c
# real hardware
hw.c hw.h: tmp-hw; @true
tmp-hw: Makefile $(HW_SRC) $(srcroot)/move-if-change
$(ECHO_GEN)# The first for loop is to remove duplicates.
$(SILENCE) f=""; \
for i in $(HW_SRC) ; do \
case " $$f " in \
*" $$i "*) ;; \
*) f="$$f $$i" ;; \
esac ; \
done ; \
for hw in $$f ; do echo $$hw ; done \
| sed -e 's/^.*\(hw_.*\)\.c/\1/' \
-e 's/^/extern const device_descriptor /' \
-e 's/$$/_device_descriptor\[\];/' \
> tmp-hw.h
$(SILENCE) f=""; \
for i in $(HW_SRC) ; do \
case " $$f " in \
*" $$i "*) ;; \
*) f="$$f $$i" ;; \
esac ; \
done ; \
for hw in $$f ; do echo $$hw ; done \
| sed -e 's/^.*\(hw_.*\)\.c/\1/' \
-e 's/^/ /' \
-e 's/$$/_device_descriptor,/' \
> tmp-hw.c
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.h hw.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-hw.c hw.c
$(SILENCE) touch $@
hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
hw_com.o: hw_com.c $(DEVICE_TABLE_H)
hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
hw_eeprom.o: hw_eeprom.c $(DEVICE_TABLE_H)
hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
hw_sem.o: hw_sem.c $(DEVICE_TABLE_H) $(PSIM_H)
hw_shm.o: hw_shm.c $(DEVICE_TABLE_H) $(PSIM_H)
hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
# ignore this line, it stops make from getting confused
# real packages
$(srcdir)/pk.h: $(MAINT) tmp-pk
@true
tmp-pk: $(srcdir)/Makefile.in $(PACKAGE_SRC) $(srcroot)/move-if-change
$(ECHO_GEN)# The first for loop is to remove duplicates.
$(SILENCE) echo "/* Generated file by Makefile.in; do not edit. */" > tmp-pk.h; \
f=""; \
for i in $(PACKAGE_SRC) ; do \
case " $$f " in \
*" $$i "*) ;; \
*) f="$$f $$i" ;; \
esac ; \
done ; \
for pk in $$f ; do echo $$pk ; done \
| sed -e 's/^.*pk_\(.*\)\.c/\1/' \
-e 's/^/extern package_create_instance_callback pk_/' \
-e 's/$$/_create_instance;/' \
>> tmp-pk.h
$(SILENCE) $(SHELL) $(srcroot)/move-if-change tmp-pk.h $(srcdir)/pk.h
$(SILENCE) touch $@
pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
# ignore this line, it stops make from getting confused
tags etags: TAGS
TAGS: $(BUILT_SRC)
etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
clean mostlyclean:
rm -f tmp-* *.[oasi] core igen $(BUILT_SRC_WO_CONFIG)
distclean realclean: clean
rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
maintainer-clean: distclean
rm -f *~ *.log core *.core
Makefile: Makefile.in config.status
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
config.h: stamp-h ; @true
stamp-h: config.in config.status
CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
config.status: configure
$(SHELL) ./config.status --recheck
check:
html:
clean-html:
install-html:
info:
clean-info:
install-info:
pdf:
clean-pdf:
install-pdf:
install:
installdirs:
uninstall:
|