Abort if we find the program has an .interp section
[deliverable/binutils-gdb.git] / sim / ppc / Makefile.in
1 #
2 # This file is part of the program psim.
3 #
4 # Copyright (C) 1994-1996, 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 XOR_ENDIAN_CFLAGS = @sim_xor_endian@
76 BITSIZE_CFLAGS = @sim_bitsize@
77 HOSTBITSIZE_CFLAGS = @sim_hostbitsize@
78 ENV_CFLAGS = @sim_env@
79 TIMEBASE_CFLAGS = @sim_timebase@
80 ALIGNMENT_CFLAGS = @sim_alignment@
81 FLOAT_CFLAGS = @sim_float@
82 TRACE_CFLAGS = @sim_trace@
83 ASSERT_CFLAGS = @sim_assert@
84 RESERVED_CFLAGS = @sim_reserved@
85 MONITOR_CFLAGS = @sim_monitor@
86 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
87 STDIO_CFLAGS = @sim_stdio@
88 WARNING_CFLAGS = @sim_warnings@
89 CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
90 $(ENDIAN_CFLAGS) \
91 $(HOSTENDIAN_CFLAGS) \
92 $(SMP_CFLAGS) \
93 $(XOR_ENDIAN_CFLAGS) \
94 $(BITSIZE_CFLAGS) \
95 $(HOSTBITSIZE_CFLAGS) \
96 $(ENV_CFLAGS) \
97 $(TIMEBASE_CFLAGS) \
98 $(ALIGNMENT_CFLAGS) \
99 $(FLOAT_CFLAGS) \
100 $(TRACE_CFLAGS) \
101 $(ASSERT_CFLAGS) \
102 $(RESERVED_CFLAGS) \
103 $(MONITOR_CFLAGS) \
104 $(MODEL_CFLAGS) \
105 $(STDIO_CFLAGS)
106
107 STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
108 NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
109 BUILD_CFLAGS = -O $(INCLUDES)
110
111 BUILD_LDFLAGS =
112
113 CONFIG_FILE = @sim_config@
114 IGEN_OPCODE_RULES = @sim_opcode@
115 IGEN_DUPLICATE = @sim_dup@
116 IGEN_FILTER = @sim_filter@
117 IGEN_ICACHE = @sim_icache@
118 DGEN_FLAGS = @sim_switch@
119
120 HDEFINES = @HDEFINES@
121 TDEFINES =
122 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER) $(IGEN_ICACHE)
123
124 .NOEXPORT:
125 MAKEOVERRIDES=
126
127 LIB_INCLUDES = -I$(srcdir)/../../include
128 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
129 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
130 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
131
132 LIBIBERTY_LIB = ../../libiberty/libiberty.a
133 BFD_LIB = ../../bfd/libbfd.a
134
135 TARGETLIB = libsim.a
136
137 all: run $(TARGETLIB) $(GDB_OBJ)
138
139 .c.o:
140 $(CC) -c $(STD_CFLAGS) $<
141
142
143
144 BASICS_H = \
145 basics.h \
146 config.h \
147 ppc-config.h \
148 inline.h \
149 sim_callbacks.h \
150 debug.h filter_filename.h \
151 words.h \
152 bits.h \
153 sim-endian.h
154
155 PSIM_H = \
156 psim.h \
157 $(BASICS_H)
158
159 IDECODE_H = \
160 idecode.h \
161 idecode_expression.h \
162 idecode_branch.h \
163 idecode_fields.h \
164 icache.h
165
166 REGISTERS_H = \
167 registers.h \
168 spreg.h
169
170 CPU_H = \
171 cpu.h \
172 $(BASICS_H) \
173 $(REGISTERS_H) \
174 device.h \
175 corefile.h \
176 vm.h \
177 events.h \
178 interrupts.h \
179 psim.h \
180 icache.h \
181 itable.h \
182 mon.h \
183 model.h
184
185 DEVICE_TABLE_H = \
186 $(BASICS_H) \
187 device_table.h \
188 device.h \
189 hw.h
190
191 EMUL_GENERIC_H = \
192 $(CPU_H) \
193 $(IDECODE_H) \
194 emul_generic.h \
195 os_emul.h
196
197
198 INLINE = \
199 inline.h \
200 inline.c
201
202 BUILT_SRC_WO_CONFIG = \
203 icache.h \
204 idecode.h idecode.c \
205 semantics.h semantics.c \
206 itable.h itable.c \
207 spreg.h spreg.c \
208 model.h model.c \
209 hw.h hw.c \
210 filter_host.c
211
212 BUILT_SRC = \
213 $(BUILT_SRC_WO_CONFIG) \
214 config.h \
215 ppc-config.h
216
217 LIB_SRC = \
218 psim.c \
219 bits.c \
220 debug.c \
221 sim-endian.c \
222 sim-endian.h \
223 sim-endian-n.h \
224 vm.c \
225 vm_n.h \
226 corefile.c \
227 events.c \
228 os_emul.c \
229 emul_generic.c \
230 emul_netbsd.c \
231 emul_unix.c \
232 emul_chirp.c \
233 emul_bugapi.c \
234 registers.c \
235 cpu.c \
236 interrupts.c \
237 device.c \
238 device_table.c \
239 cap.c \
240 mon.c \
241 options.c \
242 $(HW_SRC)
243
244 MAIN_SRC = \
245 main.c \
246 sim_calls.c
247
248
249 # NOTE: semantics, idecode and psim put last so smaller files are compiled
250 # first
251 LIB_OBJ = \
252 debug.o \
253 filter_filename.o \
254 bits.o \
255 sim-endian.o \
256 os_emul.o \
257 emul_generic.o \
258 emul_netbsd.o \
259 emul_unix.o \
260 emul_chirp.o \
261 emul_bugapi.o \
262 registers.o \
263 vm.o \
264 corefile.o \
265 model.o \
266 spreg.o \
267 cpu.o \
268 interrupts.o \
269 events.o \
270 cap.o \
271 device.o \
272 device_table.o \
273 itable.o \
274 mon.o \
275 semantics.o \
276 idecode.o \
277 psim.o \
278 options.o \
279 $(HW)
280
281
282 GDB_OBJ = sim_calls.o
283
284 HW_SRC = \
285 hw_cpu.c \
286 hw_memory.c \
287 hw_nvram.c \
288 hw_iobus.c \
289 hw_pal.c
290
291 HW = \
292 hw_cpu.o \
293 hw_memory.o \
294 hw_nvram.o \
295 hw_iobus.o \
296 hw_pal.o
297
298
299 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
300 $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
301
302 run: psim
303 rm -f run
304 ln psim run
305
306 $(TARGETLIB): tmp-igen tmp-dgen $(HW) $(LIB_OBJ) $(GDB_OBJ)
307 rm -f $(TARGETLIB)
308 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
309 $(RANLIB) $(TARGETLIB)
310
311 # Given that inlines are turned on now, rebuild psim whenever
312 # anything changes.
313 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
314
315 bits.o: bits.c $(BASICS_H)
316
317 debug.o: debug.c $(BASICS_H)
318 filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
319
320 sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
321
322 os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
323 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
324
325 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
326 emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H)
327 emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
328 emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
329
330 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
331
332 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
333
334 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
335
336 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
337 $(CC) -c $(NOWARN_CFLAGS) $<
338
339 # double.o: double.c dp-bit.c
340
341 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
342 device.h corefile.h interrupts.h itable.h mon.h
343
344 corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) $(DEVICE_TABLE_H)
345
346 model.o: model.c $(CPU_H)
347
348 events.o: events.c events.h $(BASICS_H)
349
350 sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h
351
352 spreg.o: spreg.c spreg.h spreg.c $(BASICS_H)
353
354 main.o: main.c $(PSIM_H) itable.h options.h
355
356 device.o: device.c $(DEVICE_TABLE_H) cap.h
357
358 device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c
359
360 cap.o: cap.c cap.h $(BASICS_H)
361
362 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
363 $(CC) -c $(NOWARN_CFLAGS) $<
364
365 itable.o: itable.c itable.h
366
367 mon.o: mon.c $(CPU_H)
368
369 # Rebuild options whenever something changes so the date/time is up to date.
370 options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
371 $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
372
373 #
374 # Rules to create the built c source code files
375 #
376
377 ppc-config.h: $(CONFIG_FILE)
378 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
379
380
381 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
382 ./dgen $(DGEN_FLAGS) \
383 -r $(srcdir)/ppc-spr-table \
384 -n spreg.h -P tmp-spreg.h \
385 -n spreg.c -p tmp-spreg.c
386 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
387 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
388 touch tmp-dgen
389
390
391 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
392 ./igen $(IGEN_FLAGS) \
393 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
394 -k $(srcdir)/ppc-cache-rules \
395 -i $(srcdir)/ppc-instructions \
396 -n icache.h -C tmp-icache.h \
397 -n semantics.h -S tmp-semantics.h \
398 -n semantics.c -s tmp-semantics.c \
399 -n idecode.h -D tmp-idecode.h \
400 -n idecode.c -d tmp-idecode.c \
401 -n itable.h -T tmp-itable.h \
402 -n itable.c -t tmp-itable.c \
403 -n model.h -M tmp-model.h \
404 -n model.c -m tmp-model.c
405 $(srcdir)/../../move-if-change tmp-icache.h icache.h
406 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
407 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
408 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
409 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
410 $(srcdir)/../../move-if-change tmp-itable.h itable.h
411 $(srcdir)/../../move-if-change tmp-itable.c itable.c
412 $(srcdir)/../../move-if-change tmp-model.h model.h
413 $(srcdir)/../../move-if-change tmp-model.c model.c
414 touch tmp-igen
415
416 # NOTE: Some versions of make don't handle files created as side-effects
417 # uncomment the below if that is the case.
418
419 $(TARGETLIB): tmp-igen tmp-dgen
420 itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c model.h model.c: tmp-igen
421 spreg.h spreg.c: tmp-dgen
422
423 dgen: dgen.o table.o lf.o misc.o filter_host.o
424 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
425
426 igen: igen.o table.o lf.o misc.o filter_host.o
427 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
428
429 filter_host.c: filter_filename.c
430 cat $(srcdir)/filter_filename.c > filter_host.c
431
432 filter_host.o: filter_host.c filter_filename.h config.h ppc-config.h
433 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c
434
435 table.o: table.c misc.h filter_filename.h lf.h table.h
436 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c
437
438 lf.o: lf.c misc.h filter_filename.h lf.h
439 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c
440
441 dgen.o: dgen.c misc.h filter_filename.h lf.h table.h
442 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c
443
444 igen.o: igen.c misc.h filter_filename.h lf.h table.h
445 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
446
447 misc.o: misc.c misc.h filter_filename.h
448 $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
449
450 # With out this #, make thinks that misc.o doesn't have a rule
451
452 # real hardware
453 hw.h:
454 (cd $(srcdir); ls $(HW_SRC)) \
455 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
456 -e 's/^/extern const device_descriptor /' \
457 -e 's/$$/_device_descriptor\[\];/' \
458 > tmp-hw.h
459 mv tmp-hw.h hw.h
460 hw.c:
461 (cd $(srcdir); ls $(HW_SRC)) \
462 | sed -e 's/^.*\(hw_.*\)\.c/\1/' \
463 -e 's/^/ /' \
464 -e 's/$$/_device_descriptor,/' \
465 > tmp-hw.c
466 mv tmp-hw.c hw.c
467 hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H)
468 hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
469 hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
470 hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
471 hw_pal.o: hw_pal.c $(DEVICE_TABLE_H)
472 # ignore this line, it stops make from getting confused
473
474
475 tags etags: TAGS
476
477 TAGS: $(BUILT_SRC)
478 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
479
480 clean mostlyclean:
481 rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG)
482
483 distclean realclean: clean
484 rm -f TAGS Makefile config.cache config.status config.h stamp-h
485
486 maintainer-clean: distclean
487 rm -f *~ *.log ppc-config.h core *.core
488
489 Makefile: Makefile.in config.status
490 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
491
492 config.h: stamp-h ; @true
493 stamp-h: config.in config.status
494 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
495
496 config.status: configure
497 $(SHELL) ./config.status --recheck
498
499 install:
500 $(INSTALL_XFORM) run $(bindir)/run
501
This page took 0.042826 seconds and 4 git commands to generate.