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