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