]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ppc/Makefile.in
General cleanup; add -t options support to print all options
[thirdparty/binutils-gdb.git] / sim / ppc / Makefile.in
1 #
2 # This file is part of the program psim.
3 #
4 # Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
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
21 default: all
22
23 VPATH = @srcdir@
24 srcdir = @srcdir@
25 srcroot = $(srcdir)/../..
26
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29
30 host_alias = @host_alias@
31 target_alias = @target_alias@
32 program_transform_name = @program_transform_name@
33 bindir = $(exec_prefix)/bin
34 libdir = $(exec_prefix)/lib
35 tooldir = $(libdir)/$(target_alias)
36
37 datadir = $(prefix)/lib
38 mandir = $(prefix)/man
39 man1dir = $(mandir)/man1
40 man2dir = $(mandir)/man2
41 man3dir = $(mandir)/man3
42 man4dir = $(mandir)/man4
43 man5dir = $(mandir)/man5
44 man6dir = $(mandir)/man6
45 man7dir = $(mandir)/man7
46 man8dir = $(mandir)/man8
47 man9dir = $(mandir)/man9
48 infodir = $(prefix)/info
49 includedir = $(prefix)/include
50 docdir = $(datadir)/doc
51
52 SHELL = /bin/sh
53
54 INSTALL = $(srcroot)/install.sh -c
55 INSTALL_PROGRAM = $(INSTALL)
56 INSTALL_DATA = $(INSTALL)
57 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
58 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
59
60 AR = @AR@
61 AR_FLAGS = rc
62 CC = @CC@
63 CFLAGS = @CFLAGS@
64 CC_FOR_BUILD = @CC_FOR_BUILD@
65 BISON = bison
66 MAKEINFO = makeinfo
67 RANLIB = @RANLIB@
68
69 SIM_CFLAGS = @sim_cflags@
70 INLINE_CFLAGS = @sim_inline@
71 BSWAP_CFLAGS = @sim_bswap@
72 ENDIAN_CFLAGS = @sim_endian@
73 HOSTENDIAN_CFLAGS = @sim_hostendian@
74 SMP_CFLAGS = @sim_smp@
75 BITSIZE_CFLAGS = @sim_bitsize@
76 HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
77 ENV_CFLAGS = @sim_env@
78 TIMEBASE_CFLAGS = @sim_timebase@
79 ALIGNMENT_CFLAGS = @sim_alignment@
80 FLOAT_CFLAGS = @sim_float@
81 TRACE_CFLAGS = @sim_trace@
82 ASSERT_CFLAGS = @sim_assert@
83 MONITOR_CFLAGS = @sim_monitor@
84 FUNC_CFLAGS = @sim_func@
85 MODEL_CFLAGS = @sim_model@ @sim_default_model@
86 WARNING_CFLAGS = @sim_warnings@
87 CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
88 $(ENDIAN_CFLAGS) \
89 $(HOSTENDIAN_CFLAGS) \
90 $(SMP_CFLAGS) \
91 $(BITSIZE_CFLAGS) \
92 $(HOSTBITSIZE_CFLAGS) \
93 $(ENV_CFLAGS) \
94 $(TIMEBASE_CFLAGS) \
95 $(ALIGNMENT_CFLAGS) \
96 $(FLOAT_CFLAGS) \
97 $(TRACE_CFLAGS) \
98 $(ASSERT_CFLAGS) \
99 $(MONITOR_CFLAGS) \
100 $(FUNC_CFLAGS) \
101 $(MODEL_CFLAGS)
102
103 CONFIG_FILE = @sim_config@
104 IGEN_OPCODE_RULES = @sim_opcode@
105 IGEN_DUPLICATE = @sim_dup@
106 IGEN_FILTER = @sim_filter@
107 IGEN_ICACHE = @sim_icache@
108 DGEN_FLAGS = @sim_switch@
109
110 HDEFINES = @HDEFINES@
111 TDEFINES =
112 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER) $(IGEN_ICACHE)
113
114 .NOEXPORT:
115 MAKEOVERRIDES=
116
117 LIB_INCLUDES = -I$(srcdir)/../../include
118 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
119 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
120 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
121
122 LIBIBERTY_LIB = ../../libiberty/libiberty.a
123 BFD_LIB = ../../bfd/libbfd.a
124
125 TARGETLIB = libsim.a
126
127 all: run $(TARGETLIB) $(GDB_OBJ)
128
129 .c.o:
130 $(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
131
132
133
134 BASICS_H = \
135 config.h \
136 ppc-config.h \
137 words.h \
138 sim-endian.h \
139 debug.h \
140 filter_filename.h \
141 bits.h \
142 sim_callbacks.h
143
144 PSIM_H = \
145 psim.h \
146 $(BASICS_H)
147
148 IDECODE_H = \
149 idecode.h \
150 idecode_expression.h \
151 idecode_branch.h \
152 idecode_fields.h \
153 icache.h
154
155 REGISTERS_H = \
156 registers.h \
157 spreg.h
158
159 CPU_H = \
160 cpu.h \
161 $(BASICS_H) \
162 $(REGISTERS_H) \
163 device_tree.h \
164 corefile.h \
165 vm.h \
166 events.h \
167 interrupts.h \
168 psim.h \
169 icache.h \
170 itable.h \
171 mon.h \
172 function_unit.h
173
174 EMUL_GENERIC_H = \
175 $(CPU_H) \
176 $(IDECODE_H) \
177 emul_generic.h \
178 os_emul.h
179
180
181 INLINE = \
182 inline.h \
183 inline.c
184
185 BUILT_SRC_WO_CONFIG = \
186 icache.h \
187 idecode.h idecode.c \
188 semantics.h semantics.c \
189 itable.h itable.c \
190 spreg.h spreg.c
191
192 BUILT_SRC = \
193 $(BUILT_SRC_WO_CONFIG) \
194 config.h \
195 ppc-config.h
196
197 LIB_SRC = \
198 psim.c \
199 bits.c \
200 debug.c \
201 sim-endian.c \
202 sim-endian.h \
203 sim-endian-n.h \
204 vm.c \
205 vm_n.h \
206 corefile.c \
207 function_unit.c \
208 events.c \
209 os_emul.c \
210 emul_generic.c \
211 emul_netbsd.c \
212 registers.c \
213 cpu.c \
214 interrupts.c \
215 devices.c \
216 device_tree.c \
217 mon.c \
218 options.c
219
220 MAIN_SRC = \
221 main.c \
222 sim_calls.c
223
224
225 # NOTE: semantics, idecode and psim put last so smaller files are compiled
226 # first
227 LIB_OBJ = \
228 debug.o \
229 options.o \
230 filter_filename.o \
231 bits.o \
232 sim-endian.o \
233 os_emul.o \
234 emul_generic.o \
235 emul_netbsd.o \
236 registers.o \
237 vm.o \
238 corefile.o \
239 function_unit.o \
240 spreg.o \
241 cpu.o \
242 interrupts.o \
243 events.o \
244 devices.o \
245 device_tree.o \
246 itable.o \
247 mon.o \
248 semantics.o \
249 idecode.o \
250 psim.o
251
252
253 GDB_OBJ = sim_calls.o
254
255
256 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
257 $(CC) $(CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
258
259 run: psim
260 rm -f run
261 ln psim run
262
263 $(TARGETLIB): tmp-igen tmp-dgen $(LIB_OBJ) $(GDB_OBJ)
264 rm -f $(TARGETLIB)
265 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
266 $(RANLIB) $(TARGETLIB)
267
268 # Given that inlines are turned on now, rebuild psim whenever
269 # anything changes.
270 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
271 $(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
272
273 bits.o: bits.c $(BASICS_H)
274
275 debug.o: debug.c $(BASICS_H)
276 filter_filename.o: filter_filename.c config.h ppc-config.h
277
278 sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
279
280 os_emul.o: os_emul.c $(EMUL_GENERIC_H)
281 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
282 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
283
284 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
285
286 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
287
288 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
289
290 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
291 $(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
292
293 # double.o: double.c dp-bit.c
294
295 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
296 device_tree.h corefile.h interrupts.h itable.h mon.h
297
298 corefile.o: corefile.c corefile.h $(BASICS_H) device_tree.h
299
300 function_unit.o: function_unit.c $(CPU_H)
301
302 events.o: events.c events.h $(BASICS_H)
303
304 sim_calls.o: sim_calls.c $(PSIM_H) function_unit.h itable.h ../../gdb/tm.h devices.h options.h
305
306 spreg.o: spreg.h spreg.c words.h
307
308 main.o: main.c $(PSIM_H) function_unit.h itable.h options.h
309
310 devices.o: devices.c devices.h $(BASICS_H) \
311 device_tree.h events.h
312
313 device_tree.o: device_tree.c device_tree.h devices.h $(BASICS_H)
314
315 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
316 $(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
317
318 itable.o: itable.c itable.h
319
320 mon.o: mon.c $(CPU_H)
321
322 options.o: options.c $(BASICS_H)
323
324 #
325 # Rules to create the built c source code files
326 #
327
328 ppc-config.h: $(CONFIG_FILE)
329 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
330
331
332 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
333 ./dgen $(DGEN_FLAGS) \
334 -r $(srcdir)/ppc-spr-table \
335 -n spreg.h -P tmp-spreg.h \
336 -n spreg.c -p tmp-spreg.c
337 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
338 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
339 touch tmp-dgen
340
341
342 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
343 ./igen $(IGEN_FLAGS) \
344 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
345 -k $(srcdir)/ppc-cache-rules \
346 -i $(srcdir)/ppc-instructions \
347 -n icache.h -C tmp-icache.h \
348 -n semantics.h -S tmp-semantics.h \
349 -n semantics.c -s tmp-semantics.c \
350 -n idecode.h -D tmp-idecode.h \
351 -n idecode.c -d tmp-idecode.c \
352 -n itable.h -T tmp-itable.h \
353 -n itable.c -t tmp-itable.c
354 $(srcdir)/../../move-if-change tmp-icache.h icache.h
355 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
356 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
357 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
358 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
359 $(srcdir)/../../move-if-change tmp-itable.h itable.h
360 $(srcdir)/../../move-if-change tmp-itable.c itable.c
361 touch tmp-igen
362
363 # NOTE: Some versions of make don't handle files created as side-effects
364 # uncomment the below if that is the case.
365
366 $(TARGETLIB): tmp-igen tmp-dgen
367 itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c: tmp-igen
368 spreg.h spreg.c: tmp-dgen
369
370 dgen: dgen.o table.o lf.o misc.o filter_filename.o
371 $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
372
373 igen: igen.o table.o lf.o misc.o filter_filename.o
374 $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
375
376 table.o: misc.h filter_filename.h lf.h table.h
377 lf.o: misc.h filter_filename.h lf.h
378 dgen.o igen.o: misc.h filter_filename.h lf.h table.h
379 misc.o: misc.h filter_filename.h
380 # With out this #, make thinks that misc.o doesn't have a rule
381
382 tags etags: TAGS
383
384 TAGS: $(BUILT_SRC)
385 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
386
387 clean mostlyclean:
388 rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG)
389
390 distclean maintainer-clean realclean: clean
391 rm -f TAGS Makefile config.cache config.status config.h stamp-h
392
393 Makefile: Makefile.in config.status
394 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
395
396 config.h: stamp-h ; @true
397 stamp-h: config.in config.status
398 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
399
400 config.status: configure
401 $(SHELL) ./config.status --recheck
402
403 install:
404 $(INSTALL_XFORM) run $(bindir)/run
405