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