Statistics
| Branch: | Revision:

root / Makefile.target @ 67c0f08d

History | View | Annotate | Download (16.5 kB)

1 626df76a bellard
include config.mak
2 17759187 aliguori
include $(SRC_PATH)/rules.mak
3 626df76a bellard
4 0b0babc6 bellard
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
5 4fb240a4 bellard
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
6 46dc3881 balrog
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
7 0b0babc6 bellard
#CFLAGS+=-Werror
8 626df76a bellard
LIBS=
9 40293e58 bellard
10 40293e58 bellard
ifdef CONFIG_USER_ONLY
11 40293e58 bellard
# user emulator name
12 40293e58 bellard
QEMU_PROG=qemu-$(TARGET_ARCH2)
13 40293e58 bellard
else
14 1e43adfc bellard
# system emulator name
15 a541f297 bellard
ifeq ($(TARGET_ARCH), i386)
16 40293e58 bellard
QEMU_PROG=qemu$(EXESUF)
17 0db63474 bellard
else
18 40293e58 bellard
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
19 a541f297 bellard
endif
20 de5eaa64 bellard
endif
21 626df76a bellard
22 40293e58 bellard
PROGS=$(QEMU_PROG)
23 626df76a bellard
24 6c041c54 ths
# cc-option
25 c7328801 aliguori
# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
26 6c041c54 ths
27 c7328801 aliguori
cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
28 c7328801 aliguori
              > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
29 6f30fa85 ths
30 40293e58 bellard
HELPER_CFLAGS=
31 40293e58 bellard
32 626df76a bellard
ifeq ($(ARCH),i386)
33 6f30fa85 ths
HELPER_CFLAGS+=-fomit-frame-pointer
34 bc51c5c9 bellard
endif
35 bc51c5c9 bellard
36 d19076fa malc
ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
37 d19076fa malc
translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
38 d19076fa malc
endif
39 d19076fa malc
40 626df76a bellard
ifeq ($(ARCH),sparc)
41 4c050b3f Juan Quintela
  ifneq ($(CONFIG_SOLARIS),y)
42 40293e58 bellard
    HELPER_CFLAGS+=-ffixed-i0
43 3142255c blueswir1
  endif
44 fdbb4691 bellard
endif
45 626df76a bellard
46 626df76a bellard
ifeq ($(ARCH),alpha)
47 626df76a bellard
# Ensure there's only a single GP
48 40293e58 bellard
CFLAGS+=-msmall-data
49 626df76a bellard
endif
50 626df76a bellard
51 626df76a bellard
ifeq ($(ARCH),ia64)
52 40293e58 bellard
CFLAGS+=-mno-sdata
53 83fb7adf bellard
endif
54 83fb7adf bellard
55 6f30fa85 ths
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
56 4a244704 Anthony Liguori
CPPFLAGS+=-U_FORTIFY_SOURCE
57 626df76a bellard
LIBS+=-lm
58 67b915a5 bellard
ifdef CONFIG_WIN32
59 3db38e87 bellard
LIBS+=-lwinmm -lws2_32 -liphlpapi
60 67b915a5 bellard
endif
61 ec530c81 bellard
ifdef CONFIG_SOLARIS
62 ec530c81 bellard
LIBS+=-lsocket -lnsl -lresolv
63 0475a5ca ths
ifdef NEEDS_LIBSUNMATH
64 0475a5ca ths
LIBS+=-lsunmath
65 0475a5ca ths
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
66 40293e58 bellard
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
67 f72b519c bellard
endif
68 831b7825 ths
endif
69 831b7825 ths
70 7ba1e619 aliguori
kvm.o: CFLAGS+=$(KVM_CFLAGS)
71 7ba1e619 aliguori
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
72 7ba1e619 aliguori
73 40293e58 bellard
all: $(PROGS)
74 c2fb2637 Paul Brook
# Dummy command so that make thinks it has done something
75 c2fb2637 Paul Brook
	@true
76 626df76a bellard
77 40293e58 bellard
#########################################################
78 626df76a bellard
# cpu emulator library
79 c9e0df73 Juan Quintela
libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
80 943e0a31 Juan Quintela
libobj-$(CONFIG_KQEMU) += kqemu.o
81 57fec1fe bellard
# TCG code generator
82 c9e0df73 Juan Quintela
libobj-y += tcg/tcg.o tcg/tcg-runtime.o
83 57fec1fe bellard
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
84 8289b279 blueswir1
ifeq ($(ARCH),sparc64)
85 8289b279 blueswir1
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
86 8289b279 blueswir1
endif
87 158142c2 bellard
ifdef CONFIG_SOFTFLOAT
88 c9e0df73 Juan Quintela
libobj-y += fpu/softfloat.o
89 158142c2 bellard
else
90 c9e0df73 Juan Quintela
libobj-y += fpu/softfloat-native.o
91 158142c2 bellard
endif
92 6f30fa85 ths
CPPFLAGS+=-I$(SRC_PATH)/fpu
93 c9e0df73 Juan Quintela
libobj-y += op_helper.o helper.o
94 e95c8d51 bellard
95 b7bcbe95 bellard
ifeq ($(TARGET_BASE_ARCH), arm)
96 c9e0df73 Juan Quintela
libobj-y += neon_helper.o iwmmxt_helper.o
97 e6e5906b pbrook
endif
98 e6e5906b pbrook
99 cf6c1b16 j_mayer
ifeq ($(TARGET_BASE_ARCH), alpha)
100 c9e0df73 Juan Quintela
libobj-y += alpha_palcode.o
101 cf6c1b16 j_mayer
endif
102 cf6c1b16 j_mayer
103 e7daa605 ths
ifeq ($(TARGET_BASE_ARCH), cris)
104 c9e0df73 Juan Quintela
libobj-y += cris-dis.o
105 e7daa605 ths
106 e7daa605 ths
ifndef CONFIG_USER_ONLY
107 c9e0df73 Juan Quintela
libobj-y += mmu.o
108 e7daa605 ths
endif
109 e7daa605 ths
endif
110 e7daa605 ths
111 626df76a bellard
# NOTE: the disassembler code is only needed for debugging
112 c9e0df73 Juan Quintela
libobj-y += disas.o
113 626df76a bellard
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
114 bc51c5c9 bellard
USE_I386_DIS=y
115 bc51c5c9 bellard
endif
116 0b0babc6 bellard
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
117 bc51c5c9 bellard
USE_I386_DIS=y
118 bc51c5c9 bellard
endif
119 943e0a31 Juan Quintela
libobj-$(USE_I386_DIS) += i386-dis.o
120 626df76a bellard
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
121 c9e0df73 Juan Quintela
libobj-y += alpha-dis.o
122 626df76a bellard
endif
123 a2458627 bellard
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
124 c9e0df73 Juan Quintela
libobj-y += ppc-dis.o
125 626df76a bellard
endif
126 72b675ca Edgar E. Iglesias
ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze)
127 c9e0df73 Juan Quintela
libobj-y += microblaze-dis.o
128 72b675ca Edgar E. Iglesias
ifndef CONFIG_USER_ONLY
129 c9e0df73 Juan Quintela
libobj-y += mmu.o
130 72b675ca Edgar E. Iglesias
endif
131 72b675ca Edgar E. Iglesias
endif
132 fbe4f65b ths
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
133 c9e0df73 Juan Quintela
libobj-y += mips-dis.o
134 6af0bf9c bellard
endif
135 64b3ab24 bellard
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
136 c9e0df73 Juan Quintela
libobj-y += sparc-dis.o
137 626df76a bellard
endif
138 626df76a bellard
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
139 c9e0df73 Juan Quintela
libobj-y += arm-dis.o
140 626df76a bellard
endif
141 48024e4a bellard
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
142 c9e0df73 Juan Quintela
libobj-y += m68k-dis.o
143 48024e4a bellard
endif
144 fdf9b3e8 bellard
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
145 c9e0df73 Juan Quintela
libobj-y += sh4-dis.o
146 fdf9b3e8 bellard
endif
147 f54b3f92 aurel32
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
148 c9e0df73 Juan Quintela
libobj-y += hppa-dis.o
149 f54b3f92 aurel32
endif
150 8f860bb8 ths
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
151 c9e0df73 Juan Quintela
libobj-y += s390-dis.o
152 8f860bb8 ths
endif
153 626df76a bellard
154 40293e58 bellard
# libqemu
155 40293e58 bellard
156 c9e0df73 Juan Quintela
libqemu.a: $(libobj-y)
157 40293e58 bellard
158 86e840ee aurel32
translate.o: translate.c cpu.h
159 40293e58 bellard
160 86e840ee aurel32
translate-all.o: translate-all.c cpu.h
161 40293e58 bellard
162 86e840ee aurel32
tcg/tcg.o: cpu.h
163 40293e58 bellard
164 40293e58 bellard
# HELPER_CFLAGS is used for all the code compiled with static register
165 40293e58 bellard
# variables
166 71c4f21f Juan Quintela
op_helper.o: CFLAGS += $(HELPER_CFLAGS)
167 40293e58 bellard
168 807544e2 aliguori
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
169 40293e58 bellard
170 40293e58 bellard
#########################################################
171 40293e58 bellard
# Linux user emulator target
172 40293e58 bellard
173 40293e58 bellard
ifdef CONFIG_LINUX_USER
174 40293e58 bellard
175 3ebdd119 aurel32
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
176 40293e58 bellard
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
177 40293e58 bellard
178 40293e58 bellard
ifeq ($(ARCH),i386)
179 40293e58 bellard
ifdef TARGET_GPROF
180 40293e58 bellard
USE_I386_LD=y
181 40293e58 bellard
endif
182 40293e58 bellard
ifdef CONFIG_STATIC
183 40293e58 bellard
USE_I386_LD=y
184 40293e58 bellard
endif
185 40293e58 bellard
ifdef USE_I386_LD
186 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
187 40293e58 bellard
else
188 40293e58 bellard
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
189 40293e58 bellard
# that the kernel ELF loader considers as an executable. I think this
190 40293e58 bellard
# is the simplest way to make it self virtualizable!
191 40293e58 bellard
LDFLAGS+=-Wl,-shared
192 40293e58 bellard
endif
193 40293e58 bellard
endif
194 40293e58 bellard
195 40293e58 bellard
ifeq ($(ARCH),x86_64)
196 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
197 40293e58 bellard
endif
198 40293e58 bellard
199 40293e58 bellard
ifeq ($(ARCH),ppc)
200 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
201 40293e58 bellard
endif
202 40293e58 bellard
203 810260a8 malc
ifeq ($(ARCH),ppc64)
204 810260a8 malc
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
205 810260a8 malc
endif
206 810260a8 malc
207 40293e58 bellard
ifeq ($(ARCH),s390)
208 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
209 40293e58 bellard
endif
210 40293e58 bellard
211 40293e58 bellard
ifeq ($(ARCH),sparc)
212 40293e58 bellard
# -static is used to avoid g1/g3 usage by the dynamic linker	
213 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
214 40293e58 bellard
endif
215 40293e58 bellard
216 40293e58 bellard
ifeq ($(ARCH),sparc64)
217 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
218 40293e58 bellard
endif
219 40293e58 bellard
220 40293e58 bellard
ifeq ($(ARCH),alpha)
221 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
222 40293e58 bellard
endif
223 40293e58 bellard
224 40293e58 bellard
ifeq ($(ARCH),ia64)
225 40293e58 bellard
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
226 40293e58 bellard
endif
227 40293e58 bellard
228 40293e58 bellard
ifeq ($(ARCH),arm)
229 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
230 40293e58 bellard
endif
231 40293e58 bellard
232 40293e58 bellard
ifeq ($(ARCH),m68k)
233 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
234 40293e58 bellard
endif
235 40293e58 bellard
236 40293e58 bellard
ifeq ($(ARCH),mips)
237 40293e58 bellard
ifeq ($(WORDS_BIGENDIAN),yes)
238 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
239 40293e58 bellard
else
240 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
241 40293e58 bellard
endif
242 40293e58 bellard
endif
243 40293e58 bellard
244 40293e58 bellard
ifeq ($(ARCH),mips64)
245 40293e58 bellard
ifeq ($(WORDS_BIGENDIAN),yes)
246 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
247 40293e58 bellard
else
248 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
249 40293e58 bellard
endif
250 40293e58 bellard
endif
251 40293e58 bellard
252 6d946cda aurel32
# profiling code
253 6d946cda aurel32
ifdef TARGET_GPROF
254 6d946cda aurel32
LDFLAGS+=-p
255 6d946cda aurel32
CFLAGS+=-p
256 6d946cda aurel32
endif
257 6d946cda aurel32
258 a8e492c0 Juan Quintela
obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
259 5f650495 Isaku Yamahata
      elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \
260 5f650495 Isaku Yamahata
      ioport-user.o
261 943e0a31 Juan Quintela
obj-$(TARGET_HAS_BFLT) += flatload.o
262 943e0a31 Juan Quintela
263 40293e58 bellard
ifdef TARGET_HAS_ELFLOAD32
264 40293e58 bellard
elfload32.o: elfload.c
265 40293e58 bellard
endif
266 943e0a31 Juan Quintela
obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
267 40293e58 bellard
268 40293e58 bellard
ifeq ($(TARGET_ARCH), i386)
269 a8e492c0 Juan Quintela
obj-y += vm86.o
270 40293e58 bellard
endif
271 1c872672 Juan Quintela
272 9c1dd99b Juan Quintela
nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
273 9c1dd99b Juan Quintela
nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
274 1c872672 Juan Quintela
obj-arm-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
275 1c872672 Juan Quintela
obj-arm-y += arm-semi.o
276 1c872672 Juan Quintela
277 1c872672 Juan Quintela
obj-m68k-y += m68k-sim.o m68k-semi.o
278 40293e58 bellard
279 40293e58 bellard
# Note: this is a workaround. The real fix is to avoid compiling
280 40293e58 bellard
# cpu_signal_handler() in cpu-exec.c.
281 807544e2 aliguori
signal.o: CFLAGS += $(HELPER_CFLAGS)
282 626df76a bellard
283 16394485 Juan Quintela
ARLIBS=../libqemu_user.a libqemu.a
284 40293e58 bellard
endif #CONFIG_LINUX_USER
285 40293e58 bellard
286 0d35bf2d Anthony Liguori
LIBS+= $(PTHREADLIBS)
287 0d35bf2d Anthony Liguori
LIBS+= $(CLOCKLIBS)
288 0d35bf2d Anthony Liguori
289 40293e58 bellard
#########################################################
290 40293e58 bellard
# Darwin user emulator target
291 40293e58 bellard
292 40293e58 bellard
ifdef CONFIG_DARWIN_USER
293 40293e58 bellard
294 40293e58 bellard
VPATH+=:$(SRC_PATH)/darwin-user
295 40293e58 bellard
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
296 40293e58 bellard
297 40293e58 bellard
# Leave some space for the regular program loading zone
298 40293e58 bellard
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
299 40293e58 bellard
300 40293e58 bellard
LIBS+=-lmx
301 40293e58 bellard
302 a8e492c0 Juan Quintela
obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
303 5f650495 Isaku Yamahata
        gdbstub.o gdbstub-xml.o ioport-user.o
304 40293e58 bellard
305 40293e58 bellard
# Note: this is a workaround. The real fix is to avoid compiling
306 40293e58 bellard
# cpu_signal_handler() in cpu-exec.c.
307 807544e2 aliguori
signal.o: CFLAGS += $(HELPER_CFLAGS)
308 40293e58 bellard
309 16394485 Juan Quintela
ARLIBS=libqemu.a
310 40293e58 bellard
311 40293e58 bellard
endif #CONFIG_DARWIN_USER
312 40293e58 bellard
313 40293e58 bellard
#########################################################
314 84778508 blueswir1
# BSD user emulator target
315 84778508 blueswir1
316 84778508 blueswir1
ifdef CONFIG_BSD_USER
317 84778508 blueswir1
318 84778508 blueswir1
VPATH+=:$(SRC_PATH)/bsd-user
319 84778508 blueswir1
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
320 84778508 blueswir1
321 84778508 blueswir1
ifeq ($(ARCH),i386)
322 84778508 blueswir1
ifdef TARGET_GPROF
323 84778508 blueswir1
USE_I386_LD=y
324 84778508 blueswir1
endif
325 84778508 blueswir1
ifdef CONFIG_STATIC
326 84778508 blueswir1
USE_I386_LD=y
327 84778508 blueswir1
endif
328 84778508 blueswir1
ifdef USE_I386_LD
329 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
330 84778508 blueswir1
else
331 84778508 blueswir1
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
332 84778508 blueswir1
# that the kernel ELF loader considers as an executable. I think this
333 84778508 blueswir1
# is the simplest way to make it self virtualizable!
334 84778508 blueswir1
LDFLAGS+=-Wl,-shared
335 84778508 blueswir1
endif
336 84778508 blueswir1
endif
337 84778508 blueswir1
338 84778508 blueswir1
ifeq ($(ARCH),x86_64)
339 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
340 84778508 blueswir1
endif
341 84778508 blueswir1
342 84778508 blueswir1
ifeq ($(ARCH),ppc)
343 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
344 84778508 blueswir1
endif
345 84778508 blueswir1
346 84778508 blueswir1
ifeq ($(ARCH),ppc64)
347 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
348 84778508 blueswir1
endif
349 84778508 blueswir1
350 84778508 blueswir1
ifeq ($(ARCH),s390)
351 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
352 84778508 blueswir1
endif
353 84778508 blueswir1
354 84778508 blueswir1
ifeq ($(ARCH),sparc)
355 84778508 blueswir1
# -static is used to avoid g1/g3 usage by the dynamic linker
356 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
357 84778508 blueswir1
endif
358 84778508 blueswir1
359 84778508 blueswir1
ifeq ($(ARCH),sparc64)
360 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
361 84778508 blueswir1
endif
362 84778508 blueswir1
363 84778508 blueswir1
ifeq ($(ARCH),alpha)
364 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
365 84778508 blueswir1
endif
366 84778508 blueswir1
367 84778508 blueswir1
ifeq ($(ARCH),ia64)
368 84778508 blueswir1
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
369 84778508 blueswir1
endif
370 84778508 blueswir1
371 84778508 blueswir1
ifeq ($(ARCH),arm)
372 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
373 84778508 blueswir1
endif
374 84778508 blueswir1
375 84778508 blueswir1
ifeq ($(ARCH),m68k)
376 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
377 84778508 blueswir1
endif
378 84778508 blueswir1
379 84778508 blueswir1
ifeq ($(ARCH),mips)
380 84778508 blueswir1
ifeq ($(WORDS_BIGENDIAN),yes)
381 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
382 84778508 blueswir1
else
383 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
384 84778508 blueswir1
endif
385 84778508 blueswir1
endif
386 84778508 blueswir1
387 84778508 blueswir1
ifeq ($(ARCH),mips64)
388 84778508 blueswir1
ifeq ($(WORDS_BIGENDIAN),yes)
389 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
390 84778508 blueswir1
else
391 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
392 84778508 blueswir1
endif
393 84778508 blueswir1
endif
394 84778508 blueswir1
395 a8e492c0 Juan Quintela
obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
396 5f650495 Isaku Yamahata
        gdbstub.o gdbstub-xml.o ioport-user.o
397 a8e492c0 Juan Quintela
obj-y += uaccess.o
398 84778508 blueswir1
399 84778508 blueswir1
# Note: this is a workaround. The real fix is to avoid compiling
400 84778508 blueswir1
# cpu_signal_handler() in cpu-exec.c.
401 807544e2 aliguori
signal.o: CFLAGS += $(HELPER_CFLAGS)
402 84778508 blueswir1
403 16394485 Juan Quintela
ARLIBS=libqemu.a ../libqemu_user.a
404 84778508 blueswir1
405 84778508 blueswir1
endif #CONFIG_BSD_USER
406 84778508 blueswir1
407 84778508 blueswir1
#########################################################
408 40293e58 bellard
# System emulator target
409 40293e58 bellard
ifndef CONFIG_USER_ONLY
410 40293e58 bellard
411 a8e492c0 Juan Quintela
obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
412 32993977 Isaku Yamahata
        gdbstub.o gdbstub-xml.o msix.o ioport.o
413 1fd31ad7 aliguori
# virtio has to be here due to weird dependency between PCI and virtio-net.
414 1fd31ad7 aliguori
# need to fix this properly
415 a8e492c0 Juan Quintela
obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
416 a8e492c0 Juan Quintela
obj-$(CONFIG_KVM) += kvm.o kvm-all.o
417 a3392f9b aliguori
418 40293e58 bellard
LIBS+=-lz
419 1d14ffa9 bellard
ifdef CONFIG_ALSA
420 1d14ffa9 bellard
LIBS += -lasound
421 1d14ffa9 bellard
endif
422 ca9cc28c balrog
ifdef CONFIG_ESD
423 ca9cc28c balrog
LIBS += -lesd
424 ca9cc28c balrog
endif
425 b8e59f18 malc
ifdef CONFIG_PA
426 b8e59f18 malc
LIBS += -lpulse-simple
427 b8e59f18 malc
endif
428 1d14ffa9 bellard
ifdef CONFIG_DSOUND
429 1d14ffa9 bellard
LIBS += -lole32 -ldxguid
430 85571bc7 bellard
endif
431 102a52e4 bellard
ifdef CONFIG_FMOD
432 7aac6cb1 Juan Quintela
LIBS += $(FMOD_LIBS)
433 85571bc7 bellard
endif
434 2f6a1ab0 blueswir1
ifdef CONFIG_OSS
435 6881964c Juan Quintela
LIBS += $(OSS_LIBS)
436 2f6a1ab0 blueswir1
endif
437 4fb240a4 bellard
438 b6271b48 Juan Quintela
sound-obj-y =
439 b6271b48 Juan Quintela
sound-obj-$(CONFIG_SB16) += sb16.o
440 b6271b48 Juan Quintela
sound-obj-$(CONFIG_ES1370) += es1370.o
441 b6271b48 Juan Quintela
sound-obj-$(CONFIG_AC97) += ac97.o
442 b6271b48 Juan Quintela
sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
443 b6271b48 Juan Quintela
sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
444 57a943c4 malc
sound-obj-$(CONFIG_CS4231A) += cs4231a.o
445 b6271b48 Juan Quintela
446 1d14ffa9 bellard
ifdef CONFIG_ADLIB
447 c40e866f malc
adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
448 1d14ffa9 bellard
endif
449 85571bc7 bellard
450 8d5d2d4c ths
ifdef CONFIG_VNC_TLS
451 525061bf Juan Quintela
CPPFLAGS += $(VNC_TLS_CFLAGS)
452 525061bf Juan Quintela
LIBS += $(VNC_TLS_LIBS)
453 8d5d2d4c ths
endif
454 8d5d2d4c ths
455 2f9606b3 aliguori
ifdef CONFIG_VNC_SASL
456 60ddf533 Juan Quintela
CPPFLAGS += $(VNC_SASL_CFLAGS)
457 60ddf533 Juan Quintela
LIBS += $(VNC_SASL_LIBS)
458 2f9606b3 aliguori
endif
459 2f9606b3 aliguori
460 fb599c9a balrog
ifdef CONFIG_BLUEZ
461 ef7635ec Juan Quintela
LIBS += $(BLUEZ_LIBS)
462 fb599c9a balrog
endif
463 fb599c9a balrog
464 e37630ca aliguori
# xen backend driver support
465 943e0a31 Juan Quintela
obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
466 7ed208c4 Juan Quintela
ifeq ($(CONFIG_XEN), y)
467 e37630ca aliguori
  LIBS += $(XEN_LIBS)
468 e37630ca aliguori
endif
469 e37630ca aliguori
470 a594cfbf bellard
# USB layer
471 a8e492c0 Juan Quintela
obj-y += usb-ohci.o
472 a594cfbf bellard
473 a41b2ff2 pbrook
# PCI network cards
474 a8e492c0 Juan Quintela
obj-y += eepro100.o
475 a8e492c0 Juan Quintela
obj-y += ne2000.o
476 a8e492c0 Juan Quintela
obj-y += pcnet.o
477 a8e492c0 Juan Quintela
obj-y += rtl8139.o
478 a8e492c0 Juan Quintela
obj-y += e1000.o
479 a41b2ff2 pbrook
480 9dd986cc Richard W.M. Jones
# Generic watchdog support and some watchdog devices
481 a8e492c0 Juan Quintela
obj-y += wdt_ib700.o wdt_i6300esb.o
482 9dd986cc Richard W.M. Jones
483 a541f297 bellard
# Hardware support
484 9637443f Juan Quintela
obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
485 9637443f Juan Quintela
obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
486 9637443f Juan Quintela
obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
487 9637443f Juan Quintela
obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
488 9637443f Juan Quintela
obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
489 9637443f Juan Quintela
490 9637443f Juan Quintela
ifeq ($(TARGET_BASE_ARCH), i386)
491 b00052e4 balrog
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
492 67b915a5 bellard
endif
493 9637443f Juan Quintela
494 3cbee15b j_mayer
# shared objects
495 9637443f Juan Quintela
obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
496 3cbee15b j_mayer
# PREP target
497 9637443f Juan Quintela
obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
498 9637443f Juan Quintela
obj-ppc-y += prep_pci.o ppc_prep.o
499 3cbee15b j_mayer
# Mac shared devices
500 9637443f Juan Quintela
obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
501 3cbee15b j_mayer
# OldWorld PowerMac
502 9637443f Juan Quintela
obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
503 3cbee15b j_mayer
# NewWorld PowerMac
504 9637443f Juan Quintela
obj-ppc-y += unin_pci.o ppc_newworld.o
505 3cbee15b j_mayer
# PowerPC 4xx boards
506 9637443f Juan Quintela
obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
507 9637443f Juan Quintela
obj-ppc-y += ppc440.o ppc440_bamboo.o
508 74c62ba8 aurel32
# PowerPC E500 boards
509 9637443f Juan Quintela
obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
510 9637443f Juan Quintela
obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
511 9637443f Juan Quintela
512 9637443f Juan Quintela
ifeq ($(TARGET_BASE_ARCH), ppc)
513 9637443f Juan Quintela
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
514 9637443f Juan Quintela
endif
515 9637443f Juan Quintela
516 f652e6af aurel32
ifdef FDT_LIBS
517 9637443f Juan Quintela
obj-ppc-y += device_tree.o
518 f652e6af aurel32
LIBS+= $(FDT_LIBS)
519 f652e6af aurel32
endif
520 9637443f Juan Quintela
521 9637443f Juan Quintela
obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
522 9637443f Juan Quintela
obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
523 9637443f Juan Quintela
obj-mips-y += g364fb.o jazz_led.o dp8393x.o
524 9637443f Juan Quintela
obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
525 9637443f Juan Quintela
obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
526 9637443f Juan Quintela
obj-mips-y += mipsnet.o
527 9637443f Juan Quintela
obj-mips-y += pflash_cfi01.o
528 9637443f Juan Quintela
obj-mips-y += vmware_vga.o
529 9637443f Juan Quintela
530 fbe4f65b ths
ifeq ($(TARGET_BASE_ARCH), mips)
531 4ce7ff6e aurel32
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
532 6af0bf9c bellard
endif
533 72b675ca Edgar E. Iglesias
534 9637443f Juan Quintela
obj-microblaze-y = petalogix_s3adsp1800_mmu.o
535 9637443f Juan Quintela
536 9637443f Juan Quintela
obj-microblaze-y += microblaze_pic_cpu.o
537 9637443f Juan Quintela
obj-microblaze-y += xilinx_intc.o
538 9637443f Juan Quintela
obj-microblaze-y += xilinx_timer.o
539 9637443f Juan Quintela
obj-microblaze-y += xilinx_uartlite.o
540 9637443f Juan Quintela
obj-microblaze-y += xilinx_ethlite.o
541 9637443f Juan Quintela
542 9637443f Juan Quintela
obj-microblaze-y += pflash_cfi02.o
543 72b675ca Edgar E. Iglesias
544 72b675ca Edgar E. Iglesias
ifdef FDT_LIBS
545 9637443f Juan Quintela
obj-microblaze-y += device_tree.o
546 72b675ca Edgar E. Iglesias
LIBS+= $(FDT_LIBS)
547 72b675ca Edgar E. Iglesias
endif
548 9637443f Juan Quintela
549 10c144e2 edgar_igl
# Boards
550 9637443f Juan Quintela
obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
551 10c144e2 edgar_igl
552 10c144e2 edgar_igl
# IO blocks
553 9637443f Juan Quintela
obj-cris-y += etraxfs_dma.o
554 9637443f Juan Quintela
obj-cris-y += etraxfs_pic.o
555 9637443f Juan Quintela
obj-cris-y += etraxfs_eth.o
556 9637443f Juan Quintela
obj-cris-y += etraxfs_timer.o
557 9637443f Juan Quintela
obj-cris-y += etraxfs_ser.o
558 9637443f Juan Quintela
559 9637443f Juan Quintela
obj-cris-y += pflash_cfi02.o
560 e62b5b13 edgar_igl
561 3475187d bellard
ifeq ($(TARGET_ARCH), sparc64)
562 9637443f Juan Quintela
obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
563 9637443f Juan Quintela
obj-sparc-y += fdc.o mc146818rtc.o serial.o
564 9637443f Juan Quintela
obj-sparc-y += cirrus_vga.o parallel.o
565 3475187d bellard
else
566 9637443f Juan Quintela
obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
567 9637443f Juan Quintela
obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
568 9637443f Juan Quintela
obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
569 9637443f Juan Quintela
endif
570 9637443f Juan Quintela
571 9637443f Juan Quintela
obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
572 9637443f Juan Quintela
obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
573 9637443f Juan Quintela
obj-arm-y += versatile_pci.o
574 9637443f Juan Quintela
obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
575 9637443f Juan Quintela
obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
576 9637443f Juan Quintela
obj-arm-y += pl061.o
577 9637443f Juan Quintela
obj-arm-y += arm-semi.o
578 9637443f Juan Quintela
obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
579 9637443f Juan Quintela
obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
580 9637443f Juan Quintela
obj-arm-y += pflash_cfi01.o gumstix.o
581 9637443f Juan Quintela
obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
582 9637443f Juan Quintela
obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
583 9637443f Juan Quintela
obj-arm-y += omap2.o omap_dss.o soc_dma.o
584 9637443f Juan Quintela
obj-arm-y += omap_sx1.o palm.o tsc210x.o
585 9637443f Juan Quintela
obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
586 9637443f Juan Quintela
obj-arm-y += mst_fpga.o mainstone.o
587 9637443f Juan Quintela
obj-arm-y += musicpal.o pflash_cfi02.o
588 9637443f Juan Quintela
obj-arm-y += framebuffer.o
589 9637443f Juan Quintela
obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
590 9637443f Juan Quintela
obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
591 9637443f Juan Quintela
obj-arm-y += syborg_virtio.o
592 9637443f Juan Quintela
593 b5ff1b31 bellard
ifeq ($(TARGET_BASE_ARCH), arm)
594 5a1237c4 balrog
CPPFLAGS += -DHAS_AUDIO
595 b5ff1b31 bellard
endif
596 9637443f Juan Quintela
597 9637443f Juan Quintela
obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
598 9637443f Juan Quintela
obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
599 9637443f Juan Quintela
obj-sh4-y += ide.o
600 9637443f Juan Quintela
601 9637443f Juan Quintela
obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
602 9637443f Juan Quintela
obj-m68k-y += m68k-semi.o dummy_m68k.o
603 9637443f Juan Quintela
604 5b0753e0 bellard
ifdef CONFIG_COCOA
605 1d14ffa9 bellard
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
606 1d14ffa9 bellard
ifdef CONFIG_COREAUDIO
607 1d14ffa9 bellard
COCOA_LIBS+=-framework CoreAudio
608 1d14ffa9 bellard
endif
609 5b0753e0 bellard
endif
610 7c1f25b4 bellard
ifdef CONFIG_SLIRP
611 6f30fa85 ths
CPPFLAGS+=-I$(SRC_PATH)/slirp
612 626df76a bellard
endif
613 626df76a bellard
614 c321f673 bellard
# specific flags are needed for non soft mmu emulator
615 83fb7adf bellard
ifndef CONFIG_DARWIN
616 11d9f695 bellard
ifndef CONFIG_WIN32
617 ec530c81 bellard
ifndef CONFIG_SOLARIS
618 b29fe3ed malc
ifndef CONFIG_AIX
619 40293e58 bellard
LIBS+=-lutil
620 11d9f695 bellard
endif
621 b29fe3ed malc
endif
622 83fb7adf bellard
endif
623 ec530c81 bellard
endif
624 e3086fbf bellard
ifdef TARGET_GPROF
625 40293e58 bellard
vl.o: CFLAGS+=-p
626 40293e58 bellard
LDFLAGS+=-p
627 e3086fbf bellard
endif
628 c321f673 bellard
629 b8076a74 bellard
ifeq ($(ARCH),ia64)
630 40293e58 bellard
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
631 74ccb34e bellard
endif
632 74ccb34e bellard
633 1d14ffa9 bellard
ifdef CONFIG_WIN32
634 1d14ffa9 bellard
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
635 1d14ffa9 bellard
endif
636 1d14ffa9 bellard
637 40293e58 bellard
# profiling code
638 40293e58 bellard
ifdef TARGET_GPROF
639 40293e58 bellard
LDFLAGS+=-p
640 40293e58 bellard
main.o: CFLAGS+=-p
641 6e1b3e4d bellard
endif
642 6e1b3e4d bellard
643 537fe2d6 Anthony Liguori
vl.o: CFLAGS+=$(SDL_CFLAGS)
644 537fe2d6 Anthony Liguori
645 5824d651 blueswir1
vl.o: qemu-options.h
646 5824d651 blueswir1
647 2313086a Blue Swirl
monitor.o: qemu-monitor.h
648 2313086a Blue Swirl
649 16394485 Juan Quintela
LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
650 16394485 Juan Quintela
ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
651 626df76a bellard
652 40293e58 bellard
endif # !CONFIG_USER_ONLY
653 00a67ba1 bellard
654 16394485 Juan Quintela
$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(ARLIBS)
655 16394485 Juan Quintela
	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
656 16394485 Juan Quintela
657 16394485 Juan Quintela
658 56aebc89 pbrook
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
659 56aebc89 pbrook
ifeq ($(TARGET_XML_FILES),)
660 1aef4c57 aurel32
	$(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
661 56aebc89 pbrook
else
662 1aef4c57 aurel32
	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
663 56aebc89 pbrook
endif
664 56aebc89 pbrook
665 5824d651 blueswir1
qemu-options.h: $(SRC_PATH)/qemu-options.hx
666 0d00e563 aliguori
	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
667 5824d651 blueswir1
668 2313086a Blue Swirl
qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx
669 2313086a Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
670 2313086a Blue Swirl
671 626df76a bellard
clean:
672 2313086a Blue Swirl
	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
673 57fec1fe bellard
	rm -f *.d */*.d tcg/*.o
674 2313086a Blue Swirl
	rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c
675 1e43adfc bellard
676 5fafdf24 ths
install: all
677 9b14bb04 bellard
ifneq ($(PROGS),)
678 1625af87 aliguori
	$(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
679 9b14bb04 bellard
endif
680 626df76a bellard
681 2f96c28d j_mayer
# Include automatically generated dependency files
682 2f96c28d j_mayer
-include $(wildcard *.d */*.d)