root / Makefile.target @ ea785922
History | View | Annotate | Download (14.4 kB)
1 |
include config.mak |
---|---|
2 |
|
3 |
TARGET_BASE_ARCH:=$(TARGET_ARCH) |
4 |
ifeq ($(TARGET_ARCH), x86_64) |
5 |
TARGET_BASE_ARCH:=i386 |
6 |
endif |
7 |
ifeq ($(TARGET_ARCH), ppc64) |
8 |
TARGET_BASE_ARCH:=ppc |
9 |
endif |
10 |
ifeq ($(TARGET_ARCH), sparc64) |
11 |
TARGET_BASE_ARCH:=sparc |
12 |
endif |
13 |
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
14 |
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio |
15 |
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) |
16 |
ifdef CONFIG_DARWIN_USER |
17 |
VPATH+=:$(SRC_PATH)/darwin-user |
18 |
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
19 |
endif |
20 |
ifdef CONFIG_LINUX_USER |
21 |
VPATH+=:$(SRC_PATH)/linux-user |
22 |
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) |
23 |
endif |
24 |
BASE_CFLAGS= |
25 |
BASE_LDFLAGS= |
26 |
#CFLAGS+=-Werror |
27 |
LIBS= |
28 |
HELPER_CFLAGS=$(CFLAGS) |
29 |
DYNGEN=../dyngen$(EXESUF) |
30 |
# user emulator name |
31 |
TARGET_ARCH2=$(TARGET_ARCH) |
32 |
ifeq ($(TARGET_ARCH),arm) |
33 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
34 |
TARGET_ARCH2=armeb |
35 |
endif |
36 |
endif |
37 |
ifeq ($(TARGET_ARCH),sh4) |
38 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
39 |
TARGET_ARCH2=sh4eb |
40 |
endif |
41 |
endif |
42 |
ifeq ($(TARGET_ARCH),mips) |
43 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
44 |
TARGET_ARCH2=mipsel |
45 |
endif |
46 |
endif |
47 |
QEMU_USER=qemu-$(TARGET_ARCH2) |
48 |
# system emulator name |
49 |
ifdef CONFIG_SOFTMMU |
50 |
ifeq ($(TARGET_ARCH), i386) |
51 |
QEMU_SYSTEM=qemu$(EXESUF) |
52 |
else |
53 |
QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
54 |
endif |
55 |
else |
56 |
QEMU_SYSTEM=qemu-fast |
57 |
endif |
58 |
|
59 |
ifdef CONFIG_USER_ONLY |
60 |
PROGS=$(QEMU_USER) |
61 |
else |
62 |
PROGS+=$(QEMU_SYSTEM) |
63 |
ifndef CONFIG_SOFTMMU |
64 |
CONFIG_STATIC=y |
65 |
endif |
66 |
endif # !CONFIG_USER_ONLY |
67 |
|
68 |
ifdef CONFIG_STATIC |
69 |
BASE_LDFLAGS+=-static |
70 |
endif |
71 |
|
72 |
# We require -O2 to avoid the stack setup prologue in EXIT_TB |
73 |
OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing |
74 |
|
75 |
ifeq ($(ARCH),i386) |
76 |
HELPER_CFLAGS+=-fomit-frame-pointer |
77 |
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer |
78 |
ifeq ($(HAVE_GCC3_OPTIONS),yes) |
79 |
OP_CFLAGS+= -falign-functions=0 -fno-gcse |
80 |
else |
81 |
OP_CFLAGS+= -malign-functions=0 |
82 |
endif |
83 |
ifdef TARGET_GPROF |
84 |
USE_I386_LD=y |
85 |
endif |
86 |
ifdef CONFIG_STATIC |
87 |
USE_I386_LD=y |
88 |
endif |
89 |
ifdef USE_I386_LD |
90 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
91 |
else |
92 |
ifdef CONFIG_LINUX_USER |
93 |
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
94 |
# that the kernel ELF loader considers as an executable. I think this |
95 |
# is the simplest way to make it self virtualizable! |
96 |
BASE_LDFLAGS+=-Wl,-shared |
97 |
endif |
98 |
endif |
99 |
endif |
100 |
|
101 |
ifeq ($(ARCH),x86_64) |
102 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
103 |
endif |
104 |
|
105 |
ifeq ($(ARCH),ppc) |
106 |
CPPFLAGS+= -D__powerpc__ |
107 |
ifdef CONFIG_LINUX_USER |
108 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
109 |
endif |
110 |
endif |
111 |
|
112 |
ifeq ($(ARCH),s390) |
113 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
114 |
endif |
115 |
|
116 |
ifeq ($(ARCH),sparc) |
117 |
ifeq ($(CONFIG_SOLARIS),yes) |
118 |
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 |
119 |
BASE_LDFLAGS+=-m32 |
120 |
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 |
121 |
else |
122 |
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 |
123 |
BASE_LDFLAGS+=-m32 |
124 |
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 |
125 |
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat |
126 |
# -static is used to avoid g1/g3 usage by the dynamic linker |
127 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
128 |
endif |
129 |
endif |
130 |
|
131 |
ifeq ($(ARCH),sparc64) |
132 |
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
133 |
BASE_LDFLAGS+=-m64 |
134 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
135 |
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0 |
136 |
endif |
137 |
|
138 |
ifeq ($(ARCH),alpha) |
139 |
# -msmall-data is not used for OP_CFLAGS because we want two-instruction |
140 |
# relocations for the constant constructions |
141 |
# Ensure there's only a single GP |
142 |
BASE_CFLAGS+=-msmall-data |
143 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
144 |
endif |
145 |
|
146 |
ifeq ($(ARCH),ia64) |
147 |
BASE_CFLAGS+=-mno-sdata |
148 |
OP_CFLAGS+=-mno-sdata |
149 |
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
150 |
endif |
151 |
|
152 |
ifeq ($(ARCH),arm) |
153 |
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer |
154 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
155 |
endif |
156 |
|
157 |
ifeq ($(ARCH),m68k) |
158 |
OP_CFLAGS+=-fomit-frame-pointer |
159 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
160 |
endif |
161 |
|
162 |
ifeq ($(ARCH),mips) |
163 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
164 |
endif |
165 |
|
166 |
ifeq ($(HAVE_GCC3_OPTIONS),yes) |
167 |
# very important to generate a return at the end of every operation |
168 |
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls |
169 |
endif |
170 |
|
171 |
ifeq ($(CONFIG_DARWIN),yes) |
172 |
LIBS+=-lmx |
173 |
endif |
174 |
|
175 |
ifdef CONFIG_DARWIN_USER |
176 |
# Leave some space for the regular program loading zone |
177 |
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 |
178 |
endif |
179 |
|
180 |
BASE_CFLAGS+=$(OS_CFLAGS) |
181 |
OP_CFLAGS+=$(OS_CFLAGS) |
182 |
|
183 |
######################################################### |
184 |
|
185 |
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
186 |
LIBS+=-lm |
187 |
ifndef CONFIG_USER_ONLY |
188 |
LIBS+=-lz |
189 |
endif |
190 |
ifdef CONFIG_WIN32 |
191 |
LIBS+=-lwinmm -lws2_32 -liphlpapi |
192 |
endif |
193 |
ifdef CONFIG_SOLARIS |
194 |
LIBS+=-lsocket -lnsl -lresolv |
195 |
endif |
196 |
|
197 |
# profiling code |
198 |
ifdef TARGET_GPROF |
199 |
BASE_LDFLAGS+=-p |
200 |
main.o: BASE_CFLAGS+=-p |
201 |
endif |
202 |
|
203 |
ifdef CONFIG_LINUX_USER |
204 |
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
205 |
elfload.o linuxload.o |
206 |
ifdef TARGET_HAS_BFLT |
207 |
OBJS+= flatload.o |
208 |
endif |
209 |
|
210 |
ifeq ($(TARGET_ARCH), i386) |
211 |
OBJS+= vm86.o |
212 |
endif |
213 |
ifeq ($(TARGET_ARCH), arm) |
214 |
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
215 |
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
216 |
nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
217 |
endif |
218 |
ifeq ($(TARGET_ARCH), m68k) |
219 |
OBJS+= m68k-sim.o m68k-semi.o |
220 |
endif |
221 |
endif #CONFIG_LINUX_USER |
222 |
|
223 |
ifdef CONFIG_DARWIN_USER |
224 |
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o |
225 |
endif |
226 |
|
227 |
SRCS:= $(OBJS:.o=.c) |
228 |
OBJS+= libqemu.a |
229 |
|
230 |
# cpu emulator library |
231 |
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
232 |
translate.o op.o |
233 |
ifdef CONFIG_SOFTFLOAT |
234 |
LIBOBJS+=fpu/softfloat.o |
235 |
else |
236 |
LIBOBJS+=fpu/softfloat-native.o |
237 |
endif |
238 |
CPPFLAGS+=-I$(SRC_PATH)/fpu |
239 |
|
240 |
ifeq ($(TARGET_ARCH), i386) |
241 |
LIBOBJS+=helper.o helper2.o |
242 |
ifeq ($(ARCH), i386) |
243 |
LIBOBJS+=translate-copy.o |
244 |
endif |
245 |
endif |
246 |
|
247 |
ifeq ($(TARGET_ARCH), x86_64) |
248 |
LIBOBJS+=helper.o helper2.o |
249 |
endif |
250 |
|
251 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
252 |
LIBOBJS+= op_helper.o helper.o |
253 |
endif |
254 |
|
255 |
ifeq ($(TARGET_ARCH), mips) |
256 |
LIBOBJS+= op_helper.o helper.o |
257 |
endif |
258 |
|
259 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
260 |
LIBOBJS+= op_helper.o helper.o |
261 |
endif |
262 |
|
263 |
ifeq ($(TARGET_BASE_ARCH), arm) |
264 |
LIBOBJS+= op_helper.o helper.o |
265 |
endif |
266 |
|
267 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
268 |
LIBOBJS+= op_helper.o helper.o |
269 |
endif |
270 |
|
271 |
ifeq ($(TARGET_BASE_ARCH), m68k) |
272 |
LIBOBJS+= helper.o |
273 |
endif |
274 |
|
275 |
# NOTE: the disassembler code is only needed for debugging |
276 |
LIBOBJS+=disas.o |
277 |
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
278 |
USE_I386_DIS=y |
279 |
endif |
280 |
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
281 |
USE_I386_DIS=y |
282 |
endif |
283 |
ifdef USE_I386_DIS |
284 |
LIBOBJS+=i386-dis.o |
285 |
endif |
286 |
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
287 |
LIBOBJS+=alpha-dis.o |
288 |
endif |
289 |
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
290 |
LIBOBJS+=ppc-dis.o |
291 |
endif |
292 |
ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
293 |
LIBOBJS+=mips-dis.o |
294 |
endif |
295 |
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
296 |
LIBOBJS+=sparc-dis.o |
297 |
endif |
298 |
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
299 |
LIBOBJS+=arm-dis.o |
300 |
endif |
301 |
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
302 |
LIBOBJS+=m68k-dis.o |
303 |
endif |
304 |
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
305 |
LIBOBJS+=sh4-dis.o |
306 |
endif |
307 |
|
308 |
ifdef CONFIG_GDBSTUB |
309 |
OBJS+=gdbstub.o |
310 |
endif |
311 |
|
312 |
all: $(PROGS) |
313 |
|
314 |
$(QEMU_USER): $(OBJS) |
315 |
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS) |
316 |
ifeq ($(ARCH),alpha) |
317 |
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
318 |
# the address space (31 bit so sign extending doesn't matter) |
319 |
echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
320 |
endif |
321 |
|
322 |
# must use static linking to avoid leaving stuff in virtual address space |
323 |
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
324 |
VL_OBJS+=cutils.o |
325 |
VL_OBJS+=block.o block-raw.o |
326 |
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 block-qcow2.o |
327 |
ifdef CONFIG_WIN32 |
328 |
VL_OBJS+=tap-win32.o |
329 |
endif |
330 |
|
331 |
SOUND_HW = sb16.o es1370.o |
332 |
AUDIODRV = audio.o noaudio.o wavaudio.o |
333 |
ifdef CONFIG_SDL |
334 |
AUDIODRV += sdlaudio.o |
335 |
endif |
336 |
ifdef CONFIG_OSS |
337 |
AUDIODRV += ossaudio.o |
338 |
endif |
339 |
ifdef CONFIG_COREAUDIO |
340 |
AUDIODRV += coreaudio.o |
341 |
endif |
342 |
ifdef CONFIG_ALSA |
343 |
AUDIODRV += alsaaudio.o |
344 |
LIBS += -lasound |
345 |
endif |
346 |
ifdef CONFIG_DSOUND |
347 |
AUDIODRV += dsoundaudio.o |
348 |
LIBS += -lole32 -ldxguid |
349 |
endif |
350 |
ifdef CONFIG_FMOD |
351 |
AUDIODRV += fmodaudio.o |
352 |
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS) |
353 |
LIBS += $(CONFIG_FMOD_LIB) |
354 |
endif |
355 |
ifdef CONFIG_ADLIB |
356 |
SOUND_HW += fmopl.o adlib.o |
357 |
endif |
358 |
AUDIODRV+= wavcapture.o |
359 |
|
360 |
# SCSI layer |
361 |
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
362 |
|
363 |
# USB layer |
364 |
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
365 |
|
366 |
# PCI network cards |
367 |
VL_OBJS+= ne2000.o rtl8139.o pcnet.o |
368 |
|
369 |
ifeq ($(TARGET_BASE_ARCH), i386) |
370 |
# Hardware support |
371 |
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
372 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
373 |
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o |
374 |
VL_OBJS+= usb-uhci.o smbus_eeprom.o |
375 |
CPPFLAGS += -DHAS_AUDIO |
376 |
endif |
377 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
378 |
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
379 |
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
380 |
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
381 |
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
382 |
CPPFLAGS += -DHAS_AUDIO |
383 |
endif |
384 |
ifeq ($(TARGET_ARCH), mips) |
385 |
VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o |
386 |
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o |
387 |
VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV) |
388 |
DEFINES += -DHAS_AUDIO |
389 |
endif |
390 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
391 |
ifeq ($(TARGET_ARCH), sparc64) |
392 |
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
393 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
394 |
VL_OBJS+= cirrus_vga.o parallel.o |
395 |
else |
396 |
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
397 |
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o |
398 |
VL_OBJS+= cs4231.o |
399 |
endif |
400 |
endif |
401 |
ifeq ($(TARGET_BASE_ARCH), arm) |
402 |
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
403 |
VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o |
404 |
VL_OBJS+= versatile_pci.o |
405 |
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
406 |
VL_OBJS+= arm-semi.o |
407 |
endif |
408 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
409 |
VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o |
410 |
endif |
411 |
ifdef CONFIG_GDBSTUB |
412 |
VL_OBJS+=gdbstub.o |
413 |
endif |
414 |
ifdef CONFIG_SDL |
415 |
VL_OBJS+=sdl.o x_keymap.o |
416 |
endif |
417 |
VL_OBJS+=vnc.o |
418 |
ifdef CONFIG_COCOA |
419 |
VL_OBJS+=cocoa.o |
420 |
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
421 |
ifdef CONFIG_COREAUDIO |
422 |
COCOA_LIBS+=-framework CoreAudio |
423 |
endif |
424 |
endif |
425 |
ifdef CONFIG_SLIRP |
426 |
CPPFLAGS+=-I$(SRC_PATH)/slirp |
427 |
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
428 |
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ |
429 |
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
430 |
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
431 |
endif |
432 |
|
433 |
VL_LDFLAGS= |
434 |
# specific flags are needed for non soft mmu emulator |
435 |
ifdef CONFIG_STATIC |
436 |
VL_LDFLAGS+=-static |
437 |
endif |
438 |
ifndef CONFIG_SOFTMMU |
439 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
440 |
endif |
441 |
ifndef CONFIG_DARWIN |
442 |
ifndef CONFIG_WIN32 |
443 |
ifndef CONFIG_SOLARIS |
444 |
VL_LIBS=-lutil -lrt |
445 |
endif |
446 |
endif |
447 |
endif |
448 |
ifdef TARGET_GPROF |
449 |
vl.o: BASE_CFLAGS+=-p |
450 |
VL_LDFLAGS+=-p |
451 |
endif |
452 |
|
453 |
ifeq ($(ARCH),ia64) |
454 |
VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
455 |
endif |
456 |
|
457 |
ifeq ($(ARCH),sparc64) |
458 |
VL_LDFLAGS+=-m64 |
459 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld |
460 |
endif |
461 |
|
462 |
ifdef CONFIG_WIN32 |
463 |
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
464 |
endif |
465 |
|
466 |
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
467 |
$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
468 |
|
469 |
cocoa.o: cocoa.m |
470 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
471 |
|
472 |
sdl.o: sdl.c keymaps.c sdl_keysym.h |
473 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
474 |
|
475 |
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h |
476 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
477 |
|
478 |
sdlaudio.o: sdlaudio.c |
479 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
480 |
|
481 |
depend: $(SRCS) |
482 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
483 |
|
484 |
vldepend: $(VL_OBJS:.o=.c) |
485 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
486 |
|
487 |
# libqemu |
488 |
|
489 |
libqemu.a: $(LIBOBJS) |
490 |
rm -f $@ |
491 |
$(AR) rcs $@ $(LIBOBJS) |
492 |
|
493 |
translate.o: translate.c gen-op.h opc.h cpu.h |
494 |
|
495 |
translate-all.o: translate-all.c opc.h cpu.h |
496 |
|
497 |
translate-op.o: translate-all.c op.h opc.h cpu.h |
498 |
|
499 |
op.h: op.o $(DYNGEN) |
500 |
$(DYNGEN) -o $@ $< |
501 |
|
502 |
opc.h: op.o $(DYNGEN) |
503 |
$(DYNGEN) -c -o $@ $< |
504 |
|
505 |
gen-op.h: op.o $(DYNGEN) |
506 |
$(DYNGEN) -g -o $@ $< |
507 |
|
508 |
op.o: op.c |
509 |
$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< |
510 |
|
511 |
# HELPER_CFLAGS is used for all the code compiled with static register |
512 |
# variables |
513 |
ifeq ($(TARGET_BASE_ARCH), i386) |
514 |
# XXX: rename helper.c to op_helper.c |
515 |
helper.o: helper.c |
516 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
517 |
else |
518 |
op_helper.o: op_helper.c |
519 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
520 |
endif |
521 |
|
522 |
cpu-exec.o: cpu-exec.c |
523 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
524 |
|
525 |
# Note: this is a workaround. The real fix is to avoid compiling |
526 |
# cpu_signal_handler() in cpu-exec.c. |
527 |
signal.o: signal.c |
528 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
529 |
|
530 |
ifeq ($(TARGET_BASE_ARCH), i386) |
531 |
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
532 |
endif |
533 |
|
534 |
ifeq ($(TARGET_ARCH), arm) |
535 |
op.o: op.c op_template.h |
536 |
pl110.o: pl110_template.h |
537 |
endif |
538 |
|
539 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
540 |
op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
541 |
magic_load.o: elf_op.h |
542 |
endif |
543 |
|
544 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
545 |
op.o: op.c op_template.h op_mem.h |
546 |
op_helper.o: op_helper_mem.h |
547 |
translate.o: translate.c translate_init.c |
548 |
endif |
549 |
|
550 |
ifeq ($(TARGET_ARCH), mips) |
551 |
op.o: op.c op_template.c fop_template.c op_mem.c |
552 |
op_helper.o: op_helper_mem.c |
553 |
endif |
554 |
|
555 |
loader.o: loader.c elf_ops.h |
556 |
|
557 |
ifeq ($(TARGET_ARCH), sh4) |
558 |
op.o: op.c op_mem.c cpu.h |
559 |
op_helper.o: op_helper.c exec.h cpu.h |
560 |
helper.o: helper.c exec.h cpu.h |
561 |
sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
562 |
shix.o: shix.c sh7750_regs.h sh7750_regnames.h |
563 |
sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
564 |
tc58128.o: tc58128.c |
565 |
endif |
566 |
|
567 |
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
568 |
|
569 |
%.o: %.c |
570 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
571 |
|
572 |
%.o: %.S |
573 |
$(CC) $(CPPFLAGS) -c -o $@ $< |
574 |
|
575 |
clean: |
576 |
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
577 |
|
578 |
install: all |
579 |
ifneq ($(PROGS),) |
580 |
$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
581 |
endif |
582 |
|
583 |
ifneq ($(wildcard .depend),) |
584 |
include .depend |
585 |
endif |
586 |
|
587 |
ifeq (1, 0) |
588 |
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
589 |
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
590 |
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
591 |
endif |