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