Commit | Line | Data |
---|---|---|
626df76a FB |
1 | include config.mak |
2 | ||
0b0babc6 FB |
3 | TARGET_BASE_ARCH:=$(TARGET_ARCH) |
4 | ifeq ($(TARGET_ARCH), x86_64) | |
5 | TARGET_BASE_ARCH:=i386 | |
6 | endif | |
64b3ab24 FB |
7 | ifeq ($(TARGET_ARCH), sparc64) |
8 | TARGET_BASE_ARCH:=sparc | |
9 | endif | |
0b0babc6 | 10 | TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
85571bc7 | 11 | VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio |
3035f7ff FB |
12 | DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) |
13 | ifdef CONFIG_USER_ONLY | |
14 | VPATH+=:$(SRC_PATH)/linux-user | |
15 | DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) | |
16 | endif | |
ab2572d7 | 17 | CFLAGS=-Wall -O2 -g -fno-strict-aliasing |
0b0babc6 | 18 | #CFLAGS+=-Werror |
626df76a FB |
19 | LDFLAGS=-g |
20 | LIBS= | |
626df76a | 21 | HELPER_CFLAGS=$(CFLAGS) |
67b915a5 | 22 | DYNGEN=../dyngen$(EXESUF) |
1e43adfc | 23 | # user emulator name |
808c4954 FB |
24 | ifeq ($(TARGET_ARCH),arm) |
25 | ifeq ($(TARGET_WORDS_BIGENDIAN),yes) | |
26 | QEMU_USER=qemu-armeb | |
27 | else | |
28 | QEMU_USER=qemu-arm | |
29 | endif | |
30 | else | |
31 | QEMU_USER=qemu-$(TARGET_ARCH) | |
32 | endif | |
1e43adfc FB |
33 | # system emulator name |
34 | ifdef CONFIG_SOFTMMU | |
a541f297 | 35 | ifeq ($(TARGET_ARCH), i386) |
67b915a5 | 36 | QEMU_SYSTEM=qemu$(EXESUF) |
0db63474 | 37 | else |
a541f297 FB |
38 | QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF) |
39 | endif | |
40 | else | |
0db63474 | 41 | QEMU_SYSTEM=qemu-fast |
1e43adfc FB |
42 | endif |
43 | ||
16e9b7de | 44 | ifdef CONFIG_USER_ONLY |
1e43adfc | 45 | PROGS=$(QEMU_USER) |
16e9b7de | 46 | else |
16e9b7de | 47 | ifeq ($(TARGET_ARCH), i386) |
c321f673 FB |
48 | |
49 | ifeq ($(ARCH), i386) | |
50 | PROGS+=$(QEMU_SYSTEM) | |
de5eaa64 FB |
51 | ifndef CONFIG_SOFTMMU |
52 | CONFIG_STATIC=y | |
53 | endif | |
38ca2abc FB |
54 | else |
55 | # the system emulator using soft mmu is portable | |
c321f673 | 56 | ifdef CONFIG_SOFTMMU |
16e9b7de FB |
57 | PROGS+=$(QEMU_SYSTEM) |
58 | endif | |
38ca2abc | 59 | endif # ARCH != i386 |
c321f673 | 60 | |
38ca2abc | 61 | endif # TARGET_ARCH = i386 |
728c9fd5 | 62 | |
0b0babc6 FB |
63 | ifeq ($(TARGET_ARCH), x86_64) |
64 | ifdef CONFIG_SOFTMMU | |
65 | PROGS+=$(QEMU_SYSTEM) | |
66 | endif | |
67 | endif # TARGET_ARCH = x86_64 | |
68 | ||
728c9fd5 FB |
69 | ifeq ($(TARGET_ARCH), ppc) |
70 | ||
71 | ifeq ($(ARCH), ppc) | |
72 | PROGS+=$(QEMU_SYSTEM) | |
73 | endif | |
74 | ||
6af0bf9c FB |
75 | endif # TARGET_ARCH = ppc |
76 | ||
77 | ifeq ($(TARGET_ARCH), mips) | |
78 | ||
728c9fd5 FB |
79 | ifeq ($(ARCH), i386) |
80 | ifdef CONFIG_SOFTMMU | |
81 | PROGS+=$(QEMU_SYSTEM) | |
626df76a | 82 | endif |
728c9fd5 FB |
83 | endif # ARCH = i386 |
84 | ||
0b0babc6 | 85 | ifeq ($(ARCH), x86_64) |
75dfaa1e FB |
86 | ifdef CONFIG_SOFTMMU |
87 | PROGS+=$(QEMU_SYSTEM) | |
88 | endif | |
0b0babc6 | 89 | endif # ARCH = x86_64 |
75dfaa1e | 90 | |
6af0bf9c | 91 | endif # TARGET_ARCH = mips |
e95c8d51 FB |
92 | |
93 | ifeq ($(TARGET_ARCH), sparc) | |
94 | ||
95 | ifeq ($(ARCH), ppc) | |
96 | PROGS+=$(QEMU_SYSTEM) | |
97 | endif | |
98 | ||
99 | ifeq ($(ARCH), i386) | |
100 | ifdef CONFIG_SOFTMMU | |
101 | PROGS+=$(QEMU_SYSTEM) | |
102 | endif | |
103 | endif # ARCH = i386 | |
104 | ||
0b0babc6 | 105 | ifeq ($(ARCH), x86_64) |
e95c8d51 FB |
106 | ifdef CONFIG_SOFTMMU |
107 | PROGS+=$(QEMU_SYSTEM) | |
108 | endif | |
0b0babc6 | 109 | endif # ARCH = x86_64 |
e95c8d51 FB |
110 | |
111 | endif # TARGET_ARCH = sparc | |
64b3ab24 FB |
112 | |
113 | ifeq ($(TARGET_ARCH), sparc64) | |
114 | ifdef CONFIG_SOFTMMU | |
115 | PROGS+=$(QEMU_SYSTEM) | |
116 | endif | |
117 | endif # TARGET_ARCH = sparc64 | |
118 | ||
728c9fd5 | 119 | endif # !CONFIG_USER_ONLY |
626df76a FB |
120 | |
121 | ifdef CONFIG_STATIC | |
122 | LDFLAGS+=-static | |
123 | endif | |
124 | ||
125 | ifeq ($(ARCH),i386) | |
126 | CFLAGS+=-fomit-frame-pointer | |
127 | OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2 | |
128 | ifeq ($(HAVE_GCC3_OPTIONS),yes) | |
3611a29c | 129 | OP_CFLAGS+= -falign-functions=0 -fno-gcse |
626df76a FB |
130 | else |
131 | OP_CFLAGS+= -malign-functions=0 | |
132 | endif | |
3a4739d6 | 133 | |
626df76a | 134 | ifdef TARGET_GPROF |
3a4739d6 FB |
135 | USE_I386_LD=y |
136 | endif | |
137 | ifdef CONFIG_STATIC | |
138 | USE_I386_LD=y | |
139 | endif | |
140 | ifdef USE_I386_LD | |
626df76a FB |
141 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld |
142 | else | |
143 | # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object | |
144 | # that the kernel ELF loader considers as an executable. I think this | |
145 | # is the simplest way to make it self virtualizable! | |
146 | LDFLAGS+=-Wl,-shared | |
147 | endif | |
626df76a FB |
148 | endif |
149 | ||
0b0babc6 | 150 | ifeq ($(ARCH),x86_64) |
bc51c5c9 | 151 | OP_CFLAGS=$(CFLAGS) -falign-functions=0 |
0b0babc6 | 152 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld |
bc51c5c9 FB |
153 | endif |
154 | ||
626df76a | 155 | ifeq ($(ARCH),ppc) |
83fb7adf | 156 | CFLAGS+= -D__powerpc__ |
626df76a FB |
157 | OP_CFLAGS=$(CFLAGS) |
158 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld | |
159 | endif | |
160 | ||
161 | ifeq ($(ARCH),s390) | |
162 | OP_CFLAGS=$(CFLAGS) | |
163 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld | |
164 | endif | |
165 | ||
166 | ifeq ($(ARCH),sparc) | |
167 | CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 | |
168 | LDFLAGS+=-m32 | |
169 | OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 | |
170 | HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat | |
171 | # -static is used to avoid g1/g3 usage by the dynamic linker | |
172 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static | |
173 | endif | |
174 | ||
175 | ifeq ($(ARCH),sparc64) | |
176 | CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 | |
177 | LDFLAGS+=-m64 | |
178 | OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 | |
179 | endif | |
180 | ||
181 | ifeq ($(ARCH),alpha) | |
182 | # -msmall-data is not used because we want two-instruction relocations | |
183 | # for the constant constructions | |
184 | OP_CFLAGS=-Wall -O2 -g | |
185 | # Ensure there's only a single GP | |
186 | CFLAGS += -msmall-data | |
187 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld | |
188 | endif | |
189 | ||
190 | ifeq ($(ARCH),ia64) | |
b8076a74 | 191 | CFLAGS += -mno-sdata |
626df76a | 192 | OP_CFLAGS=$(CFLAGS) |
b8076a74 | 193 | LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
626df76a FB |
194 | endif |
195 | ||
196 | ifeq ($(ARCH),arm) | |
ba68055e | 197 | OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer |
626df76a FB |
198 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld |
199 | endif | |
200 | ||
38e584a0 FB |
201 | ifeq ($(ARCH),m68k) |
202 | OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer | |
203 | LDFLAGS+=-Wl,-T,m68k.ld | |
204 | endif | |
205 | ||
626df76a FB |
206 | ifeq ($(HAVE_GCC3_OPTIONS),yes) |
207 | # very important to generate a return at the end of every operation | |
208 | OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls | |
209 | endif | |
210 | ||
83fb7adf FB |
211 | ifeq ($(CONFIG_DARWIN),yes) |
212 | OP_CFLAGS+= -mdynamic-no-pic | |
e80cfcfc | 213 | LIBS+=-lmx |
83fb7adf FB |
214 | endif |
215 | ||
626df76a FB |
216 | ######################################################### |
217 | ||
d5249393 | 218 | DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
626df76a | 219 | LIBS+=-lm |
b932caba FB |
220 | ifndef CONFIG_USER_ONLY |
221 | LIBS+=-lz | |
222 | endif | |
67b915a5 | 223 | ifdef CONFIG_WIN32 |
3db38e87 | 224 | LIBS+=-lwinmm -lws2_32 -liphlpapi |
67b915a5 | 225 | endif |
626df76a FB |
226 | |
227 | # profiling code | |
228 | ifdef TARGET_GPROF | |
229 | LDFLAGS+=-p | |
230 | main.o: CFLAGS+=-p | |
231 | endif | |
232 | ||
3035f7ff | 233 | OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o |
626df76a FB |
234 | ifeq ($(TARGET_ARCH), i386) |
235 | OBJS+= vm86.o | |
236 | endif | |
f72b519c | 237 | ifeq ($(TARGET_ARCH), arm) |
158142c2 | 238 | OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
f72b519c | 239 | nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
a4f81979 | 240 | nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
f72b519c | 241 | endif |
626df76a FB |
242 | SRCS:= $(OBJS:.o=.c) |
243 | OBJS+= libqemu.a | |
244 | ||
245 | # cpu emulator library | |
158142c2 | 246 | LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
e3086fbf | 247 | translate.o op.o |
158142c2 FB |
248 | ifdef CONFIG_SOFTFLOAT |
249 | LIBOBJS+=fpu/softfloat.o | |
250 | else | |
251 | LIBOBJS+=fpu/softfloat-native.o | |
252 | endif | |
253 | DEFINES+=-I$(SRC_PATH)/fpu | |
626df76a FB |
254 | |
255 | ifeq ($(TARGET_ARCH), i386) | |
1e43adfc | 256 | LIBOBJS+=helper.o helper2.o |
f72b519c FB |
257 | ifeq ($(ARCH), i386) |
258 | LIBOBJS+=translate-copy.o | |
259 | endif | |
626df76a FB |
260 | endif |
261 | ||
0b0babc6 FB |
262 | ifeq ($(TARGET_ARCH), x86_64) |
263 | LIBOBJS+=helper.o helper2.o | |
264 | endif | |
265 | ||
67867308 | 266 | ifeq ($(TARGET_ARCH), ppc) |
728c9fd5 | 267 | LIBOBJS+= op_helper.o helper.o |
67867308 FB |
268 | endif |
269 | ||
6af0bf9c FB |
270 | ifeq ($(TARGET_ARCH), mips) |
271 | LIBOBJS+= op_helper.o helper.o | |
272 | endif | |
273 | ||
64b3ab24 | 274 | ifeq ($(TARGET_BASE_ARCH), sparc) |
e95c8d51 FB |
275 | LIBOBJS+= op_helper.o helper.o |
276 | endif | |
277 | ||
b7bcbe95 FB |
278 | ifeq ($(TARGET_BASE_ARCH), arm) |
279 | LIBOBJS+= op_helper.o | |
280 | endif | |
281 | ||
626df76a FB |
282 | # NOTE: the disassembler code is only needed for debugging |
283 | LIBOBJS+=disas.o | |
284 | ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) | |
bc51c5c9 FB |
285 | USE_I386_DIS=y |
286 | endif | |
0b0babc6 | 287 | ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
bc51c5c9 FB |
288 | USE_I386_DIS=y |
289 | endif | |
290 | ifdef USE_I386_DIS | |
626df76a FB |
291 | LIBOBJS+=i386-dis.o |
292 | endif | |
293 | ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) | |
294 | LIBOBJS+=alpha-dis.o | |
295 | endif | |
296 | ifeq ($(findstring ppc, $(TARGET_ARCH) $(ARCH)),ppc) | |
297 | LIBOBJS+=ppc-dis.o | |
298 | endif | |
6af0bf9c FB |
299 | ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
300 | LIBOBJS+=mips-dis.o | |
301 | endif | |
64b3ab24 | 302 | ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
626df76a FB |
303 | LIBOBJS+=sparc-dis.o |
304 | endif | |
305 | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) | |
306 | LIBOBJS+=arm-dis.o | |
307 | endif | |
308 | ||
309 | ifeq ($(ARCH),ia64) | |
310 | OBJS += ia64-syscall.o | |
311 | endif | |
1fddef4b FB |
312 | ifdef CONFIG_GDBSTUB |
313 | OBJS+=gdbstub.o | |
314 | endif | |
626df76a | 315 | |
1e43adfc | 316 | all: $(PROGS) |
626df76a | 317 | |
1e43adfc | 318 | $(QEMU_USER): $(OBJS) |
626df76a FB |
319 | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
320 | ifeq ($(ARCH),alpha) | |
321 | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of | |
322 | # the address space (31 bit so sign extending doesn't matter) | |
323 | echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc | |
324 | endif | |
325 | ||
326 | # must use static linking to avoid leaving stuff in virtual address space | |
6a0f9e82 | 327 | VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o |
de167e41 | 328 | VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o |
a541f297 | 329 | |
85571bc7 | 330 | SOUND_HW = sb16.o |
7372f88d | 331 | AUDIODRV = audio.o noaudio.o wavaudio.o |
fb065187 FB |
332 | ifdef CONFIG_SDL |
333 | AUDIODRV += sdlaudio.o | |
334 | endif | |
335 | ifdef CONFIG_OSS | |
336 | AUDIODRV += ossaudio.o | |
337 | endif | |
338 | ||
339 | pc.o: DEFINES := -DUSE_SB16 $(DEFINES) | |
85571bc7 | 340 | |
fb065187 | 341 | ifdef CONFIG_ADLIB |
85571bc7 | 342 | SOUND_HW += fmopl.o adlib.o |
85571bc7 FB |
343 | endif |
344 | ||
102a52e4 | 345 | ifdef CONFIG_FMOD |
85571bc7 | 346 | AUDIODRV += fmodaudio.o |
102a52e4 FB |
347 | audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES) |
348 | LIBS += $(CONFIG_FMOD_LIB) | |
85571bc7 FB |
349 | endif |
350 | ||
0b0babc6 | 351 | ifeq ($(TARGET_BASE_ARCH), i386) |
a541f297 | 352 | # Hardware support |
85571bc7 FB |
353 | VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
354 | VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o | |
6508fe59 | 355 | VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o |
67b915a5 | 356 | endif |
728c9fd5 | 357 | ifeq ($(TARGET_ARCH), ppc) |
85571bc7 | 358 | VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
64201201 | 359 | VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
e68b9b2b | 360 | VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
a541f297 | 361 | endif |
6af0bf9c FB |
362 | ifeq ($(TARGET_ARCH), mips) |
363 | VL_OBJS+= mips.o mips_r4k.o dma.o vga.o serial.o #ide.o ne2000.o pckbd.o | |
364 | VL_OBJS+= #i8259.o i8254.o fdc.o m48t59.o | |
365 | endif | |
64b3ab24 | 366 | ifeq ($(TARGET_BASE_ARCH), sparc) |
3475187d FB |
367 | ifeq ($(TARGET_ARCH), sparc64) |
368 | VL_OBJS+= sun4u.o m48t08.o magic-load.o slavio_serial.o | |
369 | else | |
370 | VL_OBJS+= sun4m.o tcx.o lance.o iommu.o m48t08.o magic-load.o slavio_intctl.o slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o | |
371 | endif | |
e95c8d51 | 372 | endif |
a541f297 FB |
373 | ifdef CONFIG_GDBSTUB |
374 | VL_OBJS+=gdbstub.o | |
728c9fd5 | 375 | endif |
626df76a FB |
376 | ifdef CONFIG_SDL |
377 | VL_OBJS+=sdl.o | |
de5eaa64 | 378 | endif |
5b0753e0 FB |
379 | ifdef CONFIG_COCOA |
380 | VL_OBJS+=cocoa.o | |
381 | COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa | |
382 | endif | |
7c1f25b4 FB |
383 | ifdef CONFIG_SLIRP |
384 | DEFINES+=-I$(SRC_PATH)/slirp | |
385 | SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ | |
386 | slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ | |
c7f74643 | 387 | tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
7c1f25b4 | 388 | VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
626df76a FB |
389 | endif |
390 | ||
c321f673 FB |
391 | VL_LDFLAGS= |
392 | # specific flags are needed for non soft mmu emulator | |
c321f673 FB |
393 | ifdef CONFIG_STATIC |
394 | VL_LDFLAGS+=-static | |
395 | endif | |
de5eaa64 FB |
396 | ifndef CONFIG_SOFTMMU |
397 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld | |
398 | endif | |
83fb7adf | 399 | ifndef CONFIG_DARWIN |
11d9f695 FB |
400 | ifndef CONFIG_WIN32 |
401 | VL_LIBS=-lutil | |
402 | endif | |
83fb7adf | 403 | endif |
e3086fbf FB |
404 | ifdef TARGET_GPROF |
405 | vl.o: CFLAGS+=-p | |
406 | VL_LDFLAGS+=-p | |
407 | endif | |
c321f673 | 408 | |
b8076a74 FB |
409 | ifeq ($(ARCH),ia64) |
410 | VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld | |
411 | endif | |
412 | ||
1e43adfc | 413 | $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
5b0753e0 FB |
414 | $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
415 | ||
416 | cocoa.o: cocoa.m | |
417 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< | |
626df76a | 418 | |
3d11d0eb | 419 | sdl.o: sdl.c keymaps.c sdl_keysym.h |
626df76a FB |
420 | $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< |
421 | ||
9f059eca FB |
422 | sdlaudio.o: sdlaudio.c |
423 | $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< | |
424 | ||
626df76a | 425 | depend: $(SRCS) |
16e9b7de | 426 | $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend |
626df76a FB |
427 | |
428 | # libqemu | |
429 | ||
430 | libqemu.a: $(LIBOBJS) | |
431 | rm -f $@ | |
432 | $(AR) rcs $@ $(LIBOBJS) | |
433 | ||
1e43adfc | 434 | translate.o: translate.c gen-op.h opc.h cpu.h |
626df76a | 435 | |
158142c2 FB |
436 | translate-all.o: translate-all.c opc.h cpu.h |
437 | ||
438 | translate-op.o: translate-all.c op.h opc.h cpu.h | |
626df76a | 439 | |
1e43adfc | 440 | op.h: op.o $(DYNGEN) |
626df76a FB |
441 | $(DYNGEN) -o $@ $< |
442 | ||
1e43adfc | 443 | opc.h: op.o $(DYNGEN) |
626df76a FB |
444 | $(DYNGEN) -c -o $@ $< |
445 | ||
1e43adfc | 446 | gen-op.h: op.o $(DYNGEN) |
626df76a FB |
447 | $(DYNGEN) -g -o $@ $< |
448 | ||
1e43adfc | 449 | op.o: op.c |
626df76a FB |
450 | $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
451 | ||
1e43adfc | 452 | helper.o: helper.c |
626df76a FB |
453 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
454 | ||
0b0babc6 | 455 | ifeq ($(TARGET_BASE_ARCH), i386) |
664e0f19 | 456 | op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
1e43adfc FB |
457 | endif |
458 | ||
459 | ifeq ($(TARGET_ARCH), arm) | |
460 | op.o: op.c op_template.h | |
461 | endif | |
626df76a | 462 | |
64b3ab24 | 463 | ifeq ($(TARGET_BASE_ARCH), sparc) |
3475187d FB |
464 | op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
465 | magic_load.o: elf_op.h | |
1e43adfc | 466 | endif |
626df76a | 467 | |
728c9fd5 FB |
468 | ifeq ($(TARGET_ARCH), ppc) |
469 | op.o: op.c op_template.h op_mem.h | |
470 | op_helper.o: op_helper_mem.h | |
471 | endif | |
472 | ||
6af0bf9c FB |
473 | ifeq ($(TARGET_ARCH), mips) |
474 | op.o: op.c op_template.c op_mem.c | |
475 | op_helper.o: op_helper_mem.c | |
476 | endif | |
477 | ||
85571bc7 FB |
478 | mixeng.o: mixeng.c mixeng.h mixeng_template.h |
479 | ||
626df76a FB |
480 | %.o: %.c |
481 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< | |
482 | ||
f72b519c FB |
483 | %.o: %.S |
484 | $(CC) $(DEFINES) -c -o $@ $< | |
485 | ||
626df76a | 486 | clean: |
e362b55a | 487 | rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
1e43adfc FB |
488 | |
489 | install: all | |
9b14bb04 | 490 | ifneq ($(PROGS),) |
11d9f695 | 491 | install -m 755 -s $(PROGS) "$(bindir)" |
9b14bb04 | 492 | endif |
626df76a FB |
493 | |
494 | ifneq ($(wildcard .depend),) | |
495 | include .depend | |
496 | endif |