Commit | Line | Data |
---|---|---|
cb7a6892 MM |
1 | # |
2 | # This file is part of the program psim. | |
3 | # | |
d6103e8e | 4 | # Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au> |
cb7a6892 MM |
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 | ||
8e20a3ac MM |
21 | default: all |
22 | ||
cb7a6892 MM |
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@ | |
78c09e4a JM |
33 | bindir = @bindir@ |
34 | libdir = @libdir@ | |
cb7a6892 MM |
35 | tooldir = $(libdir)/$(target_alias) |
36 | ||
78c09e4a JM |
37 | datadir = @datadir@ |
38 | mandir = @mandir@ | |
cb7a6892 MM |
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 | |
78c09e4a JM |
48 | infodir = @infodir@ |
49 | includedir = @includedir@ | |
cb7a6892 MM |
50 | |
51 | SHELL = /bin/sh | |
52 | ||
cb7a6892 | 53 | INSTALL = $(srcroot)/install.sh -c |
78c09e4a JM |
54 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
55 | INSTALL_DATA = @INSTALL_DATA@ | |
cb7a6892 MM |
56 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
57 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 | |
58 | ||
8b3797aa | 59 | AR = @AR@ |
cb7a6892 | 60 | AR_FLAGS = rc |
8b3797aa MM |
61 | CC = @CC@ |
62 | CFLAGS = @CFLAGS@ | |
63 | CC_FOR_BUILD = @CC_FOR_BUILD@ | |
cb7a6892 MM |
64 | BISON = bison |
65 | MAKEINFO = makeinfo | |
8b3797aa MM |
66 | RANLIB = @RANLIB@ |
67 | ||
c494cadd MM |
68 | SIM_CFLAGS = @sim_cflags@ |
69 | INLINE_CFLAGS = @sim_inline@ | |
70 | BSWAP_CFLAGS = @sim_bswap@ | |
71 | ENDIAN_CFLAGS = @sim_endian@ | |
72 | HOSTENDIAN_CFLAGS = @sim_hostendian@ | |
73 | SMP_CFLAGS = @sim_smp@ | |
1dc7c0ed | 74 | XOR_ENDIAN_CFLAGS = @sim_xor_endian@ |
c494cadd MM |
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@ | |
28816f45 | 83 | RESERVED_CFLAGS = @sim_reserved@ |
c494cadd | 84 | MONITOR_CFLAGS = @sim_monitor@ |
979c3c25 | 85 | MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@ |
d6103e8e | 86 | STDIO_CFLAGS = @sim_stdio@ |
30c87b55 | 87 | TERMIO_CFLAGS = @sim_termio@ |
73c4941b | 88 | WARNING_CFLAGS = @sim_warnings@ |
c494cadd MM |
89 | CONFIG_CFLAGS = $(BSWAP_CFLAGS) \ |
90 | $(ENDIAN_CFLAGS) \ | |
91 | $(HOSTENDIAN_CFLAGS) \ | |
92 | $(SMP_CFLAGS) \ | |
1dc7c0ed | 93 | $(XOR_ENDIAN_CFLAGS) \ |
c494cadd MM |
94 | $(BITSIZE_CFLAGS) \ |
95 | $(HOSTBITSIZE_CFLAGS) \ | |
96 | $(ENV_CFLAGS) \ | |
056e975c MM |
97 | $(TIMEBASE_CFLAGS) \ |
98 | $(ALIGNMENT_CFLAGS) \ | |
c494cadd MM |
99 | $(FLOAT_CFLAGS) \ |
100 | $(TRACE_CFLAGS) \ | |
101 | $(ASSERT_CFLAGS) \ | |
28816f45 | 102 | $(RESERVED_CFLAGS) \ |
73c4941b | 103 | $(MONITOR_CFLAGS) \ |
d6103e8e | 104 | $(MODEL_CFLAGS) \ |
30c87b55 MM |
105 | $(STDIO_CFLAGS) \ |
106 | $(TERMIO_CFLAGS) | |
c494cadd | 107 | |
ba62bb1c MM |
108 | STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) |
109 | NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) | |
30c87b55 | 110 | BUILD_CFLAGS = -O $(INCLUDES) $(WARNING_CFLAGS) |
08dc78ad MM |
111 | |
112 | BUILD_LDFLAGS = | |
ba62bb1c | 113 | |
c494cadd MM |
114 | CONFIG_FILE = @sim_config@ |
115 | IGEN_OPCODE_RULES = @sim_opcode@ | |
116 | IGEN_DUPLICATE = @sim_dup@ | |
30c87b55 | 117 | IGEN_JUMP = @sim_jump@ |
c494cadd MM |
118 | IGEN_FILTER = @sim_filter@ |
119 | IGEN_ICACHE = @sim_icache@ | |
30c87b55 MM |
120 | IGEN_SMP = @sim_igen_smp@ |
121 | IGEN_LINE_NR = @sim_line_nr@ | |
c494cadd MM |
122 | DGEN_FLAGS = @sim_switch@ |
123 | ||
8b3797aa MM |
124 | HDEFINES = @HDEFINES@ |
125 | TDEFINES = | |
30c87b55 | 126 | IGEN_FLAGS = $(IGEN_DUPLICATE) $(IGEN_JUMP) $(IGEN_FILTER) $(IGEN_ICACHE) $(IGEN_SMP) $(IGEN_LINE_NR) |
cb7a6892 MM |
127 | |
128 | .NOEXPORT: | |
129 | MAKEOVERRIDES= | |
130 | ||
131 | LIB_INCLUDES = -I$(srcdir)/../../include | |
132 | BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd | |
133 | GDB_INCLUDES = -I../../gdb -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config -I$(srcdir)/../../mmalloc | |
134 | INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) | |
135 | ||
cb7a6892 MM |
136 | LIBIBERTY_LIB = ../../libiberty/libiberty.a |
137 | BFD_LIB = ../../bfd/libbfd.a | |
138 | ||
c143ef62 | 139 | TARGETLIB = libsim.a |
cb7a6892 | 140 | |
8e20a3ac | 141 | all: run $(TARGETLIB) $(GDB_OBJ) |
cb7a6892 MM |
142 | |
143 | .c.o: | |
ba62bb1c | 144 | $(CC) -c $(STD_CFLAGS) $< |
cb7a6892 MM |
145 | |
146 | ||
147 | ||
148 | BASICS_H = \ | |
979c3c25 | 149 | basics.h \ |
cb7a6892 | 150 | config.h \ |
8b3797aa | 151 | ppc-config.h \ |
979c3c25 MM |
152 | inline.h \ |
153 | sim_callbacks.h \ | |
154 | debug.h filter_filename.h \ | |
cb7a6892 | 155 | words.h \ |
cb7a6892 | 156 | bits.h \ |
979c3c25 | 157 | sim-endian.h |
cb7a6892 MM |
158 | |
159 | PSIM_H = \ | |
160 | psim.h \ | |
161 | $(BASICS_H) | |
162 | ||
163 | IDECODE_H = \ | |
164 | idecode.h \ | |
cb7a6892 MM |
165 | idecode_expression.h \ |
166 | idecode_branch.h \ | |
167 | idecode_fields.h \ | |
168 | icache.h | |
169 | ||
170 | REGISTERS_H = \ | |
171 | registers.h \ | |
172 | spreg.h | |
173 | ||
174 | CPU_H = \ | |
175 | cpu.h \ | |
176 | $(BASICS_H) \ | |
177 | $(REGISTERS_H) \ | |
30c87b55 | 178 | $(IDECODE_H) \ |
979c3c25 | 179 | device.h \ |
01860b7e | 180 | corefile.h \ |
cb7a6892 MM |
181 | vm.h \ |
182 | events.h \ | |
183 | interrupts.h \ | |
184 | psim.h \ | |
5b4d72dd | 185 | itable.h \ |
73c4941b | 186 | mon.h \ |
28816f45 | 187 | model.h |
5b4d72dd | 188 | |
979c3c25 MM |
189 | DEVICE_TABLE_H = \ |
190 | $(BASICS_H) \ | |
191 | device_table.h \ | |
08dc78ad MM |
192 | device.h \ |
193 | hw.h | |
979c3c25 | 194 | |
5b4d72dd MM |
195 | EMUL_GENERIC_H = \ |
196 | $(CPU_H) \ | |
197 | $(IDECODE_H) \ | |
198 | emul_generic.h \ | |
199 | os_emul.h | |
cb7a6892 MM |
200 | |
201 | ||
202 | INLINE = \ | |
203 | inline.h \ | |
204 | inline.c | |
205 | ||
73c4941b | 206 | BUILT_SRC_WO_CONFIG = \ |
30c87b55 MM |
207 | icache.h icache.c \ |
208 | support.h support.c \ | |
cb7a6892 MM |
209 | idecode.h idecode.c \ |
210 | semantics.h semantics.c \ | |
5b4d72dd | 211 | itable.h itable.c \ |
28816f45 | 212 | spreg.h spreg.c \ |
08dc78ad | 213 | model.h model.c \ |
30c87b55 | 214 | support.h support.c \ |
78c09e4a | 215 | pk.h \ |
08dc78ad MM |
216 | hw.h hw.c \ |
217 | filter_host.c | |
73c4941b MM |
218 | |
219 | BUILT_SRC = \ | |
220 | $(BUILT_SRC_WO_CONFIG) \ | |
8b3797aa | 221 | config.h \ |
5b4d72dd | 222 | ppc-config.h |
cb7a6892 MM |
223 | |
224 | LIB_SRC = \ | |
225 | psim.c \ | |
226 | bits.c \ | |
cb7a6892 | 227 | debug.c \ |
73c4941b MM |
228 | sim-endian.c \ |
229 | sim-endian.h \ | |
230 | sim-endian-n.h \ | |
cb7a6892 | 231 | vm.c \ |
73c4941b | 232 | vm_n.h \ |
01860b7e | 233 | corefile.c \ |
cb7a6892 | 234 | events.c \ |
5b4d72dd MM |
235 | os_emul.c \ |
236 | emul_generic.c \ | |
237 | emul_netbsd.c \ | |
88f1eac4 | 238 | emul_unix.c \ |
979c3c25 MM |
239 | emul_chirp.c \ |
240 | emul_bugapi.c \ | |
cb7a6892 MM |
241 | registers.c \ |
242 | cpu.c \ | |
243 | interrupts.c \ | |
979c3c25 MM |
244 | device.c \ |
245 | device_table.c \ | |
246 | cap.c \ | |
c5addc19 | 247 | mon.c \ |
08dc78ad | 248 | options.c \ |
78c09e4a | 249 | $(PACKAGE_SRC) \ |
08dc78ad | 250 | $(HW_SRC) |
cb7a6892 MM |
251 | |
252 | MAIN_SRC = \ | |
253 | main.c \ | |
254 | sim_calls.c | |
255 | ||
256 | ||
5b4d72dd MM |
257 | # NOTE: semantics, idecode and psim put last so smaller files are compiled |
258 | # first | |
cb7a6892 MM |
259 | LIB_OBJ = \ |
260 | debug.o \ | |
c143ef62 | 261 | filter_filename.o \ |
cb7a6892 | 262 | bits.o \ |
73c4941b | 263 | sim-endian.o \ |
5b4d72dd MM |
264 | os_emul.o \ |
265 | emul_generic.o \ | |
266 | emul_netbsd.o \ | |
88f1eac4 | 267 | emul_unix.o \ |
979c3c25 MM |
268 | emul_chirp.o \ |
269 | emul_bugapi.o \ | |
cb7a6892 | 270 | registers.o \ |
cb7a6892 | 271 | vm.o \ |
01860b7e | 272 | corefile.o \ |
28816f45 | 273 | model.o \ |
cb7a6892 MM |
274 | spreg.o \ |
275 | cpu.o \ | |
276 | interrupts.o \ | |
277 | events.o \ | |
979c3c25 MM |
278 | cap.o \ |
279 | device.o \ | |
280 | device_table.o \ | |
5b4d72dd MM |
281 | itable.o \ |
282 | mon.o \ | |
30c87b55 | 283 | icache.o \ |
cb7a6892 MM |
284 | semantics.o \ |
285 | idecode.o \ | |
30c87b55 | 286 | support.o \ |
979c3c25 | 287 | psim.o \ |
08dc78ad | 288 | options.o \ |
30c87b55 MM |
289 | $(PACKAGE_OBJ) \ |
290 | $(HW_OBJ) | |
cb7a6892 MM |
291 | |
292 | ||
293 | GDB_OBJ = sim_calls.o | |
294 | ||
08dc78ad MM |
295 | HW_SRC = \ |
296 | hw_cpu.c \ | |
297 | hw_memory.c \ | |
298 | hw_nvram.c \ | |
299 | hw_iobus.c \ | |
78c09e4a JM |
300 | hw_htab.c \ |
301 | hw_disk.c \ | |
302 | hw_trace.c \ | |
303 | hw_register.c \ | |
304 | hw_vm.c \ | |
305 | hw_init.c \ | |
30c87b55 | 306 | hw_core.c \ |
08dc78ad MM |
307 | hw_pal.c |
308 | ||
30c87b55 | 309 | HW_OBJ = \ |
08dc78ad MM |
310 | hw_cpu.o \ |
311 | hw_memory.o \ | |
312 | hw_nvram.o \ | |
313 | hw_iobus.o \ | |
78c09e4a JM |
314 | hw_htab.o \ |
315 | hw_disk.o \ | |
316 | hw_trace.o \ | |
317 | hw_register.o \ | |
318 | hw_vm.o \ | |
319 | hw_init.o \ | |
30c87b55 | 320 | hw_core.o \ |
08dc78ad MM |
321 | hw_pal.o |
322 | ||
78c09e4a JM |
323 | PACKAGE_SRC = \ |
324 | pk_disklabel.c | |
325 | ||
30c87b55 | 326 | PACKAGE_OBJ = \ |
78c09e4a JM |
327 | pk_disklabel.o |
328 | ||
cb7a6892 | 329 | |
8e20a3ac | 330 | psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) |
ba62bb1c | 331 | $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS) |
cb7a6892 MM |
332 | |
333 | run: psim | |
334 | rm -f run | |
335 | ln psim run | |
336 | ||
30c87b55 | 337 | $(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-pk $(LIB_OBJ) $(GDB_OBJ) |
cb7a6892 MM |
338 | rm -f $(TARGETLIB) |
339 | $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ) | |
340 | $(RANLIB) $(TARGETLIB) | |
341 | ||
9f5912cb MM |
342 | # Given that inlines are turned on now, rebuild psim whenever |
343 | # anything changes. | |
c143ef62 | 344 | psim.o: psim.c psim.h $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) |
cb7a6892 | 345 | |
5b4d72dd | 346 | bits.o: bits.c $(BASICS_H) |
cb7a6892 MM |
347 | |
348 | debug.o: debug.c $(BASICS_H) | |
1dc7c0ed | 349 | filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h |
cb7a6892 | 350 | |
73c4941b | 351 | sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H) |
cb7a6892 | 352 | |
88f1eac4 | 353 | os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H) |
5b4d72dd | 354 | emul_generic.o: emul_generic.c $(EMUL_GENERIC_H) |
979c3c25 | 355 | |
5b4d72dd | 356 | emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H) |
88f1eac4 | 357 | emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H) |
d6103e8e | 358 | emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H) |
979c3c25 | 359 | emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H) |
cb7a6892 MM |
360 | |
361 | registers.o: registers.c $(REGISTERS_H) $(BASICS_H) | |
362 | ||
363 | cpu.o: cpu.c $(CPU_H) $(IDECODE_H) | |
364 | ||
5b4d72dd | 365 | interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h |
cb7a6892 MM |
366 | |
367 | idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h | |
ba62bb1c | 368 | $(CC) -c $(NOWARN_CFLAGS) $< |
cb7a6892 | 369 | |
cb7a6892 MM |
370 | # double.o: double.c dp-bit.c |
371 | ||
8e20a3ac | 372 | vm.o: vm.c vm.h vm_n.h $(BASICS_H) $(REGISTERS_H) \ |
979c3c25 | 373 | device.h corefile.h interrupts.h itable.h mon.h |
cb7a6892 | 374 | |
08dc78ad | 375 | corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) $(DEVICE_TABLE_H) |
73c4941b | 376 | |
28816f45 MM |
377 | model.o: model.c $(CPU_H) |
378 | ||
cb7a6892 MM |
379 | events.o: events.c events.h $(BASICS_H) |
380 | ||
979c3c25 | 381 | sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h |
cb7a6892 | 382 | |
88f1eac4 | 383 | spreg.o: spreg.c spreg.h spreg.c $(BASICS_H) |
cb7a6892 | 384 | |
979c3c25 | 385 | main.o: main.c $(PSIM_H) itable.h options.h |
cb7a6892 | 386 | |
d6103e8e | 387 | device.o: device.c $(DEVICE_TABLE_H) cap.h |
cb7a6892 | 388 | |
08dc78ad | 389 | device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c |
979c3c25 MM |
390 | |
391 | cap.o: cap.c cap.h $(BASICS_H) | |
cb7a6892 MM |
392 | |
393 | semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H) | |
ba62bb1c | 394 | $(CC) -c $(NOWARN_CFLAGS) $< |
cb7a6892 | 395 | |
30c87b55 MM |
396 | icache.o: icache.c icache.h $(IDECODE_H) $(CPU_H) |
397 | $(CC) -c $(NOWARN_CFLAGS) $< | |
398 | ||
399 | support.o: support.c support.h $(IDECODE_H) $(CPU_H) | |
400 | ||
5b4d72dd MM |
401 | itable.o: itable.c itable.h |
402 | ||
73c4941b | 403 | mon.o: mon.c $(CPU_H) |
cb7a6892 | 404 | |
ba62bb1c MM |
405 | # Rebuild options whenever something changes so the date/time is up to date. |
406 | options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile | |
407 | $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $< | |
c5addc19 | 408 | |
cb7a6892 MM |
409 | # |
410 | # Rules to create the built c source code files | |
411 | # | |
412 | ||
8b3797aa MM |
413 | ppc-config.h: $(CONFIG_FILE) |
414 | cp $(srcdir)/$(CONFIG_FILE) ppc-config.h | |
cb7a6892 MM |
415 | |
416 | ||
5b4d72dd MM |
417 | tmp-dgen: dgen ppc-spr-table $(srcdir)/../../move-if-change |
418 | ./dgen $(DGEN_FLAGS) \ | |
419 | -r $(srcdir)/ppc-spr-table \ | |
30c87b55 MM |
420 | -n spreg.h -hp tmp-spreg.h \ |
421 | -n spreg.c -p tmp-spreg.c | |
5b4d72dd MM |
422 | $(srcdir)/../../move-if-change tmp-spreg.h spreg.h |
423 | $(srcdir)/../../move-if-change tmp-spreg.c spreg.c | |
424 | touch tmp-dgen | |
425 | ||
426 | ||
30c87b55 | 427 | tmp-igen: igen ppc-instructions $(IGEN_OPCODE_RULES) ppc-cache-rules $(srcdir)/../../move-if-change tmp-ld-decode tmp-ld-cache tmp-ld-insn tmp-filter |
5b4d72dd MM |
428 | ./igen $(IGEN_FLAGS) \ |
429 | -o $(srcdir)/$(IGEN_OPCODE_RULES) \ | |
430 | -k $(srcdir)/ppc-cache-rules \ | |
431 | -i $(srcdir)/ppc-instructions \ | |
30c87b55 MM |
432 | -n icache.h -hc tmp-icache.h \ |
433 | -n icache.c -c tmp-icache.c \ | |
434 | -n semantics.h -hs tmp-semantics.h \ | |
435 | -n semantics.c -s tmp-semantics.c \ | |
436 | -n idecode.h -hd tmp-idecode.h \ | |
437 | -n idecode.c -d tmp-idecode.c \ | |
438 | -n itable.h -ht tmp-itable.h \ | |
439 | -n itable.c -t tmp-itable.c \ | |
440 | -n model.h -hm tmp-model.h \ | |
441 | -n model.c -m tmp-model.c \ | |
442 | -n support.h -hf tmp-support.h \ | |
443 | -n support.c -f tmp-support.c | |
cb7a6892 | 444 | $(srcdir)/../../move-if-change tmp-icache.h icache.h |
30c87b55 | 445 | $(srcdir)/../../move-if-change tmp-icache.c icache.c |
cb7a6892 MM |
446 | $(srcdir)/../../move-if-change tmp-idecode.h idecode.h |
447 | $(srcdir)/../../move-if-change tmp-idecode.c idecode.c | |
448 | $(srcdir)/../../move-if-change tmp-semantics.h semantics.h | |
449 | $(srcdir)/../../move-if-change tmp-semantics.c semantics.c | |
5b4d72dd MM |
450 | $(srcdir)/../../move-if-change tmp-itable.h itable.h |
451 | $(srcdir)/../../move-if-change tmp-itable.c itable.c | |
28816f45 MM |
452 | $(srcdir)/../../move-if-change tmp-model.h model.h |
453 | $(srcdir)/../../move-if-change tmp-model.c model.c | |
30c87b55 MM |
454 | $(srcdir)/../../move-if-change tmp-support.h support.h |
455 | $(srcdir)/../../move-if-change tmp-support.c support.c | |
5b4d72dd | 456 | touch tmp-igen |
cb7a6892 | 457 | |
8e20a3ac MM |
458 | # NOTE: Some versions of make don't handle files created as side-effects |
459 | # uncomment the below if that is the case. | |
e61900e6 MM |
460 | |
461 | $(TARGETLIB): tmp-igen tmp-dgen | |
30c87b55 | 462 | itable.h itable.c icache.h icache.c idecode.h idecode.c semantics.h semantics.c model.h model.c support.h support.c: tmp-igen |
e61900e6 | 463 | spreg.h spreg.c: tmp-dgen |
cb7a6892 | 464 | |
08dc78ad | 465 | dgen: dgen.o table.o lf.o misc.o filter_host.o |
88f1eac4 | 466 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS) |
08dc78ad | 467 | |
30c87b55 MM |
468 | igen: igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o |
469 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o ld-decode.o ld-cache.o filter.o ld-insn.o gen-model.o gen-itable.o gen-icache.o gen-semantics.o gen-idecode.o gen-support.o $(BUILD_LIBS) | |
08dc78ad MM |
470 | |
471 | filter_host.c: filter_filename.c | |
472 | cat $(srcdir)/filter_filename.c > filter_host.c | |
473 | ||
474 | filter_host.o: filter_host.c filter_filename.h config.h ppc-config.h | |
475 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c | |
cb7a6892 | 476 | |
08dc78ad MM |
477 | table.o: table.c misc.h filter_filename.h lf.h table.h |
478 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c | |
479 | ||
480 | lf.o: lf.c misc.h filter_filename.h lf.h | |
481 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c | |
482 | ||
30c87b55 MM |
483 | filter.o: filter.c misc.h lf.h table.h filter.h |
484 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/filter.c | |
485 | tmp-filter: filter.c misc.h misc.o | |
486 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-filter -DMAIN $(srcdir)/filter.c misc.o $(BUILD_LIBS) | |
487 | ||
488 | ld-decode.o: ld-decode.c misc.h lf.h table.h ld-decode.h | |
489 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-decode.c | |
490 | tmp-ld-decode: ld-decode.o misc.o lf.o table.o filter_host.o | |
491 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-decode -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS) | |
492 | ||
493 | ld-cache.o: ld-cache.c misc.h lf.h table.h ld-cache.h | |
494 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-cache.c | |
495 | tmp-ld-cache: ld-cache.o misc.o lf.o table.o filter_host.o | |
496 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-cache -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS) | |
497 | ||
498 | ld-insn.o: ld-insn.c misc.h lf.h table.h ld-insn.h ld-decode.h igen.h | |
499 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-insn.c | |
500 | tmp-ld-insn: ld-insn.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o | |
501 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-insn -DMAIN $(srcdir)/ld-insn.c misc.o lf.o table.o ld-decode.o filter_host.o filter.o $(BUILD_LIBS) | |
502 | ||
503 | gen-model.o: gen-model.c misc.h lf.h table.h gen-model.h ld-decode.h igen.h ld-insn.h | |
504 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-model.c | |
505 | ||
506 | gen-itable.o: gen-itable.c misc.h lf.h table.h gen-itable.h ld-decode.h igen.h ld-insn.h igen.h | |
507 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-itable.c | |
508 | ||
509 | gen-icache.o: gen-icache.c misc.h lf.h table.h gen-icache.h ld-decode.h igen.h ld-insn.h gen-semantics.h gen-idecode.h | |
510 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-icache.c | |
511 | ||
512 | gen-semantics.o: gen-semantics.c misc.h lf.h table.h gen-semantics.h ld-decode.h igen.h ld-insn.h | |
513 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-semantics.c | |
514 | ||
515 | gen-idecode.o: gen-idecode.c misc.h lf.h table.h gen-idecode.h gen-icache.h gen-semantics.h ld-decode.h igen.h ld-insn.h | |
516 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-idecode.c | |
517 | ||
518 | gen-support.o: gen-support.c misc.h lf.h table.h gen-support.h ld-decode.h igen.h ld-insn.h | |
519 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-support.c | |
520 | ||
08dc78ad MM |
521 | dgen.o: dgen.c misc.h filter_filename.h lf.h table.h |
522 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c | |
523 | ||
30c87b55 | 524 | igen.o: igen.c misc.h filter_filename.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-semantics.h gen-support.h igen.h |
08dc78ad | 525 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c |
64415b76 | 526 | |
88f1eac4 | 527 | misc.o: misc.c misc.h filter_filename.h |
08dc78ad MM |
528 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c |
529 | ||
30c87b55 | 530 | |
cb7a6892 | 531 | |
08dc78ad | 532 | # real hardware |
30c87b55 | 533 | tmp-hw: Makefile $(HW_SRC) $(srcdir)/../../move-if-change |
08dc78ad MM |
534 | (cd $(srcdir); ls $(HW_SRC)) \ |
535 | | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ | |
536 | -e 's/^/extern const device_descriptor /' \ | |
537 | -e 's/$$/_device_descriptor\[\];/' \ | |
538 | > tmp-hw.h | |
08dc78ad MM |
539 | (cd $(srcdir); ls $(HW_SRC)) \ |
540 | | sed -e 's/^.*\(hw_.*\)\.c/\1/' \ | |
541 | -e 's/^/ /' \ | |
542 | -e 's/$$/_device_descriptor,/' \ | |
543 | > tmp-hw.c | |
30c87b55 MM |
544 | $(srcdir)/../../move-if-change tmp-hw.h hw.h |
545 | $(srcdir)/../../move-if-change tmp-hw.c hw.c | |
546 | touch tmp-hw | |
547 | ||
08dc78ad MM |
548 | hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) |
549 | hw_memory.o: hw_memory.c $(DEVICE_TABLE_H) | |
550 | hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H) | |
551 | hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H) | |
30c87b55 | 552 | hw_core.o: hw_core.c $(DEVICE_TABLE_H) |
08dc78ad | 553 | hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) |
78c09e4a JM |
554 | hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) |
555 | hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) pk.h | |
556 | hw_trace.o: hw_trace.c $(DEVICE_TABLE_H) | |
557 | hw_register.o: hw_register.c $(DEVICE_TABLE_H) | |
558 | hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) | |
559 | hw_init.o: hw_init.c $(DEVICE_TABLE_H) | |
08dc78ad MM |
560 | # ignore this line, it stops make from getting confused |
561 | ||
562 | ||
30c87b55 | 563 | |
78c09e4a | 564 | # real packages |
30c87b55 | 565 | tmp-pk: Makefile $(PACKAGE_SRC) $(srcdir)/../../move-if-change |
78c09e4a JM |
566 | (cd $(srcdir); ls $(PACKAGE_SRC)) \ |
567 | | sed -e 's/^pk_\(.*\)\.c/\1/' \ | |
568 | -e 's/^/extern package_create_instance_callback pk_/' \ | |
569 | -e 's/$$/_create_instance;/' \ | |
570 | > tmp-pk.h | |
30c87b55 MM |
571 | $(srcdir)/../../move-if-change tmp-pk.h pk.h |
572 | touch tmp-pk | |
78c09e4a JM |
573 | |
574 | pk_disklabel.o: pk.h $(DEVICE_TABLE_H) | |
575 | # ignore this line, it stops make from getting confused | |
576 | ||
30c87b55 MM |
577 | |
578 | ||
cb7a6892 MM |
579 | tags etags: TAGS |
580 | ||
73c4941b | 581 | TAGS: $(BUILT_SRC) |
cb7a6892 MM |
582 | etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC) |
583 | ||
8b3797aa | 584 | clean mostlyclean: |
73c4941b | 585 | rm -f tmp-* *.[oasi] core psim run igen dgen config.log $(BUILT_SRC_WO_CONFIG) |
8b3797aa | 586 | |
979c3c25 | 587 | distclean realclean: clean |
c494cadd | 588 | rm -f TAGS Makefile config.cache config.status config.h stamp-h |
cb7a6892 | 589 | |
979c3c25 | 590 | maintainer-clean: distclean |
52edddb9 | 591 | rm -f *~ *.log ppc-config.h core *.core |
979c3c25 | 592 | |
8b3797aa MM |
593 | Makefile: Makefile.in config.status |
594 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status | |
cb7a6892 | 595 | |
8b3797aa MM |
596 | config.h: stamp-h ; @true |
597 | stamp-h: config.in config.status | |
598 | CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status | |
cb7a6892 | 599 | |
bea95815 | 600 | config.status: configure |
cb7a6892 MM |
601 | $(SHELL) ./config.status --recheck |
602 | ||
603 | install: | |
4f965b81 MM |
604 | $(INSTALL_XFORM) run $(bindir)/run |
605 |