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