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