Statistics
| Branch: | Revision:

root / Makefile.target @ 02eb84d0

History | View | Annotate | Download (17.9 kB)

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