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