]>
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 | ||
ea785922 | 180 | BASE_CFLAGS+=$(OS_CFLAGS) |
6f30fa85 TS |
181 | OP_CFLAGS+=$(OS_CFLAGS) |
182 | ||
626df76a FB |
183 | ######################################################### |
184 | ||
6f30fa85 | 185 | CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
626df76a | 186 | LIBS+=-lm |
b932caba FB |
187 | ifndef CONFIG_USER_ONLY |
188 | LIBS+=-lz | |
189 | endif | |
67b915a5 | 190 | ifdef CONFIG_WIN32 |
3db38e87 | 191 | LIBS+=-lwinmm -lws2_32 -liphlpapi |
67b915a5 | 192 | endif |
ec530c81 FB |
193 | ifdef CONFIG_SOLARIS |
194 | LIBS+=-lsocket -lnsl -lresolv | |
195 | endif | |
626df76a FB |
196 | |
197 | # profiling code | |
198 | ifdef TARGET_GPROF | |
6f30fa85 TS |
199 | BASE_LDFLAGS+=-p |
200 | main.o: BASE_CFLAGS+=-p | |
626df76a FB |
201 | endif |
202 | ||
831b7825 | 203 | ifdef CONFIG_LINUX_USER |
e5fe0c52 PB |
204 | OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
205 | elfload.o linuxload.o | |
206 | ifdef TARGET_HAS_BFLT | |
207 | OBJS+= flatload.o | |
208 | endif | |
209 | ||
626df76a FB |
210 | ifeq ($(TARGET_ARCH), i386) |
211 | OBJS+= vm86.o | |
212 | endif | |
f72b519c | 213 | ifeq ($(TARGET_ARCH), arm) |
158142c2 | 214 | OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
f72b519c | 215 | nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
a4f81979 | 216 | nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
f72b519c | 217 | endif |
e6e5906b PB |
218 | ifeq ($(TARGET_ARCH), m68k) |
219 | OBJS+= m68k-sim.o m68k-semi.o | |
220 | endif | |
831b7825 TS |
221 | endif #CONFIG_LINUX_USER |
222 | ||
223 | ifdef CONFIG_DARWIN_USER | |
224 | OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o | |
225 | endif | |
226 | ||
626df76a FB |
227 | SRCS:= $(OBJS:.o=.c) |
228 | OBJS+= libqemu.a | |
229 | ||
230 | # cpu emulator library | |
158142c2 | 231 | LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
e3086fbf | 232 | translate.o op.o |
158142c2 FB |
233 | ifdef CONFIG_SOFTFLOAT |
234 | LIBOBJS+=fpu/softfloat.o | |
235 | else | |
236 | LIBOBJS+=fpu/softfloat-native.o | |
237 | endif | |
6f30fa85 | 238 | CPPFLAGS+=-I$(SRC_PATH)/fpu |
626df76a FB |
239 | |
240 | ifeq ($(TARGET_ARCH), i386) | |
1e43adfc | 241 | LIBOBJS+=helper.o helper2.o |
f72b519c FB |
242 | ifeq ($(ARCH), i386) |
243 | LIBOBJS+=translate-copy.o | |
244 | endif | |
626df76a FB |
245 | endif |
246 | ||
0b0babc6 FB |
247 | ifeq ($(TARGET_ARCH), x86_64) |
248 | LIBOBJS+=helper.o helper2.o | |
249 | endif | |
250 | ||
a2458627 | 251 | ifeq ($(TARGET_BASE_ARCH), ppc) |
728c9fd5 | 252 | LIBOBJS+= op_helper.o helper.o |
67867308 FB |
253 | endif |
254 | ||
6af0bf9c FB |
255 | ifeq ($(TARGET_ARCH), mips) |
256 | LIBOBJS+= op_helper.o helper.o | |
257 | endif | |
258 | ||
64b3ab24 | 259 | ifeq ($(TARGET_BASE_ARCH), sparc) |
e95c8d51 FB |
260 | LIBOBJS+= op_helper.o helper.o |
261 | endif | |
262 | ||
b7bcbe95 | 263 | ifeq ($(TARGET_BASE_ARCH), arm) |
b5ff1b31 | 264 | LIBOBJS+= op_helper.o helper.o |
b7bcbe95 FB |
265 | endif |
266 | ||
fdf9b3e8 FB |
267 | ifeq ($(TARGET_BASE_ARCH), sh4) |
268 | LIBOBJS+= op_helper.o helper.o | |
269 | endif | |
270 | ||
e6e5906b PB |
271 | ifeq ($(TARGET_BASE_ARCH), m68k) |
272 | LIBOBJS+= helper.o | |
273 | endif | |
274 | ||
626df76a FB |
275 | # NOTE: the disassembler code is only needed for debugging |
276 | LIBOBJS+=disas.o | |
277 | ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) | |
bc51c5c9 FB |
278 | USE_I386_DIS=y |
279 | endif | |
0b0babc6 | 280 | ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
bc51c5c9 FB |
281 | USE_I386_DIS=y |
282 | endif | |
283 | ifdef USE_I386_DIS | |
626df76a FB |
284 | LIBOBJS+=i386-dis.o |
285 | endif | |
286 | ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) | |
287 | LIBOBJS+=alpha-dis.o | |
288 | endif | |
a2458627 | 289 | ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
626df76a FB |
290 | LIBOBJS+=ppc-dis.o |
291 | endif | |
6af0bf9c FB |
292 | ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
293 | LIBOBJS+=mips-dis.o | |
294 | endif | |
64b3ab24 | 295 | ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
626df76a FB |
296 | LIBOBJS+=sparc-dis.o |
297 | endif | |
298 | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) | |
299 | LIBOBJS+=arm-dis.o | |
300 | endif | |
48024e4a FB |
301 | ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
302 | LIBOBJS+=m68k-dis.o | |
303 | endif | |
fdf9b3e8 FB |
304 | ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
305 | LIBOBJS+=sh4-dis.o | |
306 | endif | |
626df76a | 307 | |
1fddef4b FB |
308 | ifdef CONFIG_GDBSTUB |
309 | OBJS+=gdbstub.o | |
310 | endif | |
626df76a | 311 | |
1e43adfc | 312 | all: $(PROGS) |
626df76a | 313 | |
1e43adfc | 314 | $(QEMU_USER): $(OBJS) |
6f30fa85 | 315 | $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS) |
626df76a FB |
316 | ifeq ($(ARCH),alpha) |
317 | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of | |
318 | # the address space (31 bit so sign extending doesn't matter) | |
319 | echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc | |
320 | endif | |
321 | ||
322 | # must use static linking to avoid leaving stuff in virtual address space | |
aef445bd | 323 | VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
18607dcb | 324 | VL_OBJS+=cutils.o |
83f64091 | 325 | VL_OBJS+=block.o block-raw.o |
42ca6388 | 326 | 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 |
327 | ifdef CONFIG_WIN32 |
328 | VL_OBJS+=tap-win32.o | |
329 | endif | |
a541f297 | 330 | |
1d14ffa9 | 331 | SOUND_HW = sb16.o es1370.o |
7372f88d | 332 | AUDIODRV = audio.o noaudio.o wavaudio.o |
fb065187 FB |
333 | ifdef CONFIG_SDL |
334 | AUDIODRV += sdlaudio.o | |
335 | endif | |
336 | ifdef CONFIG_OSS | |
337 | AUDIODRV += ossaudio.o | |
338 | endif | |
1d14ffa9 FB |
339 | ifdef CONFIG_COREAUDIO |
340 | AUDIODRV += coreaudio.o | |
341 | endif | |
342 | ifdef CONFIG_ALSA | |
343 | AUDIODRV += alsaaudio.o | |
344 | LIBS += -lasound | |
345 | endif | |
346 | ifdef CONFIG_DSOUND | |
347 | AUDIODRV += dsoundaudio.o | |
348 | LIBS += -lole32 -ldxguid | |
85571bc7 | 349 | endif |
102a52e4 | 350 | ifdef CONFIG_FMOD |
85571bc7 | 351 | AUDIODRV += fmodaudio.o |
6f30fa85 | 352 | audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS) |
102a52e4 | 353 | LIBS += $(CONFIG_FMOD_LIB) |
85571bc7 | 354 | endif |
1d14ffa9 FB |
355 | ifdef CONFIG_ADLIB |
356 | SOUND_HW += fmopl.o adlib.o | |
357 | endif | |
ec36b695 | 358 | AUDIODRV+= wavcapture.o |
85571bc7 | 359 | |
2e5d83bb | 360 | # SCSI layer |
7d8406be | 361 | VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
2e5d83bb | 362 | |
a594cfbf | 363 | # USB layer |
2e5d83bb | 364 | VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
a594cfbf | 365 | |
a41b2ff2 | 366 | # PCI network cards |
e3c2613f | 367 | VL_OBJS+= ne2000.o rtl8139.o pcnet.o |
a41b2ff2 | 368 | |
0b0babc6 | 369 | ifeq ($(TARGET_BASE_ARCH), i386) |
a541f297 | 370 | # Hardware support |
a41b2ff2 | 371 | VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
fd06c375 | 372 | VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
502a5395 | 373 | VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o |
3fffc223 | 374 | VL_OBJS+= usb-uhci.o smbus_eeprom.o |
6f30fa85 | 375 | CPPFLAGS += -DHAS_AUDIO |
67b915a5 | 376 | endif |
a2458627 | 377 | ifeq ($(TARGET_BASE_ARCH), ppc) |
a41b2ff2 | 378 | VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
64201201 | 379 | VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
e68b9b2b | 380 | VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
502a5395 | 381 | VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
6f30fa85 | 382 | CPPFLAGS += -DHAS_AUDIO |
a541f297 | 383 | endif |
6af0bf9c | 384 | ifeq ($(TARGET_ARCH), mips) |
4de9b249 | 385 | 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 | 386 | VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o |
5856de80 TS |
387 | VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV) |
388 | DEFINES += -DHAS_AUDIO | |
6af0bf9c | 389 | endif |
64b3ab24 | 390 | ifeq ($(TARGET_BASE_ARCH), sparc) |
3475187d | 391 | ifeq ($(TARGET_ARCH), sparc64) |
502a5395 | 392 | VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
83469015 FB |
393 | VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
394 | VL_OBJS+= cirrus_vga.o parallel.o | |
3475187d | 395 | else |
67e999be FB |
396 | VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
397 | VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o | |
b8174937 | 398 | VL_OBJS+= cs4231.o |
3475187d | 399 | endif |
e95c8d51 | 400 | endif |
b5ff1b31 | 401 | ifeq ($(TARGET_BASE_ARCH), arm) |
cdbdb648 | 402 | VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
16406950 | 403 | VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o |
502a5395 | 404 | VL_OBJS+= versatile_pci.o |
e69954b9 | 405 | VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
8e71621f | 406 | VL_OBJS+= arm-semi.o |
b5ff1b31 | 407 | endif |
fdf9b3e8 FB |
408 | ifeq ($(TARGET_BASE_ARCH), sh4) |
409 | VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o | |
410 | endif | |
a541f297 FB |
411 | ifdef CONFIG_GDBSTUB |
412 | VL_OBJS+=gdbstub.o | |
728c9fd5 | 413 | endif |
626df76a | 414 | ifdef CONFIG_SDL |
6070dd07 | 415 | VL_OBJS+=sdl.o x_keymap.o |
de5eaa64 | 416 | endif |
24236869 | 417 | VL_OBJS+=vnc.o |
5b0753e0 FB |
418 | ifdef CONFIG_COCOA |
419 | VL_OBJS+=cocoa.o | |
1d14ffa9 FB |
420 | COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
421 | ifdef CONFIG_COREAUDIO | |
422 | COCOA_LIBS+=-framework CoreAudio | |
423 | endif | |
5b0753e0 | 424 | endif |
7c1f25b4 | 425 | ifdef CONFIG_SLIRP |
6f30fa85 | 426 | CPPFLAGS+=-I$(SRC_PATH)/slirp |
7c1f25b4 FB |
427 | SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
428 | slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ | |
c7f74643 | 429 | tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
7c1f25b4 | 430 | VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
626df76a FB |
431 | endif |
432 | ||
c321f673 | 433 | VL_LDFLAGS= |
70956b77 | 434 | VL_LIBS=$(AIOLIBS) |
c321f673 | 435 | # specific flags are needed for non soft mmu emulator |
c321f673 FB |
436 | ifdef CONFIG_STATIC |
437 | VL_LDFLAGS+=-static | |
438 | endif | |
de5eaa64 FB |
439 | ifndef CONFIG_SOFTMMU |
440 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld | |
441 | endif | |
83fb7adf | 442 | ifndef CONFIG_DARWIN |
11d9f695 | 443 | ifndef CONFIG_WIN32 |
ec530c81 | 444 | ifndef CONFIG_SOLARIS |
70956b77 | 445 | VL_LIBS+=-lutil |
11d9f695 | 446 | endif |
83fb7adf | 447 | endif |
ec530c81 | 448 | endif |
e3086fbf | 449 | ifdef TARGET_GPROF |
6f30fa85 | 450 | vl.o: BASE_CFLAGS+=-p |
e3086fbf FB |
451 | VL_LDFLAGS+=-p |
452 | endif | |
c321f673 | 453 | |
b8076a74 FB |
454 | ifeq ($(ARCH),ia64) |
455 | VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld | |
456 | endif | |
457 | ||
74ccb34e FB |
458 | ifeq ($(ARCH),sparc64) |
459 | VL_LDFLAGS+=-m64 | |
460 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld | |
461 | endif | |
462 | ||
1d14ffa9 FB |
463 | ifdef CONFIG_WIN32 |
464 | SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole | |
465 | endif | |
466 | ||
1e43adfc | 467 | $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
3a11702b | 468 | $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
5b0753e0 FB |
469 | |
470 | cocoa.o: cocoa.m | |
6f30fa85 | 471 | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
626df76a | 472 | |
3d11d0eb | 473 | sdl.o: sdl.c keymaps.c sdl_keysym.h |
6f30fa85 | 474 | $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
626df76a | 475 | |
24236869 | 476 | vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h |
6f30fa85 | 477 | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
24236869 | 478 | |
9f059eca | 479 | sdlaudio.o: sdlaudio.c |
6f30fa85 | 480 | $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
9f059eca | 481 | |
626df76a | 482 | depend: $(SRCS) |
6f30fa85 | 483 | $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
626df76a | 484 | |
1d14ffa9 | 485 | vldepend: $(VL_OBJS:.o=.c) |
6f30fa85 | 486 | $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
1d14ffa9 | 487 | |
626df76a FB |
488 | # libqemu |
489 | ||
490 | libqemu.a: $(LIBOBJS) | |
491 | rm -f $@ | |
492 | $(AR) rcs $@ $(LIBOBJS) | |
493 | ||
1e43adfc | 494 | translate.o: translate.c gen-op.h opc.h cpu.h |
626df76a | 495 | |
158142c2 FB |
496 | translate-all.o: translate-all.c opc.h cpu.h |
497 | ||
498 | translate-op.o: translate-all.c op.h opc.h cpu.h | |
626df76a | 499 | |
1e43adfc | 500 | op.h: op.o $(DYNGEN) |
626df76a FB |
501 | $(DYNGEN) -o $@ $< |
502 | ||
1e43adfc | 503 | opc.h: op.o $(DYNGEN) |
626df76a FB |
504 | $(DYNGEN) -c -o $@ $< |
505 | ||
1e43adfc | 506 | gen-op.h: op.o $(DYNGEN) |
626df76a FB |
507 | $(DYNGEN) -g -o $@ $< |
508 | ||
1e43adfc | 509 | op.o: op.c |
6f30fa85 | 510 | $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< |
626df76a | 511 | |
6e1b3e4d FB |
512 | # HELPER_CFLAGS is used for all the code compiled with static register |
513 | # variables | |
514 | ifeq ($(TARGET_BASE_ARCH), i386) | |
515 | # XXX: rename helper.c to op_helper.c | |
1e43adfc | 516 | helper.o: helper.c |
6f30fa85 | 517 | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
6e1b3e4d FB |
518 | else |
519 | op_helper.o: op_helper.c | |
6f30fa85 | 520 | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
6e1b3e4d FB |
521 | endif |
522 | ||
523 | cpu-exec.o: cpu-exec.c | |
6f30fa85 | 524 | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
626df76a | 525 | |
00a67ba1 FB |
526 | # Note: this is a workaround. The real fix is to avoid compiling |
527 | # cpu_signal_handler() in cpu-exec.c. | |
528 | signal.o: signal.c | |
6f30fa85 | 529 | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
00a67ba1 | 530 | |
0b0babc6 | 531 | ifeq ($(TARGET_BASE_ARCH), i386) |
664e0f19 | 532 | op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
1e43adfc FB |
533 | endif |
534 | ||
535 | ifeq ($(TARGET_ARCH), arm) | |
536 | op.o: op.c op_template.h | |
bdd5003a | 537 | pl110.o: pl110_template.h |
1e43adfc | 538 | endif |
626df76a | 539 | |
64b3ab24 | 540 | ifeq ($(TARGET_BASE_ARCH), sparc) |
3475187d FB |
541 | op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
542 | magic_load.o: elf_op.h | |
1e43adfc | 543 | endif |
626df76a | 544 | |
a2458627 | 545 | ifeq ($(TARGET_BASE_ARCH), ppc) |
728c9fd5 FB |
546 | op.o: op.c op_template.h op_mem.h |
547 | op_helper.o: op_helper_mem.h | |
3fc6c082 | 548 | translate.o: translate.c translate_init.c |
728c9fd5 FB |
549 | endif |
550 | ||
6af0bf9c | 551 | ifeq ($(TARGET_ARCH), mips) |
c281868e | 552 | op.o: op.c op_template.c fop_template.c op_mem.c |
6af0bf9c FB |
553 | op_helper.o: op_helper_mem.c |
554 | endif | |
555 | ||
5fe141fd FB |
556 | loader.o: loader.c elf_ops.h |
557 | ||
fdf9b3e8 FB |
558 | ifeq ($(TARGET_ARCH), sh4) |
559 | op.o: op.c op_mem.c cpu.h | |
560 | op_helper.o: op_helper.c exec.h cpu.h | |
561 | helper.o: helper.c exec.h cpu.h | |
27c7ca7e FB |
562 | sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
563 | shix.o: shix.c sh7750_regs.h sh7750_regnames.h | |
fdf9b3e8 | 564 | sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
27c7ca7e | 565 | tc58128.o: tc58128.c |
fdf9b3e8 FB |
566 | endif |
567 | ||
214feb51 PB |
568 | $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
569 | ||
626df76a | 570 | %.o: %.c |
6f30fa85 | 571 | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
626df76a | 572 | |
f72b519c | 573 | %.o: %.S |
6f30fa85 | 574 | $(CC) $(CPPFLAGS) -c -o $@ $< |
f72b519c | 575 | |
626df76a | 576 | clean: |
e362b55a | 577 | rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
1e43adfc FB |
578 | |
579 | install: all | |
9b14bb04 | 580 | ifneq ($(PROGS),) |
6a882643 | 581 | $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
9b14bb04 | 582 | endif |
626df76a FB |
583 | |
584 | ifneq ($(wildcard .depend),) | |
585 | include .depend | |
586 | endif | |
1d14ffa9 | 587 | |
c0fe3827 | 588 | ifeq (1, 0) |
1d14ffa9 | 589 | audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
c0fe3827 | 590 | fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
1d14ffa9 FB |
591 | CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
592 | endif |