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