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