]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ppc/Makefile.in
Add support for setting model name and other things
[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 RESERVED_CFLAGS = @sim_reserved@
84 MONITOR_CFLAGS = @sim_monitor@
85 FUNC_CFLAGS = @sim_func@
86 MODEL_CFLAGS = @sim_model@ @sim_default_model@
87 WARNING_CFLAGS = @sim_warnings@
88 CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
89 $(ENDIAN_CFLAGS) \
90 $(HOSTENDIAN_CFLAGS) \
91 $(SMP_CFLAGS) \
92 $(BITSIZE_CFLAGS) \
93 $(HOSTBITSIZE_CFLAGS) \
94 $(ENV_CFLAGS) \
95 $(TIMEBASE_CFLAGS) \
96 $(ALIGNMENT_CFLAGS) \
97 $(FLOAT_CFLAGS) \
98 $(TRACE_CFLAGS) \
99 $(ASSERT_CFLAGS) \
100 $(RESERVED_CFLAGS) \
101 $(MONITOR_CFLAGS) \
102 $(FUNC_CFLAGS) \
103 $(MODEL_CFLAGS)
104
105 STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
106 NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
107
108 CONFIG_FILE = @sim_config@
109 IGEN_OPCODE_RULES = @sim_opcode@
110 IGEN_DUPLICATE = @sim_dup@
111 IGEN_FILTER = @sim_filter@
112 IGEN_ICACHE = @sim_icache@
113 DGEN_FLAGS = @sim_switch@
114
115 HDEFINES = @HDEFINES@
116 TDEFINES =
117 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER) $(IGEN_ICACHE)
118
119 .NOEXPORT:
120 MAKEOVERRIDES=
121
122 LIB_INCLUDES = -I$(srcdir)/../../include
123 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
124 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
125 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
126
127 LIBIBERTY_LIB = ../../libiberty/libiberty.a
128 BFD_LIB = ../../bfd/libbfd.a
129
130 TARGETLIB = libsim.a
131
132 all: run $(TARGETLIB) $(GDB_OBJ)
133
134 .c.o:
135 $(CC) -c $(STD_CFLAGS) $<
136
137
138
139 BASICS_H = \
140 config.h \
141 ppc-config.h \
142 words.h \
143 sim-endian.h \
144 debug.h \
145 filter_filename.h \
146 bits.h \
147 sim_callbacks.h
148
149 PSIM_H = \
150 psim.h \
151 $(BASICS_H)
152
153 IDECODE_H = \
154 idecode.h \
155 idecode_expression.h \
156 idecode_branch.h \
157 idecode_fields.h \
158 icache.h
159
160 REGISTERS_H = \
161 registers.h \
162 spreg.h
163
164 CPU_H = \
165 cpu.h \
166 $(BASICS_H) \
167 $(REGISTERS_H) \
168 device_tree.h \
169 corefile.h \
170 vm.h \
171 events.h \
172 interrupts.h \
173 psim.h \
174 icache.h \
175 itable.h \
176 mon.h \
177 function_unit.h \
178 model.h
179
180 EMUL_GENERIC_H = \
181 $(CPU_H) \
182 $(IDECODE_H) \
183 emul_generic.h \
184 os_emul.h
185
186
187 INLINE = \
188 inline.h \
189 inline.c
190
191 BUILT_SRC_WO_CONFIG = \
192 icache.h \
193 idecode.h idecode.c \
194 semantics.h semantics.c \
195 itable.h itable.c \
196 spreg.h spreg.c \
197 model.h model.c
198
199 BUILT_SRC = \
200 $(BUILT_SRC_WO_CONFIG) \
201 config.h \
202 ppc-config.h
203
204 LIB_SRC = \
205 psim.c \
206 bits.c \
207 debug.c \
208 sim-endian.c \
209 sim-endian.h \
210 sim-endian-n.h \
211 vm.c \
212 vm_n.h \
213 corefile.c \
214 function_unit.c \
215 events.c \
216 os_emul.c \
217 emul_generic.c \
218 emul_netbsd.c \
219 registers.c \
220 cpu.c \
221 interrupts.c \
222 devices.c \
223 device_tree.c \
224 mon.c \
225 options.c
226
227 MAIN_SRC = \
228 main.c \
229 sim_calls.c
230
231
232 # NOTE: semantics, idecode and psim put last so smaller files are compiled
233 # first
234 LIB_OBJ = \
235 debug.o \
236 options.o \
237 filter_filename.o \
238 bits.o \
239 sim-endian.o \
240 os_emul.o \
241 emul_generic.o \
242 emul_netbsd.o \
243 registers.o \
244 vm.o \
245 corefile.o \
246 model.o \
247 function_unit.o \
248 spreg.o \
249 cpu.o \
250 interrupts.o \
251 events.o \
252 devices.o \
253 device_tree.o \
254 itable.o \
255 mon.o \
256 semantics.o \
257 idecode.o \
258 psim.o
259
260
261 GDB_OBJ = sim_calls.o
262
263
264 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
265 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
266
267 run: psim
268 rm -f run
269 ln psim run
270
271 $(TARGETLIB): tmp-igen tmp-dgen $(LIB_OBJ) $(GDB_OBJ)
272 rm -f $(TARGETLIB)
273 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
274 $(RANLIB) $(TARGETLIB)
275
276 # Given that inlines are turned on now, rebuild psim whenever
277 # anything changes.
278 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
279 $(CC) -c $(NOWARN_CFLAGS) $<
280
281 bits.o: bits.c $(BASICS_H)
282
283 debug.o: debug.c $(BASICS_H)
284 filter_filename.o: filter_filename.c config.h ppc-config.h
285
286 sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
287
288 os_emul.o: os_emul.c $(EMUL_GENERIC_H)
289 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
290 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
291
292 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
293
294 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
295
296 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
297
298 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
299 $(CC) -c $(NOWARN_CFLAGS) $<
300
301 # double.o: double.c dp-bit.c
302
303 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
304 device_tree.h corefile.h interrupts.h itable.h mon.h
305
306 corefile.o: corefile.c corefile.h $(BASICS_H) device_tree.h
307
308 function_unit.o: function_unit.c $(CPU_H)
309
310 model.o: model.c $(CPU_H)
311
312 events.o: events.c events.h $(BASICS_H)
313
314 sim_calls.o: sim_calls.c $(CPU_H) $(PSIM_H) ../../gdb/tm.h devices.h options.h
315
316 spreg.o: spreg.h spreg.c words.h
317
318 main.o: main.c $(PSIM_H) function_unit.h itable.h options.h
319
320 devices.o: devices.c devices.h $(BASICS_H) \
321 device_tree.h events.h
322
323 device_tree.o: device_tree.c device_tree.h devices.h $(BASICS_H)
324
325 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
326 $(CC) -c $(NOWARN_CFLAGS) $<
327
328 itable.o: itable.c itable.h
329
330 mon.o: mon.c $(CPU_H)
331
332 # Rebuild options whenever something changes so the date/time is up to date.
333 options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
334 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
335
336 #
337 # Rules to create the built c source code files
338 #
339
340 ppc-config.h: $(CONFIG_FILE)
341 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
342
343
344 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
345 ./dgen $(DGEN_FLAGS) \
346 -r $(srcdir)/ppc-spr-table \
347 -n spreg.h -P tmp-spreg.h \
348 -n spreg.c -p tmp-spreg.c
349 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
350 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
351 touch tmp-dgen
352
353
354 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
355 ./igen $(IGEN_FLAGS) \
356 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
357 -k $(srcdir)/ppc-cache-rules \
358 -i $(srcdir)/ppc-instructions \
359 -n icache.h -C tmp-icache.h \
360 -n semantics.h -S tmp-semantics.h \
361 -n semantics.c -s tmp-semantics.c \
362 -n idecode.h -D tmp-idecode.h \
363 -n idecode.c -d tmp-idecode.c \
364 -n itable.h -T tmp-itable.h \
365 -n itable.c -t tmp-itable.c \
366 -n model.h -M tmp-model.h \
367 -n model.c -m tmp-model.c
368 $(srcdir)/../../move-if-change tmp-icache.h icache.h
369 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
370 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
371 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
372 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
373 $(srcdir)/../../move-if-change tmp-itable.h itable.h
374 $(srcdir)/../../move-if-change tmp-itable.c itable.c
375 $(srcdir)/../../move-if-change tmp-model.h model.h
376 $(srcdir)/../../move-if-change tmp-model.c model.c
377 touch tmp-igen
378
379 # NOTE: Some versions of make don't handle files created as side-effects
380 # uncomment the below if that is the case.
381
382 $(TARGETLIB): tmp-igen tmp-dgen
383 itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c model.h model.c: tmp-igen
384 spreg.h spreg.c: tmp-dgen
385
386 dgen: dgen.o table.o lf.o misc.o filter_filename.o
387 $(CC_FOR_BUILD) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
388
389 igen: igen.o table.o lf.o misc.o filter_filename.o
390 $(CC_FOR_BUILD) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
391
392 table.o: misc.h filter_filename.h lf.h table.h
393 lf.o: misc.h filter_filename.h lf.h
394 dgen.o igen.o: misc.h filter_filename.h lf.h table.h
395 misc.o: misc.h filter_filename.h
396 # With out this #, make thinks that misc.o doesn't have a rule
397
398 tags etags: TAGS
399
400 TAGS: $(BUILT_SRC)
401 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
402
403 clean mostlyclean:
404 rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG)
405
406 distclean maintainer-clean realclean: clean
407 rm -f TAGS Makefile config.cache config.status config.h stamp-h
408
409 Makefile: Makefile.in config.status
410 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
411
412 config.h: stamp-h ; @true
413 stamp-h: config.in config.status
414 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
415
416 config.status: configure
417 $(SHELL) ./config.status --recheck
418
419 install:
420 $(INSTALL_XFORM) run $(bindir)/run
421