merge from gcc
[deliverable/binutils-gdb.git] / sim / ppc / Makefile.in
CommitLineData
c906108c
SS
1#
2# This file is part of the program psim.
3#
8d64d0fd 4# Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
c906108c
SS
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19#
20
21default: all
22
23VPATH = @srcdir@
24srcdir = @srcdir@
25srcroot = $(srcdir)/../..
26
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29
30host_alias = @host_alias@
31target_alias = @target_alias@
32program_transform_name = @program_transform_name@
33bindir = @bindir@
34libdir = @libdir@
35tooldir = $(libdir)/$(target_alias)
36
37datadir = @datadir@
38mandir = @mandir@
39man1dir = $(mandir)/man1
40man2dir = $(mandir)/man2
41man3dir = $(mandir)/man3
42man4dir = $(mandir)/man4
43man5dir = $(mandir)/man5
44man6dir = $(mandir)/man6
45man7dir = $(mandir)/man7
46man8dir = $(mandir)/man8
47man9dir = $(mandir)/man9
48infodir = @infodir@
49includedir = @includedir@
50
51# This can be referenced by the gettext configuration code.
52top_builddir = ..
53
54EXEEXT = @EXEEXT@
55SHELL = /bin/sh
56
57INSTALL = @INSTALL@
58INSTALL_PROGRAM = @INSTALL_PROGRAM@
59INSTALL_DATA = @INSTALL_DATA@
60
61AR = @AR@
62AR_FLAGS = rc
63CC = @CC@
64CFLAGS = @CFLAGS@
65CC_FOR_BUILD = @CC_FOR_BUILD@
66BISON = bison
67MAKEINFO = makeinfo
68RANLIB = @RANLIB@
69
70SIM_CFLAGS = @sim_cflags@
71INLINE_CFLAGS = @sim_inline@
72BSWAP_CFLAGS = @sim_bswap@
73ENDIAN_CFLAGS = @sim_endian@
74REGPARM_CFLAGS = @sim_regparm@
75STDCALL_CFLAGS = @sim_stdcall@
76HOSTENDIAN_CFLAGS = @sim_hostendian@
77SMP_CFLAGS = @sim_smp@
78XOR_ENDIAN_CFLAGS = @sim_xor_endian@
79BITSIZE_CFLAGS = @sim_bitsize@
80HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
81ENV_CFLAGS = @sim_env@
82TIMEBASE_CFLAGS = @sim_timebase@
83ALIGNMENT_CFLAGS = @sim_alignment@
84FLOAT_CFLAGS = @sim_float@
85TRACE_CFLAGS = @sim_trace@
86ASSERT_CFLAGS = @sim_assert@
87RESERVED_CFLAGS = @sim_reserved@
88MONITOR_CFLAGS = @sim_monitor@
89MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
90STDIO_CFLAGS = @sim_stdio@
91TERMIO_CFLAGS = @sim_termio@
92WARNING_CFLAGS = @sim_warnings@
93DEVZERO_CFLAGS = @sim_devzero@
94CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
95 $(ENDIAN_CFLAGS) \
96 $(REGPARM_CFLAGS) \
97 $(STDCALL_CFLAGS) \
98 $(HOSTENDIAN_CFLAGS) \
99 $(SMP_CFLAGS) \
100 $(XOR_ENDIAN_CFLAGS) \
101 $(BITSIZE_CFLAGS) \
102 $(HOSTBITSIZE_CFLAGS) \
103 $(ENV_CFLAGS) \
104 $(TIMEBASE_CFLAGS) \
105 $(ALIGNMENT_CFLAGS) \
106 $(FLOAT_CFLAGS) \
107 $(TRACE_CFLAGS) \
108 $(ASSERT_CFLAGS) \
109 $(RESERVED_CFLAGS) \
110 $(MONITOR_CFLAGS) \
111 $(MODEL_CFLAGS) \
112 $(STDIO_CFLAGS) \
113 $(TERMIO_CFLAGS) \
114 $(DEVZERO_CFLAGS)
8d64d0fd 115SIM_FPU_CFLAGS = @sim_fpu_cflags@
c906108c 116
8d64d0fd
AC
117STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
118NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(SIM_FPU_CFLAGS)
c906108c
SS
119BUILD_CFLAGS = -g -O $(INCLUDES) $(WARNING_CFLAGS)
120
121BUILD_LDFLAGS =
122
123CONFIG_FILE = @sim_config@
124IGEN_OPCODE_RULES = @sim_opcode@
125IGEN_DECODE_MECHANISM = @sim_decode_mechanism@
126IGEN_DUPLICATE = @sim_dup@
127IGEN_JUMP = @sim_jump@
128IGEN_FILTER = @sim_filter@
129IGEN_ICACHE = @sim_icache@
130IGEN_SMP = @sim_igen_smp@
131IGEN_LINE_NR = @sim_line_nr@
132DGEN_FLAGS = @sim_switch@
133
134HDEFINES = @HDEFINES@
135TDEFINES =
136IGEN_FLAGS = \
137 $(IGEN_DECODE_MECHANISM) \
138 $(IGEN_DUPLICATE) \
139 $(IGEN_JUMP) \
140 $(IGEN_FILTER) \
141 $(IGEN_ICACHE) \
142 $(IGEN_SMP) \
143 $(IGEN_LINE_NR)
144
145.NOEXPORT:
146MAKEOVERRIDES=
147
148LIB_INCLUDES = -I$(srcdir)/../../include
149BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
150GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
8d64d0fd 151
c906108c
SS
152INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
153
154LIBIBERTY_LIB = ../../libiberty/libiberty.a
155BFD_LIB = ../../bfd/libbfd.a
156
157INTLLIBS = @INTLLIBS@
158INTLDEPS = @INTLDEPS@
bf1024d6
AC
159INTL_DIR = ../../intl
160INTL_SRC = $(srcdir)/$(INTL_DIR)
161INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC)
162
c906108c
SS
163
164TARGETLIB = libsim.a
165
166all: run $(TARGETLIB) $(GDB_OBJ)
167
168.c.o:
169 $(CC) -c $(STD_CFLAGS) $<
170
171
172
173BASICS_H = \
174 basics.h \
175 config.h \
176 ppc-config.h \
177 inline.h \
178 sim_callbacks.h \
179 debug.h filter_filename.h \
180 words.h \
181 bits.h \
182 sim-endian.h
183
184PSIM_H = \
185 psim.h \
186 $(BASICS_H)
187
188IDECODE_H = \
189 idecode.h \
190 idecode_expression.h \
191 idecode_branch.h \
192 idecode_fields.h \
193 icache.h
194
195REGISTERS_H = \
196 registers.h \
197 spreg.h
198
199CPU_H = \
200 cpu.h \
201 $(BASICS_H) \
202 $(REGISTERS_H) \
203 $(IDECODE_H) \
204 device.h \
205 corefile.h \
206 vm.h \
207 events.h \
208 interrupts.h \
209 psim.h \
210 itable.h \
211 mon.h \
212 model.h
213
214DEVICE_TABLE_H = \
215 $(BASICS_H) \
216 device_table.h \
217 device.h \
218 tree.h \
219 hw.h
220
221EMUL_GENERIC_H = \
222 $(CPU_H) \
223 $(IDECODE_H) \
224 emul_generic.h \
225 tree.h \
226 os_emul.h
227
228
229INLINE = \
230 inline.h \
231 inline.c
232
233BUILT_SRC_WO_CONFIG = \
234 icache.h icache.c \
235 support.h support.c \
236 idecode.h idecode.c \
237 semantics.h semantics.c \
238 itable.h itable.c \
239 spreg.h spreg.c \
240 model.h model.c \
241 support.h support.c \
242 pk.h \
243 hw.h hw.c \
244 filter_host.c \
245 @sim_targ_vals@
246
247BUILT_SRC = \
248 $(BUILT_SRC_WO_CONFIG) \
249 config.h \
250 ppc-config.h
251
252LIB_INLINE_SRC = \
253 psim.c \
254 bits.c \
255 debug.c \
256 sim-endian.c \
257 sim-endian.h \
258 sim-endian-n.h \
259 vm.c \
260 vm_n.h \
261 corefile.c \
262 events.c \
263 os_emul.c \
264 registers.c \
265 cpu.c \
266 interrupts.c \
267 device.c \
268 tree.c \
269 device_table.c \
270 cap.c \
271 mon.c \
272 options.c
273
274LIB_SRC = \
275 $(PACKAGE_SRC) \
276 $(HW_SRC) \
277 $(LIB_INLINE_SRC)
278
279MAIN_SRC = \
280 main.c \
281 sim_calls.c
282
283
284# NOTE: semantics, idecode and psim put last so smaller files are compiled
285# first
286LIB_OBJ = \
287 debug.o \
288 filter_filename.o \
289 bits.o \
290 sim-endian.o \
291 os_emul.o \
292 emul_generic.o \
293 emul_bugapi.o \
294 emul_chirp.o \
295 emul_netbsd.o \
296 emul_unix.o \
297 registers.o \
298 vm.o \
299 corefile.o \
300 model.o \
301 spreg.o \
302 cpu.o \
303 interrupts.o \
304 events.o \
305 cap.o \
306 device.o \
307 tree.o \
308 device_table.o \
309 itable.o \
310 mon.o \
311 icache.o \
312 semantics.o \
313 idecode.o \
314 support.o \
d29d5195 315 @sim_fpu@ \
c906108c
SS
316 psim.o \
317 $(PACKAGE_OBJ) \
318 $(HW_OBJ) \
319 options.o
320
321
322GDB_OBJ = sim_calls.o @sim_callback@
323
324HW_SRC = @sim_hw_src@
325HW_OBJ = @sim_hw_obj@
326
327PACKAGE_SRC = @sim_pk_src@
328PACKAGE_OBJ = @sim_pk_obj@
329
330
331psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(INTLDEPS)
332 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(INTLLIBS) $(LIBIBERTY_LIB) $(LIBS)
333
334run: psim
335 rm -f run$(EXEEXT)
336 ln psim$(EXEEXT) run$(EXEEXT)
337
338$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk tmp-defines $(LIB_OBJ) $(GDB_OBJ)
339 rm -f $(TARGETLIB)
340 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
341 $(RANLIB) $(TARGETLIB)
342
343psim.o: psim.c psim.h tree.h $(CPU_H) $(IDECODE_H)
344
345bits.o: bits.c $(BASICS_H)
346
347debug.o: debug.c $(BASICS_H)
348filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
349
350sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
351
352os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
353emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
354
355emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
356emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
357emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
358emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H)
359
360registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
361
362cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
363
364interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
365
366# Given that inlines are turned on now, rebuild idecode whenever
367# anything changes.
368idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h $(LIB_INLINE_SRC) $(BUILT_SRC)
c906108c
SS
369
370# double.o: double.c dp-bit.c
371
372vm.o: vm.c vm.h vm_n.h $(CPU_H)
373
374corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) $(DEVICE_TABLE_H)
375
376model.o: model.c $(CPU_H)
377
378events.o: events.c events.h $(BASICS_H)
379
380sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h
381
382spreg.o: spreg.c spreg.h spreg.c $(BASICS_H)
383
384main.o: main.c $(PSIM_H) itable.h options.h
385
386device.o: device.c $(DEVICE_TABLE_H) cap.h
387
388tree.o: tree.c tree.h device.h $(DEVICE_TABLE_H)
389
390device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c
391
392cap.o: cap.c cap.h $(BASICS_H)
393
394semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
c906108c
SS
395
396icache.o: icache.c icache.h $(IDECODE_H) $(CPU_H)
c906108c
SS
397
398support.o: support.c support.h $(IDECODE_H) $(CPU_H)
399
400itable.o: itable.c itable.h
401
402mon.o: mon.c $(CPU_H)
403
404# GDB after 4.16 expects the default_callback structure to be setup.
405# As a kludge, build the common stuff here for now.
406gentmap: ../common/gentmap.c Makefile targ-vals.def
407 $(CC_FOR_BUILD) $(BUILD_FLAGS) -I. -I../common -I$(srcdir)/../common -o gentmap $< $(BUILD_LIBS)
408
409targ-vals.def: $(srcdir)/../common/nltvals.def
410 rm -f targ-vals.def tmp-def
411 cat $(srcdir)/../common/nltvals.def > tmp-vals.def
ae451ac6 412 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def
c906108c
SS
413
414targ-vals.h: Makefile gentmap $(srcdir)/../../move-if-change
415 rm -f tmp-vals.h
416 ./gentmap -h > tmp-vals.h
ae451ac6 417 $(SHELL) $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h
c906108c
SS
418
419targ-map.c: Makefile gentmap $(srcdir)/../../move-if-change
420 rm -f tmp-map.c
421 ./gentmap -c > tmp-map.c
ae451ac6 422 $(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c
c906108c
SS
423
424callback.o: ../common/callback.c targ-vals.h config.h
425 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $<
426
427targ-map.o: targ-map.c targ-vals.h
428
d29d5195
MG
429sim-fpu.o: $(srcdir)/../common/sim-fpu.c config.h tconfig.h
430 $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
431
d29d5195
MG
432tconfig.h:
433 rm -f tconfig.h
434 echo > tconfig.h
435
c906108c
SS
436# Rebuild options whenever something changes so the date/time is up to date.
437options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile defines.h
438 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
439
440tmp-defines: config.h Makefile
441 sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > tmp-defines.h
ae451ac6 442 $(SHELL) $(srcdir)/../../move-if-change tmp-defines.h defines.h
c906108c
SS
443 touch tmp-defines
444
445#
446# Rules to create the built c source code files
447#
448
449ppc-config.h: $(CONFIG_FILE)
450 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
451
452
453tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
454 ./dgen $(DGEN_FLAGS) \
455 -r $(srcdir)/ppc-spr-table \
456 -n spreg.h -hp tmp-spreg.h \
457 -n spreg.c -p tmp-spreg.c
ae451ac6
ILT
458 $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
459 $(SHELL) $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
c906108c
SS
460 touch tmp-dgen
461
462
d81bb16a 463tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) $(srcdir)/../../move-if-change tmp-ld-decode tmp-ld-cache tmp-ld-insn tmp-filter
c906108c
SS
464 ./igen $(IGEN_FLAGS) \
465 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
43c4bab0 466 -I $(srcdir) -i $(srcdir)/ppc-instructions \
c906108c
SS
467 -n icache.h -hc tmp-icache.h \
468 -n icache.c -c tmp-icache.c \
469 -n semantics.h -hs tmp-semantics.h \
470 -n semantics.c -s tmp-semantics.c \
471 -n idecode.h -hd tmp-idecode.h \
472 -n idecode.c -d tmp-idecode.c \
473 -n itable.h -ht tmp-itable.h \
474 -n itable.c -t tmp-itable.c \
475 -n model.h -hm tmp-model.h \
476 -n model.c -m tmp-model.c \
477 -n support.h -hf tmp-support.h \
478 -n support.c -f tmp-support.c
ae451ac6
ILT
479 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h
480 $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c
481 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
482 $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
483 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
484 $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
485 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
486 $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
487 $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h
488 $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c
489 $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h
490 $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c
c906108c
SS
491 touch tmp-igen
492
493# NOTE: Some versions of make don't handle files created as side-effects
494# uncomment the below if that is the case.
495
496$(TARGETLIB): tmp-igen tmp-dgen
497itable.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
498spreg.h spreg.c: tmp-dgen
499
500dgen: dgen.o table.o lf.o misc.o filter_host.o
501 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
502
503igen: 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
504 $(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)
505
506filter_host.c: filter_filename.c
507 cat $(srcdir)/filter_filename.c > filter_host.c
508
509filter_host.o: filter_host.c filter_filename.h config.h ppc-config.h
510 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c
511
512table.o: table.c misc.h filter_filename.h lf.h table.h
513 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c
514
515lf.o: lf.c misc.h filter_filename.h lf.h
516 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c
517
518filter.o: filter.c misc.h lf.h table.h filter.h
519 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/filter.c
520tmp-filter: filter.c misc.h misc.o
521 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-filter -DMAIN $(srcdir)/filter.c misc.o $(BUILD_LIBS)
522
523ld-decode.o: ld-decode.c misc.h lf.h table.h ld-decode.h
524 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-decode.c
525tmp-ld-decode: ld-decode.o misc.o lf.o table.o filter_host.o
526 $(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)
527
528ld-cache.o: ld-cache.c misc.h lf.h table.h ld-cache.h
529 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-cache.c
530tmp-ld-cache: ld-cache.o misc.o lf.o table.o filter_host.o
531 $(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)
532
533ld-insn.o: ld-insn.c misc.h lf.h table.h ld-insn.h ld-decode.h igen.h
534 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-insn.c
535tmp-ld-insn: ld-insn.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
d81bb16a 536 $(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 537
d81bb16a 538gen-model.o: gen-model.c misc.h lf.h table.h gen-model.h ld-decode.h igen.h ld-insn.h ld-cache.h
c906108c
SS
539 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-model.c
540
d81bb16a 541gen-itable.o: gen-itable.c misc.h lf.h table.h gen-itable.h ld-decode.h igen.h ld-insn.h igen.h ld-cache.h
c906108c
SS
542 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-itable.c
543
544gen-icache.o: gen-icache.c misc.h lf.h table.h gen-icache.h ld-decode.h igen.h ld-insn.h gen-semantics.h gen-idecode.h
545 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-icache.c
546
547gen-semantics.o: gen-semantics.c misc.h lf.h table.h gen-semantics.h ld-decode.h igen.h ld-insn.h
548 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-semantics.c
549
550gen-idecode.o: gen-idecode.c misc.h lf.h table.h gen-idecode.h gen-icache.h gen-semantics.h ld-decode.h igen.h ld-insn.h
551 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-idecode.c
552
553gen-support.o: gen-support.c misc.h lf.h table.h gen-support.h ld-decode.h igen.h ld-insn.h
554 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-support.c
555
556dgen.o: dgen.c misc.h filter_filename.h lf.h table.h
557 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c
558
559igen.o: igen.c misc.h filter_filename.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-semantics.h gen-support.h igen.h
560 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
561
562misc.o: misc.c misc.h filter_filename.h
563 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
564
565
566
567# real hardware
568tmp-hw: Makefile $(HW_SRC) $(srcdir)/../../move-if-change
569 # The first for loop is to remove duplicates.
570 f=""; \
571 for i in $(HW_SRC) ; do \
572 case " $$f " in \
573 *" $$i "*) ;; \
574 *) f="$$f $$i" ;; \
575 esac ; \
576 done ; \
577 for hw in $$f ; do echo $$hw ; done \
578 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
579 -e 's/^/extern const device_descriptor /' \
580 -e 's/$$/_device_descriptor\[\];/' \
581 > tmp-hw.h
582 f=""; \
583 for i in $(HW_SRC) ; do \
584 case " $$f " in \
585 *" $$i "*) ;; \
586 *) f="$$f $$i" ;; \
587 esac ; \
588 done ; \
589 for hw in $$f ; do echo $$hw ; done \
590 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
591 -e 's/^/ /' \
592 -e 's/$$/_device_descriptor,/' \
593 > tmp-hw.c
ae451ac6
ILT
594 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.h hw.h
595 $(SHELL) $(srcdir)/../../move-if-change tmp-hw.c hw.c
c906108c
SS
596 touch tmp-hw
597
54cfd411 598hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(CPU_H)
c906108c
SS
599hw_core.o: hw_core.c $(DEVICE_TABLE_H)
600hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) pk.h
601hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
602hw_htab.o: hw_htab.c $(DEVICE_TABLE_H)
603hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
604hw_init.o: hw_init.c $(DEVICE_TABLE_H)
605hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
606hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
607hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
608hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
54cfd411 609hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
c906108c
SS
610hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) hw_phb.h
611hw_register.o: hw_register.c $(DEVICE_TABLE_H)
612hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
54cfd411 613hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
c906108c
SS
614# ignore this line, it stops make from getting confused
615
616
617
618# real packages
619tmp-pk: Makefile $(PACKAGE_SRC) $(srcdir)/../../move-if-change
620 # The first for loop is to remove duplicates.
621 f=""; \
622 for i in $(PACKAGE_SRC) ; do \
623 case " $$f " in \
624 *" $$i "*) ;; \
625 *) f="$$f $$i" ;; \
626 esac ; \
627 done ; \
628 for pk in $$f ; do echo $$pk ; done \
629 | sed -e 's/^.*pk_\(.*\)\.c/\1/' \
630 -e 's/^/extern package_create_instance_callback pk_/' \
631 -e 's/$$/_create_instance;/' \
632 > tmp-pk.h
ae451ac6 633 $(SHELL) $(srcdir)/../../move-if-change tmp-pk.h pk.h
c906108c
SS
634 touch tmp-pk
635
636pk_disklabel.o: pk.h $(DEVICE_TABLE_H)
637# ignore this line, it stops make from getting confused
638
639
640
641tags etags: TAGS
642
643TAGS: $(BUILT_SRC)
644 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
645
646clean mostlyclean:
647 rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG) gentmap
648
649distclean realclean: clean
650 rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
651
652maintainer-clean: distclean
653 rm -f *~ *.log ppc-config.h core *.core
654
655Makefile: Makefile.in config.status
656 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
657
658config.h: stamp-h ; @true
659stamp-h: config.in config.status
660 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
661
662config.status: configure
663 $(SHELL) ./config.status --recheck
664
665install: installdirs
666 n=`echo run | sed '$(program_transform_name)'`; \
667 $(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT)
668
669installdirs:
670 $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir)
This page took 0.193616 seconds and 4 git commands to generate.