Statistics
| Branch: | Revision:

root / Makefile.target @ c5d6edc3

History | View | Annotate | Download (12.1 kB)

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