Lots of changes
[deliverable/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 HDEFINES = @HDEFINES@
70 TDEFINES =
71 IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_FILTER)
72
73 .NOEXPORT:
74 MAKEOVERRIDES=
75
76 LIB_INCLUDES = -I$(srcdir)/../../include
77 BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
78 GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc
79 INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES)
80
81 LIBIBERTY_LIB = ../../libiberty/libiberty.a
82 BFD_LIB = ../../bfd/libbfd.a
83
84 TARGETLIB = libsim.a
85
86 all: run $(TARGETLIB) $(GDB_OBJ)
87
88 .c.o:
89 $(CC) -c $(CFLAGS) $(INLINE_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $<
90
91
92
93 BASICS_H = \
94 config.h \
95 ppc-config.h \
96 words.h \
97 ppc-endian.h \
98 debug.h \
99 filter_filename.h \
100 bits.h \
101 sim_callbacks.h
102
103 PSIM_H = \
104 psim.h \
105 $(BASICS_H)
106
107 IDECODE_H = \
108 idecode.h \
109 idecode_expression.h \
110 idecode_branch.h \
111 idecode_fields.h \
112 icache.h
113
114 REGISTERS_H = \
115 registers.h \
116 spreg.h
117
118 CPU_H = \
119 cpu.h \
120 $(BASICS_H) \
121 $(REGISTERS_H) \
122 device_tree.h \
123 core.h \
124 vm.h \
125 events.h \
126 interrupts.h \
127 psim.h \
128 icache.h \
129 itable.h \
130 mon.h
131
132 EMUL_GENERIC_H = \
133 $(CPU_H) \
134 $(IDECODE_H) \
135 emul_generic.h \
136 os_emul.h
137
138
139 INLINE = \
140 inline.h \
141 inline.c
142
143 BUILT_SRC = \
144 icache.h \
145 idecode.h idecode.c \
146 semantics.h semantics.c \
147 itable.h itable.c \
148 spreg.h spreg.c \
149 config.h \
150 ppc-config.h
151
152 LIB_SRC = \
153 psim.c \
154 bits.c \
155 debug.c \
156 ppc-endian.c \
157 vm.c \
158 core.c \
159 events.c \
160 os_emul.c \
161 emul_generic.c \
162 emul_netbsd.c \
163 registers.c \
164 cpu.c \
165 interrupts.c \
166 devices.c \
167 device_tree.c \
168 mon.c
169
170 MAIN_SRC = \
171 main.c \
172 sim_calls.c
173
174
175 # NOTE: semantics, idecode and psim put last so smaller files are compiled
176 # first
177 LIB_OBJ = \
178 debug.o \
179 filter_filename.o \
180 bits.o \
181 ppc-endian.o \
182 os_emul.o \
183 emul_generic.o \
184 emul_netbsd.o \
185 registers.o \
186 vm.o \
187 core.o \
188 spreg.o \
189 cpu.o \
190 interrupts.o \
191 events.o \
192 devices.o \
193 device_tree.o \
194 itable.o \
195 mon.o \
196 semantics.o \
197 idecode.o \
198 psim.o
199
200
201 GDB_OBJ = sim_calls.o
202
203
204 psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS)
205 $(CC) $(CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
206
207 run: psim
208 rm -f run
209 ln psim run
210
211 $(TARGETLIB): tmp-igen tmp-dgen $(LIB_OBJ) $(GDB_OBJ)
212 rm -f $(TARGETLIB)
213 $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
214 $(RANLIB) $(TARGETLIB)
215
216 # Given that inlines are turned on now, rebuild psim whenever
217 # anything changes.
218 psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC)
219
220 bits.o: bits.c $(BASICS_H)
221
222 debug.o: debug.c $(BASICS_H)
223 filter_filename.o: filter_filename.c $(BASICS_H)
224
225 ppc-endian.o: ppc-endian.c ppc-endian.h \
226 config.h ppc-config.h words.h sim_callbacks.h
227
228 os_emul.o: os_emul.c $(EMUL_GENERIC_H)
229 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
230 emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
231
232 registers.o: registers.c $(REGISTERS_H) $(BASICS_H)
233
234 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
235
236 interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
237
238 idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h
239
240 # double.o: double.c dp-bit.c
241
242 vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \
243 device_tree.h core.h interrupts.h itable.h mon.h
244
245 core.o: core.c core.h $(BASICS_H) device_tree.h
246
247 events.o: events.c events.h $(BASICS_H)
248
249 sim_calls.o: sim_calls.c $(PSIM_H) ../../gdb/tm.h devices.h
250
251 spreg.o: spreg.h spreg.c words.h
252
253 main.o: main.c $(PSIM_H)
254
255 devices.o: devices.c devices.h $(BASICS_H) \
256 device_tree.h events.h
257
258 device_tree.o: device_tree.c device_tree.h devices.h $(BASICS_H)
259
260 semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
261
262 itable.o: itable.c itable.h
263
264 mon.o: $(CPU_H)
265
266 #
267 # Rules to create the built c source code files
268 #
269
270 ppc-config.h: $(CONFIG_FILE)
271 cp $(srcdir)/$(CONFIG_FILE) ppc-config.h
272
273
274 tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change
275 ./dgen $(DGEN_FLAGS) \
276 -r $(srcdir)/ppc-spr-table \
277 -n spreg.h -P tmp-spreg.h \
278 -n spreg.c -p tmp-spreg.c
279 $(srcdir)/../../move-if-change tmp-spreg.h spreg.h
280 $(srcdir)/../../move-if-change tmp-spreg.c spreg.c
281 touch tmp-dgen
282
283
284 tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change
285 ./igen $(IGEN_FLAGS) \
286 -o $(srcdir)/$(IGEN_OPCODE_RULES) \
287 -k $(srcdir)/ppc-cache-rules \
288 -i $(srcdir)/ppc-instructions \
289 -n icache.h -C tmp-icache.h \
290 -n semantics.h -S tmp-semantics.h \
291 -n semantics.c -s tmp-semantics.c \
292 -n idecode.h -D tmp-idecode.h \
293 -n idecode.c -d tmp-idecode.c \
294 -n itable.h -T tmp-itable.h \
295 -n itable.c -t tmp-itable.c
296 $(srcdir)/../../move-if-change tmp-icache.h icache.h
297 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
298 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
299 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
300 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
301 $(srcdir)/../../move-if-change tmp-itable.h itable.h
302 $(srcdir)/../../move-if-change tmp-itable.c itable.c
303 touch tmp-igen
304
305 # NOTE: Some versions of make don't handle files created as side-effects
306 # uncomment the below if that is the case.
307 #
308 # $(TARGETLIB): tmp-igen tmp-dgen
309 # itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c: tmp-igen
310 # spreg.h spreg.c: tmp-dgen
311
312 dgen: dgen.o table.o lf.o misc.o filter_filename.o
313 $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
314
315 igen: igen.o table.o lf.o misc.o filter_filename.o
316 $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_filename.o $(LIBIBERTY_LIB) $(LIBS)
317
318 table.o: misc.h filter_filename.h lf.h table.h
319 lf.o: misc.h filter_filename.h lf.h
320 dgen.o igen.o: misc.h filter_filename.h lf.h table.h
321 misc.o: misc.h filter_filename.h
322 # With out this #, make thinks that misc.o doesn't have a rule
323
324 tags etags: TAGS
325
326 TAGS: tmp-igen tmp-dgen config.h ppc-config.h
327 etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
328
329 clean mostlyclean:
330 rm -f tmp-* *.[oas] core psim run igen dgen config.log
331
332 distclean maintainer-clean realclean: clean
333 rm -f TAGS $(BUILT_SRC) Makefile config.cache config.status config.h stamp-h
334
335 Makefile: Makefile.in config.status
336 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
337
338 config.h: stamp-h ; @true
339 stamp-h: config.in config.status
340 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
341
342 config.status: configure config.make config.hdr
343 $(SHELL) ./config.status --recheck
344
345 install:
346 $(INSTALL_XFORM) run $(bindir)/run
347
348
349 # Make variables generated automatically by configure follow this
This page took 0.03635 seconds and 5 git commands to generate.