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