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