Statistics
| Branch: | Revision:

root / Makefile.target @ 5e1d0985

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