Statistics
| Branch: | Revision:

root / Makefile.target @ 7ba1e619

History | View | Annotate | Download (18.8 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 540635ba ths
ifeq ($(TARGET_ARCH), mipsn32)
8 540635ba ths
TARGET_BASE_ARCH:=mips
9 540635ba ths
endif
10 fbe4f65b ths
ifeq ($(TARGET_ARCH), mips64)
11 fbe4f65b ths
TARGET_BASE_ARCH:=mips
12 fbe4f65b ths
endif
13 a2458627 bellard
ifeq ($(TARGET_ARCH), ppc64)
14 a2458627 bellard
TARGET_BASE_ARCH:=ppc
15 a2458627 bellard
endif
16 22f8a8b3 j_mayer
ifeq ($(TARGET_ARCH), ppc64h)
17 22f8a8b3 j_mayer
TARGET_BASE_ARCH:=ppc
18 22f8a8b3 j_mayer
endif
19 d4082e95 j_mayer
ifeq ($(TARGET_ARCH), ppcemb)
20 d4082e95 j_mayer
TARGET_BASE_ARCH:=ppc
21 d4082e95 j_mayer
endif
22 64b3ab24 bellard
ifeq ($(TARGET_ARCH), sparc64)
23 64b3ab24 bellard
TARGET_BASE_ARCH:=sparc
24 64b3ab24 bellard
endif
25 0b0babc6 bellard
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
26 4fb240a4 bellard
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
27 46dc3881 balrog
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
28 0b0babc6 bellard
#CFLAGS+=-Werror
29 626df76a bellard
LIBS=
30 67b915a5 bellard
DYNGEN=../dyngen$(EXESUF)
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 6f30fa85 ths
# We require -O2 to avoid the stack setup prologue in EXIT_TB
76 ac41a620 blueswir1
OP_CFLAGS := -O2 -g -fno-strict-aliasing
77 ac41a620 blueswir1
OP_CFLAGS += -Wall -Wundef -Wendif-labels -Wwrite-strings
78 6c041c54 ths
79 6c041c54 ths
# cc-option
80 6c041c54 ths
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
81 6c041c54 ths
82 6c041c54 ths
cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
83 6c041c54 ths
              > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
84 6c041c54 ths
85 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
86 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
87 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
88 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
89 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
90 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
91 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
92 6c041c54 ths
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
93 1870a74c ths
OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
94 6f30fa85 ths
95 40293e58 bellard
HELPER_CFLAGS=
96 40293e58 bellard
97 626df76a bellard
ifeq ($(ARCH),i386)
98 6f30fa85 ths
HELPER_CFLAGS+=-fomit-frame-pointer
99 6f30fa85 ths
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
100 f2bf094e aurel32
# op.c and helper.c need this on 32-bit x86 system to avoid
101 f2bf094e aurel32
# a compiler spill error. This can probably go away
102 f2bf094e aurel32
# once the SSE ops have been converted to TCG
103 f2bf094e aurel32
ifeq ($(HAVE_GT_GCC_3_3), true)
104 f2bf094e aurel32
I386_CFLAGS=-march=i586 -mtune=i686
105 f2bf094e aurel32
endif
106 bc51c5c9 bellard
endif
107 bc51c5c9 bellard
108 626df76a bellard
ifeq ($(ARCH),ppc)
109 6f30fa85 ths
CPPFLAGS+= -D__powerpc__
110 176a4f29 malc
OP_CFLAGS+= -mlongcall
111 626df76a bellard
endif
112 626df76a bellard
113 626df76a bellard
ifeq ($(ARCH),sparc)
114 40293e58 bellard
  CFLAGS+=-ffixed-g2 -ffixed-g3
115 3142255c blueswir1
  OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
116 3142255c blueswir1
  ifeq ($(CONFIG_SOLARIS),yes)
117 3142255c blueswir1
    OP_CFLAGS+=-fno-omit-frame-pointer
118 3142255c blueswir1
  else
119 40293e58 bellard
    CFLAGS+=-ffixed-g1 -ffixed-g6
120 40293e58 bellard
    HELPER_CFLAGS+=-ffixed-i0
121 3142255c blueswir1
  endif
122 fdbb4691 bellard
endif
123 626df76a bellard
124 626df76a bellard
ifeq ($(ARCH),sparc64)
125 3142255c blueswir1
  OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
126 3142255c blueswir1
  ifneq ($(CONFIG_SOLARIS),yes)
127 e97b640d blueswir1
    CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
128 e97b640d blueswir1
    OP_CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
129 e97b640d blueswir1
  else
130 e97b640d blueswir1
    CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
131 3142255c blueswir1
  endif
132 626df76a bellard
endif
133 626df76a bellard
134 626df76a bellard
ifeq ($(ARCH),alpha)
135 6f30fa85 ths
# -msmall-data is not used for OP_CFLAGS because we want two-instruction
136 6f30fa85 ths
# relocations for the constant constructions
137 626df76a bellard
# Ensure there's only a single GP
138 40293e58 bellard
CFLAGS+=-msmall-data
139 626df76a bellard
endif
140 626df76a bellard
141 f54b3f92 aurel32
ifeq ($(ARCH),hppa)
142 f54b3f92 aurel32
OP_CFLAGS=-O1 -fno-delayed-branch
143 f54b3f92 aurel32
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
144 f54b3f92 aurel32
endif
145 f54b3f92 aurel32
146 626df76a bellard
ifeq ($(ARCH),ia64)
147 40293e58 bellard
CFLAGS+=-mno-sdata
148 6f30fa85 ths
OP_CFLAGS+=-mno-sdata
149 626df76a bellard
endif
150 626df76a bellard
151 626df76a bellard
ifeq ($(ARCH),arm)
152 6f30fa85 ths
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
153 626df76a bellard
endif
154 626df76a bellard
155 38e584a0 bellard
ifeq ($(ARCH),m68k)
156 6f30fa85 ths
OP_CFLAGS+=-fomit-frame-pointer
157 6f30fa85 ths
endif
158 6f30fa85 ths
159 6f30fa85 ths
ifeq ($(ARCH),mips)
160 9617efe8 ths
OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
161 fbe4f65b ths
endif
162 fbe4f65b ths
163 fbe4f65b ths
ifeq ($(ARCH),mips64)
164 9617efe8 ths
OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
165 83fb7adf bellard
endif
166 83fb7adf bellard
167 40293e58 bellard
CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
168 40293e58 bellard
LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
169 3142255c blueswir1
OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
170 626df76a bellard
171 6f30fa85 ths
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
172 626df76a bellard
LIBS+=-lm
173 67b915a5 bellard
ifdef CONFIG_WIN32
174 3db38e87 bellard
LIBS+=-lwinmm -lws2_32 -liphlpapi
175 67b915a5 bellard
endif
176 ec530c81 bellard
ifdef CONFIG_SOLARIS
177 ec530c81 bellard
LIBS+=-lsocket -lnsl -lresolv
178 0475a5ca ths
ifdef NEEDS_LIBSUNMATH
179 0475a5ca ths
LIBS+=-lsunmath
180 0475a5ca ths
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
181 0475a5ca ths
OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
182 40293e58 bellard
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
183 f72b519c bellard
endif
184 831b7825 ths
endif
185 831b7825 ths
186 7ba1e619 aliguori
kvm.o: CFLAGS+=$(KVM_CFLAGS)
187 7ba1e619 aliguori
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
188 7ba1e619 aliguori
189 40293e58 bellard
all: $(PROGS)
190 626df76a bellard
191 40293e58 bellard
#########################################################
192 626df76a bellard
# cpu emulator library
193 57fec1fe bellard
LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
194 cf2be984 blueswir1
        translate.o host-utils.o
195 bf6247fb blueswir1
ifdef CONFIG_DYNGEN_OP
196 48ffabc6 ths
exec.o: dyngen-opc.h
197 cf2be984 blueswir1
LIBOBJS+=op.o
198 cf2be984 blueswir1
endif
199 57fec1fe bellard
# TCG code generator
200 57fec1fe bellard
LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
201 57fec1fe bellard
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
202 8289b279 blueswir1
ifeq ($(ARCH),sparc64)
203 8289b279 blueswir1
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
204 8289b279 blueswir1
endif
205 158142c2 bellard
ifdef CONFIG_SOFTFLOAT
206 158142c2 bellard
LIBOBJS+=fpu/softfloat.o
207 158142c2 bellard
else
208 158142c2 bellard
LIBOBJS+=fpu/softfloat-native.o
209 158142c2 bellard
endif
210 6f30fa85 ths
CPPFLAGS+=-I$(SRC_PATH)/fpu
211 e95c8d51 bellard
LIBOBJS+= op_helper.o helper.o
212 e95c8d51 bellard
213 b7bcbe95 bellard
ifeq ($(TARGET_BASE_ARCH), arm)
214 eaa728ee bellard
LIBOBJS+= neon_helper.o iwmmxt_helper.o
215 e6e5906b pbrook
endif
216 e6e5906b pbrook
217 cf6c1b16 j_mayer
ifeq ($(TARGET_BASE_ARCH), alpha)
218 eaa728ee bellard
LIBOBJS+= alpha_palcode.o
219 cf6c1b16 j_mayer
endif
220 cf6c1b16 j_mayer
221 e7daa605 ths
ifeq ($(TARGET_BASE_ARCH), cris)
222 e7daa605 ths
LIBOBJS+= cris-dis.o
223 e7daa605 ths
224 e7daa605 ths
ifndef CONFIG_USER_ONLY
225 e7daa605 ths
LIBOBJS+= mmu.o
226 e7daa605 ths
endif
227 e7daa605 ths
endif
228 e7daa605 ths
229 626df76a bellard
# NOTE: the disassembler code is only needed for debugging
230 5fafdf24 ths
LIBOBJS+=disas.o
231 626df76a bellard
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
232 bc51c5c9 bellard
USE_I386_DIS=y
233 bc51c5c9 bellard
endif
234 0b0babc6 bellard
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
235 bc51c5c9 bellard
USE_I386_DIS=y
236 bc51c5c9 bellard
endif
237 bc51c5c9 bellard
ifdef USE_I386_DIS
238 626df76a bellard
LIBOBJS+=i386-dis.o
239 626df76a bellard
endif
240 626df76a bellard
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
241 626df76a bellard
LIBOBJS+=alpha-dis.o
242 626df76a bellard
endif
243 a2458627 bellard
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
244 626df76a bellard
LIBOBJS+=ppc-dis.o
245 626df76a bellard
endif
246 fbe4f65b ths
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
247 6af0bf9c bellard
LIBOBJS+=mips-dis.o
248 6af0bf9c bellard
endif
249 64b3ab24 bellard
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
250 626df76a bellard
LIBOBJS+=sparc-dis.o
251 626df76a bellard
endif
252 626df76a bellard
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
253 626df76a bellard
LIBOBJS+=arm-dis.o
254 626df76a bellard
endif
255 48024e4a bellard
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
256 48024e4a bellard
LIBOBJS+=m68k-dis.o
257 48024e4a bellard
endif
258 fdf9b3e8 bellard
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
259 fdf9b3e8 bellard
LIBOBJS+=sh4-dis.o
260 fdf9b3e8 bellard
endif
261 f54b3f92 aurel32
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
262 f54b3f92 aurel32
LIBOBJS+=hppa-dis.o
263 f54b3f92 aurel32
endif
264 8f860bb8 ths
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
265 8f860bb8 ths
LIBOBJS+=s390-dis.o
266 8f860bb8 ths
endif
267 626df76a bellard
268 40293e58 bellard
# libqemu
269 40293e58 bellard
270 bf6247fb blueswir1
ifdef CONFIG_DYNGEN_OP
271 dd48594e pbrook
OPC_H = gen-op.h dyngen-opc.h op.h
272 cf2be984 blueswir1
endif
273 dd48594e pbrook
274 40293e58 bellard
libqemu.a: $(LIBOBJS)
275 40293e58 bellard
	rm -f $@
276 40293e58 bellard
	$(AR) rcs $@ $(LIBOBJS)
277 40293e58 bellard
278 dd48594e pbrook
translate.o: translate.c cpu.h $(OPC_H)
279 dd48594e pbrook
280 dd48594e pbrook
translate-all.o: translate-all.c cpu.h $(OPC_H)
281 dd48594e pbrook
282 dd48594e pbrook
tcg/tcg.o: cpu.h $(OPC_H)
283 40293e58 bellard
284 dd48594e pbrook
tcg/tcg-dyngen.o: $(OPC_H)
285 40293e58 bellard
286 dd48594e pbrook
tcg/tcg-runtime.o: $(OPC_H)
287 40293e58 bellard
288 40293e58 bellard
op.h: op.o $(DYNGEN)
289 40293e58 bellard
	$(DYNGEN) -o $@ $<
290 40293e58 bellard
291 57fec1fe bellard
dyngen-opc.h: op.o $(DYNGEN)
292 40293e58 bellard
	$(DYNGEN) -c -o $@ $<
293 40293e58 bellard
294 40293e58 bellard
gen-op.h: op.o $(DYNGEN)
295 40293e58 bellard
	$(DYNGEN) -g -o $@ $<
296 40293e58 bellard
297 40293e58 bellard
op.o: op.c
298 f2bf094e aurel32
	$(CC) $(OP_CFLAGS) $(CPPFLAGS) $(I386_CFLAGS) -c -o $@ $<
299 40293e58 bellard
300 8dd3dca3 aurel32
machine.o: machine.c
301 8dd3dca3 aurel32
	$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
302 8dd3dca3 aurel32
303 40293e58 bellard
# HELPER_CFLAGS is used for all the code compiled with static register
304 40293e58 bellard
# variables
305 40293e58 bellard
op_helper.o: op_helper.c
306 eaa728ee bellard
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $<
307 40293e58 bellard
308 c96402b1 aurel32
cpu-exec.o: cpu-exec.c $(OPC_H)
309 40293e58 bellard
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
310 40293e58 bellard
311 40293e58 bellard
#########################################################
312 40293e58 bellard
# Linux user emulator target
313 40293e58 bellard
314 40293e58 bellard
ifdef CONFIG_LINUX_USER
315 40293e58 bellard
316 40293e58 bellard
ifndef TARGET_ABI_DIR
317 40293e58 bellard
  TARGET_ABI_DIR=$(TARGET_ARCH)
318 40293e58 bellard
endif
319 3ebdd119 aurel32
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
320 40293e58 bellard
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
321 40293e58 bellard
322 40293e58 bellard
ifdef CONFIG_STATIC
323 40293e58 bellard
LDFLAGS+=-static
324 40293e58 bellard
endif
325 40293e58 bellard
326 40293e58 bellard
ifeq ($(ARCH),i386)
327 40293e58 bellard
ifdef TARGET_GPROF
328 40293e58 bellard
USE_I386_LD=y
329 40293e58 bellard
endif
330 40293e58 bellard
ifdef CONFIG_STATIC
331 40293e58 bellard
USE_I386_LD=y
332 40293e58 bellard
endif
333 40293e58 bellard
ifdef USE_I386_LD
334 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
335 40293e58 bellard
else
336 40293e58 bellard
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
337 40293e58 bellard
# that the kernel ELF loader considers as an executable. I think this
338 40293e58 bellard
# is the simplest way to make it self virtualizable!
339 40293e58 bellard
LDFLAGS+=-Wl,-shared
340 40293e58 bellard
endif
341 40293e58 bellard
endif
342 40293e58 bellard
343 40293e58 bellard
ifeq ($(ARCH),x86_64)
344 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
345 40293e58 bellard
endif
346 40293e58 bellard
347 40293e58 bellard
ifeq ($(ARCH),ppc)
348 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
349 40293e58 bellard
endif
350 40293e58 bellard
351 810260a8 malc
ifeq ($(ARCH),ppc64)
352 810260a8 malc
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
353 810260a8 malc
endif
354 810260a8 malc
355 40293e58 bellard
ifeq ($(ARCH),s390)
356 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
357 40293e58 bellard
endif
358 40293e58 bellard
359 40293e58 bellard
ifeq ($(ARCH),sparc)
360 40293e58 bellard
# -static is used to avoid g1/g3 usage by the dynamic linker	
361 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
362 40293e58 bellard
endif
363 40293e58 bellard
364 40293e58 bellard
ifeq ($(ARCH),sparc64)
365 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
366 40293e58 bellard
endif
367 40293e58 bellard
368 40293e58 bellard
ifeq ($(ARCH),alpha)
369 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
370 40293e58 bellard
endif
371 40293e58 bellard
372 40293e58 bellard
ifeq ($(ARCH),ia64)
373 40293e58 bellard
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
374 40293e58 bellard
endif
375 40293e58 bellard
376 40293e58 bellard
ifeq ($(ARCH),arm)
377 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
378 40293e58 bellard
endif
379 40293e58 bellard
380 40293e58 bellard
ifeq ($(ARCH),m68k)
381 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
382 40293e58 bellard
endif
383 40293e58 bellard
384 40293e58 bellard
ifeq ($(ARCH),mips)
385 40293e58 bellard
ifeq ($(WORDS_BIGENDIAN),yes)
386 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
387 40293e58 bellard
else
388 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
389 40293e58 bellard
endif
390 40293e58 bellard
endif
391 40293e58 bellard
392 40293e58 bellard
ifeq ($(ARCH),mips64)
393 40293e58 bellard
ifeq ($(WORDS_BIGENDIAN),yes)
394 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
395 40293e58 bellard
else
396 40293e58 bellard
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
397 40293e58 bellard
endif
398 40293e58 bellard
endif
399 40293e58 bellard
400 17e2377a pbrook
OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
401 40293e58 bellard
      elfload.o linuxload.o uaccess.o
402 40293e58 bellard
LIBS+= $(AIOLIBS)
403 40293e58 bellard
ifdef TARGET_HAS_BFLT
404 40293e58 bellard
OBJS+= flatload.o
405 40293e58 bellard
endif
406 40293e58 bellard
ifdef TARGET_HAS_ELFLOAD32
407 40293e58 bellard
OBJS+= elfload32.o
408 40293e58 bellard
elfload32.o: elfload.c
409 40293e58 bellard
endif
410 40293e58 bellard
411 40293e58 bellard
ifeq ($(TARGET_ARCH), i386)
412 40293e58 bellard
OBJS+= vm86.o
413 40293e58 bellard
endif
414 40293e58 bellard
ifeq ($(TARGET_ARCH), arm)
415 40293e58 bellard
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
416 40293e58 bellard
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
417 40293e58 bellard
 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
418 40293e58 bellard
endif
419 40293e58 bellard
ifeq ($(TARGET_ARCH), m68k)
420 40293e58 bellard
OBJS+= m68k-sim.o m68k-semi.o
421 40293e58 bellard
endif
422 40293e58 bellard
423 1fddef4b bellard
ifdef CONFIG_GDBSTUB
424 56aebc89 pbrook
OBJS+=gdbstub.o gdbstub-xml.o
425 1fddef4b bellard
endif
426 626df76a bellard
427 40293e58 bellard
OBJS+= libqemu.a
428 40293e58 bellard
429 40293e58 bellard
# Note: this is a workaround. The real fix is to avoid compiling
430 40293e58 bellard
# cpu_signal_handler() in cpu-exec.c.
431 40293e58 bellard
signal.o: signal.c
432 40293e58 bellard
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
433 626df76a bellard
434 cec7d0b6 pbrook
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
435 40293e58 bellard
	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
436 626df76a bellard
ifeq ($(ARCH),alpha)
437 626df76a bellard
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
438 626df76a bellard
# the address space (31 bit so sign extending doesn't matter)
439 626df76a bellard
	echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
440 626df76a bellard
endif
441 626df76a bellard
442 40293e58 bellard
endif #CONFIG_LINUX_USER
443 40293e58 bellard
444 40293e58 bellard
#########################################################
445 40293e58 bellard
# Darwin user emulator target
446 40293e58 bellard
447 40293e58 bellard
ifdef CONFIG_DARWIN_USER
448 40293e58 bellard
449 40293e58 bellard
VPATH+=:$(SRC_PATH)/darwin-user
450 40293e58 bellard
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
451 40293e58 bellard
452 40293e58 bellard
# Leave some space for the regular program loading zone
453 40293e58 bellard
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
454 40293e58 bellard
455 40293e58 bellard
LIBS+=-lmx
456 40293e58 bellard
457 17e2377a pbrook
OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
458 40293e58 bellard
459 40293e58 bellard
OBJS+= libqemu.a
460 40293e58 bellard
461 40293e58 bellard
ifdef CONFIG_GDBSTUB
462 56aebc89 pbrook
OBJS+=gdbstub.o gdbstub-xml.o
463 40293e58 bellard
endif
464 40293e58 bellard
465 40293e58 bellard
# Note: this is a workaround. The real fix is to avoid compiling
466 40293e58 bellard
# cpu_signal_handler() in cpu-exec.c.
467 40293e58 bellard
signal.o: signal.c
468 40293e58 bellard
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
469 40293e58 bellard
470 40293e58 bellard
$(QEMU_PROG): $(OBJS)
471 40293e58 bellard
	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
472 40293e58 bellard
473 40293e58 bellard
endif #CONFIG_DARWIN_USER
474 40293e58 bellard
475 40293e58 bellard
#########################################################
476 84778508 blueswir1
# BSD user emulator target
477 84778508 blueswir1
478 84778508 blueswir1
ifdef CONFIG_BSD_USER
479 84778508 blueswir1
480 84778508 blueswir1
VPATH+=:$(SRC_PATH)/bsd-user
481 84778508 blueswir1
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
482 84778508 blueswir1
483 84778508 blueswir1
ifdef CONFIG_STATIC
484 84778508 blueswir1
LDFLAGS+=-static
485 84778508 blueswir1
endif
486 84778508 blueswir1
487 84778508 blueswir1
ifeq ($(ARCH),i386)
488 84778508 blueswir1
ifdef TARGET_GPROF
489 84778508 blueswir1
USE_I386_LD=y
490 84778508 blueswir1
endif
491 84778508 blueswir1
ifdef CONFIG_STATIC
492 84778508 blueswir1
USE_I386_LD=y
493 84778508 blueswir1
endif
494 84778508 blueswir1
ifdef USE_I386_LD
495 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
496 84778508 blueswir1
else
497 84778508 blueswir1
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
498 84778508 blueswir1
# that the kernel ELF loader considers as an executable. I think this
499 84778508 blueswir1
# is the simplest way to make it self virtualizable!
500 84778508 blueswir1
LDFLAGS+=-Wl,-shared
501 84778508 blueswir1
endif
502 84778508 blueswir1
endif
503 84778508 blueswir1
504 84778508 blueswir1
ifeq ($(ARCH),x86_64)
505 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
506 84778508 blueswir1
endif
507 84778508 blueswir1
508 84778508 blueswir1
ifeq ($(ARCH),ppc)
509 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
510 84778508 blueswir1
endif
511 84778508 blueswir1
512 84778508 blueswir1
ifeq ($(ARCH),ppc64)
513 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
514 84778508 blueswir1
endif
515 84778508 blueswir1
516 84778508 blueswir1
ifeq ($(ARCH),s390)
517 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
518 84778508 blueswir1
endif
519 84778508 blueswir1
520 84778508 blueswir1
ifeq ($(ARCH),sparc)
521 84778508 blueswir1
# -static is used to avoid g1/g3 usage by the dynamic linker
522 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
523 84778508 blueswir1
endif
524 84778508 blueswir1
525 84778508 blueswir1
ifeq ($(ARCH),sparc64)
526 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
527 84778508 blueswir1
endif
528 84778508 blueswir1
529 84778508 blueswir1
ifeq ($(ARCH),alpha)
530 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
531 84778508 blueswir1
endif
532 84778508 blueswir1
533 84778508 blueswir1
ifeq ($(ARCH),ia64)
534 84778508 blueswir1
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
535 84778508 blueswir1
endif
536 84778508 blueswir1
537 84778508 blueswir1
ifeq ($(ARCH),arm)
538 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
539 84778508 blueswir1
endif
540 84778508 blueswir1
541 84778508 blueswir1
ifeq ($(ARCH),m68k)
542 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
543 84778508 blueswir1
endif
544 84778508 blueswir1
545 84778508 blueswir1
ifeq ($(ARCH),mips)
546 84778508 blueswir1
ifeq ($(WORDS_BIGENDIAN),yes)
547 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
548 84778508 blueswir1
else
549 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
550 84778508 blueswir1
endif
551 84778508 blueswir1
endif
552 84778508 blueswir1
553 84778508 blueswir1
ifeq ($(ARCH),mips64)
554 84778508 blueswir1
ifeq ($(WORDS_BIGENDIAN),yes)
555 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
556 84778508 blueswir1
else
557 84778508 blueswir1
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
558 84778508 blueswir1
endif
559 84778508 blueswir1
endif
560 84778508 blueswir1
561 84778508 blueswir1
OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
562 84778508 blueswir1
OBJS+= uaccess.o
563 84778508 blueswir1
564 84778508 blueswir1
OBJS+= libqemu.a
565 84778508 blueswir1
566 84778508 blueswir1
ifdef CONFIG_GDBSTUB
567 84778508 blueswir1
OBJS+=gdbstub.o
568 84778508 blueswir1
endif
569 84778508 blueswir1
570 84778508 blueswir1
# Note: this is a workaround. The real fix is to avoid compiling
571 84778508 blueswir1
# cpu_signal_handler() in cpu-exec.c.
572 84778508 blueswir1
signal.o: signal.c
573 84778508 blueswir1
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
574 84778508 blueswir1
575 84778508 blueswir1
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
576 84778508 blueswir1
	$(CC) $(LDFLAGS) -o $@ $^  $(LIBS)
577 84778508 blueswir1
578 84778508 blueswir1
endif #CONFIG_BSD_USER
579 84778508 blueswir1
580 84778508 blueswir1
#########################################################
581 40293e58 bellard
# System emulator target
582 40293e58 bellard
ifndef CONFIG_USER_ONLY
583 40293e58 bellard
584 48c64363 aliguori
OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
585 6f97dba0 aliguori
OBJS+=fw_cfg.o aio.o buffered_file.o migration.o migration-tcp.o qemu-char.o
586 63a01ef8 aliguori
OBJS+=net.o
587 7ba1e619 aliguori
ifdef CONFIG_KVM
588 7ba1e619 aliguori
OBJS+=kvm.o kvm-all.o
589 7ba1e619 aliguori
endif
590 223d4670 ths
ifdef CONFIG_WIN32
591 40293e58 bellard
OBJS+=block-raw-win32.o
592 223d4670 ths
else
593 a3392f9b aliguori
OBJS+=block-raw-posix.o
594 a3392f9b aliguori
endif
595 a3392f9b aliguori
596 40293e58 bellard
LIBS+=-lz
597 1d14ffa9 bellard
ifdef CONFIG_ALSA
598 1d14ffa9 bellard
LIBS += -lasound
599 1d14ffa9 bellard
endif
600 ca9cc28c balrog
ifdef CONFIG_ESD
601 ca9cc28c balrog
LIBS += -lesd
602 ca9cc28c balrog
endif
603 b8e59f18 malc
ifdef CONFIG_PA
604 b8e59f18 malc
LIBS += -lpulse-simple
605 b8e59f18 malc
endif
606 1d14ffa9 bellard
ifdef CONFIG_DSOUND
607 1d14ffa9 bellard
LIBS += -lole32 -ldxguid
608 85571bc7 bellard
endif
609 102a52e4 bellard
ifdef CONFIG_FMOD
610 102a52e4 bellard
LIBS += $(CONFIG_FMOD_LIB)
611 85571bc7 bellard
endif
612 2f6a1ab0 blueswir1
ifdef CONFIG_OSS
613 2f6a1ab0 blueswir1
LIBS += $(CONFIG_OSS_LIB)
614 2f6a1ab0 blueswir1
endif
615 4fb240a4 bellard
616 4fb240a4 bellard
SOUND_HW = sb16.o es1370.o
617 ca9cc28c balrog
ifdef CONFIG_AC97
618 ca9cc28c balrog
SOUND_HW += ac97.o
619 ca9cc28c balrog
endif
620 1d14ffa9 bellard
ifdef CONFIG_ADLIB
621 1d14ffa9 bellard
SOUND_HW += fmopl.o adlib.o
622 1d14ffa9 bellard
endif
623 423d65f4 balrog
ifdef CONFIG_GUS
624 423d65f4 balrog
SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
625 423d65f4 balrog
endif
626 cc53d26d malc
ifdef CONFIG_CS4231A
627 cc53d26d malc
SOUND_HW += cs4231a.o
628 cc53d26d malc
endif
629 85571bc7 bellard
630 8d5d2d4c ths
ifdef CONFIG_VNC_TLS
631 8d5d2d4c ths
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
632 8d5d2d4c ths
LIBS += $(CONFIG_VNC_TLS_LIBS)
633 8d5d2d4c ths
endif
634 8d5d2d4c ths
635 fb599c9a balrog
ifdef CONFIG_BLUEZ
636 fb599c9a balrog
LIBS += $(CONFIG_BLUEZ_LIBS)
637 fb599c9a balrog
endif
638 fb599c9a balrog
639 2e5d83bb pbrook
# SCSI layer
640 8b17de88 blueswir1
OBJS+= lsi53c895a.o esp.o
641 2e5d83bb pbrook
642 a594cfbf bellard
# USB layer
643 40293e58 bellard
OBJS+= usb-ohci.o
644 a594cfbf bellard
645 663e8e51 ths
# EEPROM emulation
646 40293e58 bellard
OBJS += eeprom93xx.o
647 663e8e51 ths
648 a41b2ff2 pbrook
# PCI network cards
649 40293e58 bellard
OBJS += eepro100.o
650 40293e58 bellard
OBJS += ne2000.o
651 40293e58 bellard
OBJS += pcnet.o
652 40293e58 bellard
OBJS += rtl8139.o
653 7c23b892 balrog
OBJS += e1000.o
654 a41b2ff2 pbrook
655 0b0babc6 bellard
ifeq ($(TARGET_BASE_ARCH), i386)
656 a541f297 bellard
# Hardware support
657 40293e58 bellard
OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
658 40293e58 bellard
OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
659 40293e58 bellard
OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
660 40293e58 bellard
OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
661 b00052e4 balrog
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
662 67b915a5 bellard
endif
663 a2458627 bellard
ifeq ($(TARGET_BASE_ARCH), ppc)
664 b00052e4 balrog
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
665 3cbee15b j_mayer
# shared objects
666 40293e58 bellard
OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
667 3cbee15b j_mayer
# PREP target
668 40293e58 bellard
OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
669 40293e58 bellard
OBJS+= prep_pci.o ppc_prep.o
670 3cbee15b j_mayer
# Mac shared devices
671 40293e58 bellard
OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
672 3cbee15b j_mayer
# OldWorld PowerMac
673 40293e58 bellard
OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
674 3cbee15b j_mayer
# NewWorld PowerMac
675 40293e58 bellard
OBJS+= unin_pci.o ppc_chrp.o
676 3cbee15b j_mayer
# PowerPC 4xx boards
677 40293e58 bellard
OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
678 a541f297 bellard
endif
679 fbe4f65b ths
ifeq ($(TARGET_BASE_ARCH), mips)
680 c171148c aurel32
OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
681 4ce7ff6e aurel32
OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
682 4ce7ff6e aurel32
OBJS+= g364fb.o jazz_led.o
683 40293e58 bellard
OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
684 4ce7ff6e aurel32
OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
685 40293e58 bellard
OBJS+= mipsnet.o
686 40293e58 bellard
OBJS+= pflash_cfi01.o
687 4ce7ff6e aurel32
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
688 6af0bf9c bellard
endif
689 e7daa605 ths
ifeq ($(TARGET_BASE_ARCH), cris)
690 40293e58 bellard
OBJS+= etraxfs.o
691 48318011 edgar_igl
OBJS+= etraxfs_dma.o
692 e62b5b13 edgar_igl
OBJS+= etraxfs_pic.o
693 48318011 edgar_igl
OBJS+= etraxfs_eth.o
694 40293e58 bellard
OBJS+= etraxfs_timer.o
695 40293e58 bellard
OBJS+= etraxfs_ser.o
696 e62b5b13 edgar_igl
697 e62b5b13 edgar_igl
OBJS+= ptimer.o
698 48318011 edgar_igl
OBJS+= pflash_cfi02.o
699 e7daa605 ths
endif
700 64b3ab24 bellard
ifeq ($(TARGET_BASE_ARCH), sparc)
701 3475187d bellard
ifeq ($(TARGET_ARCH), sparc64)
702 40293e58 bellard
OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
703 40293e58 bellard
OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
704 40293e58 bellard
OBJS+= cirrus_vga.o parallel.o ptimer.o
705 3475187d bellard
else
706 40293e58 bellard
OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
707 8b17de88 blueswir1
OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o sparc32_dma.o
708 40293e58 bellard
OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
709 3475187d bellard
endif
710 e95c8d51 bellard
endif
711 b5ff1b31 bellard
ifeq ($(TARGET_BASE_ARCH), arm)
712 40293e58 bellard
OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
713 40293e58 bellard
OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
714 40293e58 bellard
OBJS+= versatile_pci.o ptimer.o
715 40293e58 bellard
OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
716 40293e58 bellard
OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
717 40293e58 bellard
OBJS+= pl061.o
718 40293e58 bellard
OBJS+= arm-semi.o
719 40293e58 bellard
OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
720 40293e58 bellard
OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
721 40293e58 bellard
OBJS+= pflash_cfi01.o gumstix.o
722 88d2c950 balrog
OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
723 b4e3104b balrog
OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
724 afbb5194 balrog
OBJS+= omap2.o omap_dss.o soc_dma.o
725 40293e58 bellard
OBJS+= palm.o tsc210x.o
726 942ac052 balrog
OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
727 58a26b47 balrog
OBJS+= tsc2005.o bt-hci-csr.o
728 40293e58 bellard
OBJS+= mst_fpga.o mainstone.o
729 24859b68 balrog
OBJS+= musicpal.o pflash_cfi02.o
730 5a1237c4 balrog
CPPFLAGS += -DHAS_AUDIO
731 b5ff1b31 bellard
endif
732 fdf9b3e8 bellard
ifeq ($(TARGET_BASE_ARCH), sh4)
733 40293e58 bellard
OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
734 40293e58 bellard
OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
735 fdf9b3e8 bellard
endif
736 0633879f pbrook
ifeq ($(TARGET_BASE_ARCH), m68k)
737 40293e58 bellard
OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
738 40293e58 bellard
OBJS+= m68k-semi.o dummy_m68k.o
739 0633879f pbrook
endif
740 a541f297 bellard
ifdef CONFIG_GDBSTUB
741 56aebc89 pbrook
OBJS+=gdbstub.o gdbstub-xml.o
742 728c9fd5 bellard
endif
743 5b0753e0 bellard
ifdef CONFIG_COCOA
744 1d14ffa9 bellard
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
745 1d14ffa9 bellard
ifdef CONFIG_COREAUDIO
746 1d14ffa9 bellard
COCOA_LIBS+=-framework CoreAudio
747 1d14ffa9 bellard
endif
748 5b0753e0 bellard
endif
749 7c1f25b4 bellard
ifdef CONFIG_SLIRP
750 6f30fa85 ths
CPPFLAGS+=-I$(SRC_PATH)/slirp
751 626df76a bellard
endif
752 626df76a bellard
753 40293e58 bellard
LIBS+=$(AIOLIBS)
754 c321f673 bellard
# specific flags are needed for non soft mmu emulator
755 c321f673 bellard
ifdef CONFIG_STATIC
756 40293e58 bellard
LDFLAGS+=-static
757 de5eaa64 bellard
endif
758 83fb7adf bellard
ifndef CONFIG_DARWIN
759 11d9f695 bellard
ifndef CONFIG_WIN32
760 ec530c81 bellard
ifndef CONFIG_SOLARIS
761 40293e58 bellard
LIBS+=-lutil
762 11d9f695 bellard
endif
763 83fb7adf bellard
endif
764 ec530c81 bellard
endif
765 e3086fbf bellard
ifdef TARGET_GPROF
766 40293e58 bellard
vl.o: CFLAGS+=-p
767 40293e58 bellard
LDFLAGS+=-p
768 e3086fbf bellard
endif
769 c321f673 bellard
770 b8076a74 bellard
ifeq ($(ARCH),ia64)
771 40293e58 bellard
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
772 74ccb34e bellard
endif
773 74ccb34e bellard
774 1d14ffa9 bellard
ifdef CONFIG_WIN32
775 1d14ffa9 bellard
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
776 1d14ffa9 bellard
endif
777 1d14ffa9 bellard
778 40293e58 bellard
# profiling code
779 40293e58 bellard
ifdef TARGET_GPROF
780 40293e58 bellard
LDFLAGS+=-p
781 40293e58 bellard
main.o: CFLAGS+=-p
782 6e1b3e4d bellard
endif
783 6e1b3e4d bellard
784 40293e58 bellard
$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
785 8a16d273 ths
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
786 626df76a bellard
787 40293e58 bellard
endif # !CONFIG_USER_ONLY
788 00a67ba1 bellard
789 56aebc89 pbrook
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
790 56aebc89 pbrook
	rm -f $@
791 56aebc89 pbrook
ifeq ($(TARGET_XML_FILES),)
792 56aebc89 pbrook
	echo > $@
793 56aebc89 pbrook
else
794 56aebc89 pbrook
	$(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
795 56aebc89 pbrook
endif
796 56aebc89 pbrook
797 626df76a bellard
%.o: %.c
798 40293e58 bellard
	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
799 626df76a bellard
800 f72b519c bellard
%.o: %.S
801 6f30fa85 ths
	$(CC) $(CPPFLAGS) -c -o $@ $<
802 f72b519c bellard
803 626df76a bellard
clean:
804 57fec1fe bellard
	rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o
805 57fec1fe bellard
	rm -f *.d */*.d tcg/*.o
806 1e43adfc bellard
807 5fafdf24 ths
install: all
808 9b14bb04 bellard
ifneq ($(PROGS),)
809 6a882643 pbrook
	$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
810 9b14bb04 bellard
endif
811 626df76a bellard
812 2f96c28d j_mayer
# Include automatically generated dependency files
813 2f96c28d j_mayer
-include $(wildcard *.d */*.d)