~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to Makefile.target

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
include config.mak
 
2
include $(SRC_PATH)/rules.mak
2
3
 
3
4
TARGET_BASE_ARCH:=$(TARGET_ARCH)
4
5
ifeq ($(TARGET_ARCH), x86_64)
24
25
endif
25
26
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
26
27
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
27
 
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MP -DNEED_CPU_H
28
 
ifdef CONFIG_DARWIN_USER
29
 
VPATH+=:$(SRC_PATH)/darwin-user
30
 
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
31
 
endif
32
 
ifdef CONFIG_LINUX_USER
33
 
VPATH+=:$(SRC_PATH)/linux-user
34
 
ifndef TARGET_ABI_DIR
35
 
  TARGET_ABI_DIR=$(TARGET_ARCH)
36
 
endif
37
 
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
38
 
endif
39
 
BASE_CFLAGS=
40
 
BASE_LDFLAGS=
 
28
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
41
29
#CFLAGS+=-Werror
42
30
LIBS=
43
 
HELPER_CFLAGS=$(CFLAGS)
44
 
DYNGEN=../dyngen$(EXESUF)
45
31
# user emulator name
46
32
ifndef TARGET_ARCH2
47
33
TARGET_ARCH2=$(TARGET_ARCH)
71
57
    TARGET_ARCH2=mips64el
72
58
  endif
73
59
endif
74
 
QEMU_USER=qemu-$(TARGET_ARCH2)
 
60
 
 
61
ifdef CONFIG_USER_ONLY
 
62
# user emulator name
 
63
QEMU_PROG=qemu-$(TARGET_ARCH2)
 
64
else
75
65
# system emulator name
76
 
ifdef CONFIG_SOFTMMU
77
66
ifeq ($(TARGET_ARCH), i386)
78
 
QEMU_SYSTEM=qemu$(EXESUF)
79
 
else
80
 
QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
81
 
endif
82
 
else
83
 
QEMU_SYSTEM=qemu-fast
84
 
endif
85
 
 
86
 
ifdef CONFIG_USER_ONLY
87
 
PROGS=$(QEMU_USER)
88
 
else
89
 
PROGS+=$(QEMU_SYSTEM)
90
 
ifndef CONFIG_SOFTMMU
91
 
CONFIG_STATIC=y
92
 
endif
93
 
endif # !CONFIG_USER_ONLY
94
 
 
95
 
ifdef CONFIG_STATIC
96
 
BASE_LDFLAGS+=-static
97
 
endif
98
 
 
99
 
# We require -O2 to avoid the stack setup prologue in EXIT_TB
100
 
OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
 
67
QEMU_PROG=qemu$(EXESUF)
 
68
else
 
69
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
 
70
endif
 
71
endif
 
72
 
 
73
PROGS=$(QEMU_PROG)
101
74
 
102
75
# cc-option
103
 
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
104
 
 
105
 
cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
106
 
              > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
107
 
 
108
 
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
109
 
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
110
 
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
111
 
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
112
 
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
113
 
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
114
 
OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
115
 
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
116
 
OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
 
76
# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
 
77
 
 
78
cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
 
79
              > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
 
80
 
 
81
HELPER_CFLAGS=
117
82
 
118
83
ifeq ($(ARCH),i386)
119
84
HELPER_CFLAGS+=-fomit-frame-pointer
120
 
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
121
 
ifdef TARGET_GPROF
122
 
USE_I386_LD=y
123
 
endif
124
 
ifdef CONFIG_STATIC
125
 
USE_I386_LD=y
126
 
endif
127
 
ifdef USE_I386_LD
128
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
129
 
else
130
 
ifdef CONFIG_LINUX_USER
131
 
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
132
 
# that the kernel ELF loader considers as an executable. I think this
133
 
# is the simplest way to make it self virtualizable!
134
 
BASE_LDFLAGS+=-Wl,-shared
135
 
endif
136
 
endif
137
85
endif
138
86
 
139
 
ifeq ($(ARCH),x86_64)
 
87
ifeq ($(ARCH),sparc)
 
88
  CFLAGS+=-ffixed-g2 -ffixed-g3
140
89
  ifneq ($(CONFIG_SOLARIS),yes)
141
 
    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
90
    CFLAGS+=-ffixed-g1 -ffixed-g6
 
91
    HELPER_CFLAGS+=-ffixed-i0
142
92
  endif
143
93
endif
144
94
 
145
 
ifeq ($(ARCH),ppc)
146
 
CPPFLAGS+= -D__powerpc__
147
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
148
 
endif
149
 
 
150
 
ifeq ($(ARCH),s390)
151
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
152
 
endif
153
 
 
154
 
ifeq ($(ARCH),sparc)
155
 
  BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
156
 
  OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
157
 
  ifeq ($(CONFIG_SOLARIS),yes)
158
 
    OP_CFLAGS+=-fno-omit-frame-pointer
 
95
ifeq ($(ARCH),sparc64)
 
96
  ifneq ($(CONFIG_SOLARIS),yes)
 
97
    CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
159
98
  else
160
 
    BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
161
 
    HELPER_CFLAGS=$(CFLAGS) -ffixed-i0
162
 
    # -static is used to avoid g1/g3 usage by the dynamic linker
163
 
    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
164
 
  endif
165
 
endif
166
 
 
167
 
ifeq ($(ARCH),sparc64)
168
 
  BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
169
 
  OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
170
 
  ifneq ($(CONFIG_SOLARIS),yes)
171
 
    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
172
 
    OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
 
99
    CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
173
100
  endif
174
101
endif
175
102
 
176
103
ifeq ($(ARCH),alpha)
177
 
# -msmall-data is not used for OP_CFLAGS because we want two-instruction
178
 
# relocations for the constant constructions
179
104
# Ensure there's only a single GP
180
 
BASE_CFLAGS+=-msmall-data
 
105
CFLAGS+=-msmall-data
 
106
endif
 
107
 
 
108
ifeq ($(ARCH),hppa)
181
109
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
182
110
endif
183
111
 
184
112
ifeq ($(ARCH),ia64)
185
 
BASE_CFLAGS+=-mno-sdata
186
 
OP_CFLAGS+=-mno-sdata
187
 
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
188
 
endif
189
 
 
190
 
ifeq ($(ARCH),arm)
191
 
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
192
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
193
 
endif
194
 
 
195
 
ifeq ($(ARCH),m68k)
196
 
OP_CFLAGS+=-fomit-frame-pointer
197
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
198
 
endif
199
 
 
200
 
ifeq ($(ARCH),mips)
201
 
OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
202
 
ifeq ($(WORDS_BIGENDIAN),yes)
203
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
204
 
else
205
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
206
 
endif
207
 
endif
208
 
 
209
 
ifeq ($(ARCH),mips64)
210
 
OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
211
 
ifeq ($(WORDS_BIGENDIAN),yes)
212
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
213
 
else
214
 
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
215
 
endif
216
 
endif
217
 
 
218
 
ifeq ($(CONFIG_DARWIN),yes)
219
 
LIBS+=-lmx
220
 
endif
221
 
 
222
 
ifdef CONFIG_DARWIN_USER
223
 
# Leave some space for the regular program loading zone
224
 
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
225
 
endif
226
 
 
227
 
BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
228
 
BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
229
 
OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
230
 
OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
231
 
 
232
 
#########################################################
 
113
CFLAGS+=-mno-sdata
 
114
endif
 
115
 
 
116
CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
 
117
LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
233
118
 
234
119
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
235
120
LIBS+=-lm
236
 
ifndef CONFIG_USER_ONLY
237
 
LIBS+=-lz
238
 
endif
239
121
ifdef CONFIG_WIN32
240
122
LIBS+=-lwinmm -lws2_32 -liphlpapi
241
123
endif
244
126
ifdef NEEDS_LIBSUNMATH
245
127
LIBS+=-lsunmath
246
128
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
247
 
OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
248
 
BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
249
 
endif
250
 
endif
251
 
 
252
 
# profiling code
253
 
ifdef TARGET_GPROF
254
 
BASE_LDFLAGS+=-p
255
 
main.o: BASE_CFLAGS+=-p
256
 
endif
257
 
 
258
 
ifdef CONFIG_LINUX_USER
259
 
OBJS= main.o syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o \
260
 
      elfload.o linuxload.o uaccess.o
261
 
LIBS+= $(AIOLIBS)
262
 
ifdef TARGET_HAS_BFLT
263
 
OBJS+= flatload.o
264
 
endif
265
 
ifdef TARGET_HAS_ELFLOAD32
266
 
OBJS+= elfload32.o
267
 
elfload32.o: elfload.c
268
 
endif
269
 
 
270
 
ifeq ($(TARGET_ARCH), i386)
271
 
OBJS+= vm86.o
272
 
endif
273
 
ifeq ($(TARGET_ARCH), arm)
274
 
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
275
 
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
276
 
 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
277
 
endif
278
 
ifeq ($(TARGET_ARCH), m68k)
279
 
OBJS+= m68k-sim.o m68k-semi.o
280
 
endif
281
 
endif #CONFIG_LINUX_USER
282
 
 
283
 
ifdef CONFIG_DARWIN_USER
284
 
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
285
 
endif
286
 
 
287
 
SRCS:= $(OBJS:.o=.c)
288
 
OBJS+= libqemu.a
289
 
 
 
129
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
 
130
endif
 
131
endif
 
132
 
 
133
kvm.o: CFLAGS+=$(KVM_CFLAGS)
 
134
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
 
135
 
 
136
all: $(PROGS)
 
137
 
 
138
#########################################################
290
139
# cpu emulator library
291
 
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
292
 
        translate.o op.o host-utils.o
 
140
LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
 
141
        translate.o host-utils.o
 
142
# TCG code generator
 
143
LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
 
144
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
 
145
ifeq ($(ARCH),sparc64)
 
146
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
 
147
endif
293
148
ifdef CONFIG_SOFTFLOAT
294
149
LIBOBJS+=fpu/softfloat.o
295
150
else
296
151
LIBOBJS+=fpu/softfloat-native.o
297
152
endif
298
153
CPPFLAGS+=-I$(SRC_PATH)/fpu
299
 
 
300
 
ifeq ($(TARGET_ARCH), i386)
301
 
LIBOBJS+=helper.o helper2.o
302
 
endif
303
 
 
304
 
ifeq ($(TARGET_ARCH), x86_64)
305
 
LIBOBJS+=helper.o helper2.o
306
 
endif
307
 
 
308
 
ifeq ($(TARGET_BASE_ARCH), ppc)
309
 
LIBOBJS+= op_helper.o helper.o
310
 
endif
311
 
 
312
 
ifeq ($(TARGET_BASE_ARCH), mips)
313
 
LIBOBJS+= op_helper.o helper.o
314
 
endif
315
 
 
316
 
ifeq ($(TARGET_BASE_ARCH), sparc)
317
 
LIBOBJS+= op_helper.o helper.o
318
 
endif
 
154
LIBOBJS+= op_helper.o helper.o
319
155
 
320
156
ifeq ($(TARGET_BASE_ARCH), arm)
321
 
LIBOBJS+= op_helper.o helper.o
322
 
endif
323
 
 
324
 
ifeq ($(TARGET_BASE_ARCH), sh4)
325
 
LIBOBJS+= op_helper.o helper.o
326
 
endif
327
 
 
328
 
ifeq ($(TARGET_BASE_ARCH), m68k)
329
 
LIBOBJS+= op_helper.o helper.o
 
157
LIBOBJS+= neon_helper.o iwmmxt_helper.o
330
158
endif
331
159
 
332
160
ifeq ($(TARGET_BASE_ARCH), alpha)
333
 
LIBOBJS+= op_helper.o helper.o alpha_palcode.o
 
161
LIBOBJS+= alpha_palcode.o
334
162
endif
335
163
 
336
164
ifeq ($(TARGET_BASE_ARCH), cris)
337
 
LIBOBJS+= op_helper.o helper.o
338
165
LIBOBJS+= cris-dis.o
339
166
 
340
167
ifndef CONFIG_USER_ONLY
374
201
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
375
202
LIBOBJS+=sh4-dis.o
376
203
endif
 
204
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
 
205
LIBOBJS+=hppa-dis.o
 
206
endif
377
207
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
378
208
LIBOBJS+=s390-dis.o
379
209
endif
380
210
 
 
211
# libqemu
 
212
 
 
213
libqemu.a: $(LIBOBJS)
 
214
 
 
215
translate.o: translate.c cpu.h
 
216
 
 
217
translate-all.o: translate-all.c cpu.h
 
218
 
 
219
tcg/tcg.o: cpu.h
 
220
 
 
221
# HELPER_CFLAGS is used for all the code compiled with static register
 
222
# variables
 
223
op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
 
224
 
 
225
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
 
226
 
 
227
#########################################################
 
228
# Linux user emulator target
 
229
 
 
230
ifdef CONFIG_LINUX_USER
 
231
 
 
232
ifndef TARGET_ABI_DIR
 
233
  TARGET_ABI_DIR=$(TARGET_ARCH)
 
234
endif
 
235
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
 
236
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
 
237
 
 
238
ifdef CONFIG_STATIC
 
239
LDFLAGS+=-static
 
240
endif
 
241
 
 
242
ifeq ($(ARCH),i386)
 
243
ifdef TARGET_GPROF
 
244
USE_I386_LD=y
 
245
endif
 
246
ifdef CONFIG_STATIC
 
247
USE_I386_LD=y
 
248
endif
 
249
ifdef USE_I386_LD
 
250
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
251
else
 
252
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
 
253
# that the kernel ELF loader considers as an executable. I think this
 
254
# is the simplest way to make it self virtualizable!
 
255
LDFLAGS+=-Wl,-shared
 
256
endif
 
257
endif
 
258
 
 
259
ifeq ($(ARCH),x86_64)
 
260
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
261
endif
 
262
 
 
263
ifeq ($(ARCH),ppc)
 
264
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
265
endif
 
266
 
 
267
ifeq ($(ARCH),ppc64)
 
268
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
269
endif
 
270
 
 
271
ifeq ($(ARCH),s390)
 
272
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
273
endif
 
274
 
 
275
ifeq ($(ARCH),sparc)
 
276
# -static is used to avoid g1/g3 usage by the dynamic linker    
 
277
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
 
278
endif
 
279
 
 
280
ifeq ($(ARCH),sparc64)
 
281
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
282
endif
 
283
 
 
284
ifeq ($(ARCH),alpha)
 
285
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
286
endif
 
287
 
 
288
ifeq ($(ARCH),ia64)
 
289
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
290
endif
 
291
 
 
292
ifeq ($(ARCH),arm)
 
293
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
294
endif
 
295
 
 
296
ifeq ($(ARCH),m68k)
 
297
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
298
endif
 
299
 
 
300
ifeq ($(ARCH),mips)
 
301
ifeq ($(WORDS_BIGENDIAN),yes)
 
302
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
303
else
 
304
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
305
endif
 
306
endif
 
307
 
 
308
ifeq ($(ARCH),mips64)
 
309
ifeq ($(WORDS_BIGENDIAN),yes)
 
310
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
311
else
 
312
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
313
endif
 
314
endif
 
315
 
 
316
# profiling code
 
317
ifdef TARGET_GPROF
 
318
LDFLAGS+=-p
 
319
CFLAGS+=-p
 
320
endif
 
321
 
 
322
OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
 
323
      elfload.o linuxload.o uaccess.o envlist.o
 
324
LIBS+= $(AIOLIBS)
 
325
ifdef TARGET_HAS_BFLT
 
326
OBJS+= flatload.o
 
327
endif
 
328
ifdef TARGET_HAS_ELFLOAD32
 
329
OBJS+= elfload32.o
 
330
elfload32.o: elfload.c
 
331
endif
 
332
 
 
333
ifeq ($(TARGET_ARCH), i386)
 
334
OBJS+= vm86.o
 
335
endif
 
336
ifeq ($(TARGET_ARCH), arm)
 
337
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
 
338
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
 
339
 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
 
340
endif
 
341
ifeq ($(TARGET_ARCH), m68k)
 
342
OBJS+= m68k-sim.o m68k-semi.o
 
343
endif
 
344
 
381
345
ifdef CONFIG_GDBSTUB
382
 
OBJS+=gdbstub.o
 
346
OBJS+=gdbstub.o gdbstub-xml.o
383
347
endif
384
348
 
385
 
all: $(PROGS)
386
 
 
387
 
$(QEMU_USER): $(OBJS)
388
 
        $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^  $(LIBS)
 
349
OBJS+= libqemu.a
 
350
 
 
351
# Note: this is a workaround. The real fix is to avoid compiling
 
352
# cpu_signal_handler() in cpu-exec.c.
 
353
signal.o: CFLAGS += $(HELPER_CFLAGS)
 
354
 
 
355
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
 
356
        $(LINK)
389
357
ifeq ($(ARCH),alpha)
390
358
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
391
359
# the address space (31 bit so sign extending doesn't matter)
392
360
        echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
393
361
endif
394
362
 
395
 
# must use static linking to avoid leaving stuff in virtual address space
396
 
VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o
397
 
# XXX: suppress QEMU_TOOL tests
 
363
endif #CONFIG_LINUX_USER
 
364
 
 
365
#########################################################
 
366
# Darwin user emulator target
 
367
 
 
368
ifdef CONFIG_DARWIN_USER
 
369
 
 
370
VPATH+=:$(SRC_PATH)/darwin-user
 
371
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
 
372
 
 
373
# Leave some space for the regular program loading zone
 
374
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
 
375
 
 
376
LIBS+=-lmx
 
377
 
 
378
OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
 
379
 
 
380
OBJS+= libqemu.a
 
381
 
 
382
ifdef CONFIG_GDBSTUB
 
383
OBJS+=gdbstub.o gdbstub-xml.o
 
384
endif
 
385
 
 
386
# Note: this is a workaround. The real fix is to avoid compiling
 
387
# cpu_signal_handler() in cpu-exec.c.
 
388
signal.o: CFLAGS += $(HELPER_CFLAGS)
 
389
 
 
390
$(QEMU_PROG): $(OBJS)
 
391
        $(LINK)
 
392
 
 
393
endif #CONFIG_DARWIN_USER
 
394
 
 
395
#########################################################
 
396
# BSD user emulator target
 
397
 
 
398
ifdef CONFIG_BSD_USER
 
399
 
 
400
VPATH+=:$(SRC_PATH)/bsd-user
 
401
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
 
402
 
 
403
ifdef CONFIG_STATIC
 
404
LDFLAGS+=-static
 
405
endif
 
406
 
 
407
ifeq ($(ARCH),i386)
 
408
ifdef TARGET_GPROF
 
409
USE_I386_LD=y
 
410
endif
 
411
ifdef CONFIG_STATIC
 
412
USE_I386_LD=y
 
413
endif
 
414
ifdef USE_I386_LD
 
415
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
416
else
 
417
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
 
418
# that the kernel ELF loader considers as an executable. I think this
 
419
# is the simplest way to make it self virtualizable!
 
420
LDFLAGS+=-Wl,-shared
 
421
endif
 
422
endif
 
423
 
 
424
ifeq ($(ARCH),x86_64)
 
425
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
426
endif
 
427
 
 
428
ifeq ($(ARCH),ppc)
 
429
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
430
endif
 
431
 
 
432
ifeq ($(ARCH),ppc64)
 
433
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
434
endif
 
435
 
 
436
ifeq ($(ARCH),s390)
 
437
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
438
endif
 
439
 
 
440
ifeq ($(ARCH),sparc)
 
441
# -static is used to avoid g1/g3 usage by the dynamic linker
 
442
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
 
443
endif
 
444
 
 
445
ifeq ($(ARCH),sparc64)
 
446
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
447
endif
 
448
 
 
449
ifeq ($(ARCH),alpha)
 
450
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
451
endif
 
452
 
 
453
ifeq ($(ARCH),ia64)
 
454
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
455
endif
 
456
 
 
457
ifeq ($(ARCH),arm)
 
458
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
459
endif
 
460
 
 
461
ifeq ($(ARCH),m68k)
 
462
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
463
endif
 
464
 
 
465
ifeq ($(ARCH),mips)
 
466
ifeq ($(WORDS_BIGENDIAN),yes)
 
467
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
468
else
 
469
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
470
endif
 
471
endif
 
472
 
 
473
ifeq ($(ARCH),mips64)
 
474
ifeq ($(WORDS_BIGENDIAN),yes)
 
475
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
476
else
 
477
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
478
endif
 
479
endif
 
480
 
 
481
OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
 
482
OBJS+= uaccess.o
 
483
 
 
484
OBJS+= libqemu.a
 
485
 
 
486
ifdef CONFIG_GDBSTUB
 
487
OBJS+=gdbstub.o
 
488
endif
 
489
 
 
490
# Note: this is a workaround. The real fix is to avoid compiling
 
491
# cpu_signal_handler() in cpu-exec.c.
 
492
signal.o: CFLAGS += $(HELPER_CFLAGS)
 
493
 
 
494
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
 
495
        $(LINK)
 
496
 
 
497
endif #CONFIG_BSD_USER
 
498
 
 
499
#########################################################
 
500
# System emulator target
 
501
ifndef CONFIG_USER_ONLY
 
502
 
 
503
OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o dma-helpers.o
 
504
# virtio has to be here due to weird dependency between PCI and virtio-net.
 
505
# need to fix this properly
 
506
OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
 
507
OBJS+=fw_cfg.o
 
508
ifdef CONFIG_KVM
 
509
OBJS+=kvm.o kvm-all.o
 
510
endif
398
511
ifdef CONFIG_WIN32
399
 
VL_OBJS+=block-raw-win32.o
 
512
OBJS+=block-raw-win32.o
400
513
else
401
 
VL_OBJS+=block-raw-posix.o
 
514
ifdef CONFIG_AIO
 
515
OBJS+=posix-aio-compat.o
 
516
endif
 
517
OBJS+=block-raw-posix.o
402
518
endif
403
519
 
 
520
LIBS+=-lz
404
521
ifdef CONFIG_ALSA
405
522
LIBS += -lasound
406
523
endif
 
524
ifdef CONFIG_ESD
 
525
LIBS += -lesd
 
526
endif
 
527
ifdef CONFIG_PA
 
528
LIBS += -lpulse-simple
 
529
endif
407
530
ifdef CONFIG_DSOUND
408
531
LIBS += -lole32 -ldxguid
409
532
endif
410
533
ifdef CONFIG_FMOD
411
534
LIBS += $(CONFIG_FMOD_LIB)
412
535
endif
 
536
ifdef CONFIG_OSS
 
537
LIBS += $(CONFIG_OSS_LIB)
 
538
endif
413
539
 
414
 
SOUND_HW = sb16.o es1370.o
 
540
SOUND_HW = sb16.o es1370.o ac97.o
415
541
ifdef CONFIG_ADLIB
416
542
SOUND_HW += fmopl.o adlib.o
 
543
adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
 
544
endif
 
545
ifdef CONFIG_GUS
 
546
SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
 
547
endif
 
548
ifdef CONFIG_CS4231A
 
549
SOUND_HW += cs4231a.o
417
550
endif
418
551
 
419
552
ifdef CONFIG_VNC_TLS
421
554
LIBS += $(CONFIG_VNC_TLS_LIBS)
422
555
endif
423
556
 
 
557
ifdef CONFIG_BLUEZ
 
558
LIBS += $(CONFIG_BLUEZ_LIBS)
 
559
endif
 
560
 
424
561
# SCSI layer
425
 
VL_OBJS+= lsi53c895a.o
 
562
OBJS+= lsi53c895a.o esp.o
426
563
 
427
564
# USB layer
428
 
VL_OBJS+= usb-ohci.o
 
565
OBJS+= usb-ohci.o
429
566
 
430
567
# EEPROM emulation
431
 
VL_OBJS += eeprom93xx.o
 
568
OBJS += eeprom93xx.o
432
569
 
433
570
# PCI network cards
434
 
VL_OBJS += eepro100.o
435
 
VL_OBJS += ne2000.o
436
 
VL_OBJS += pcnet.o
437
 
VL_OBJS += rtl8139.o
 
571
OBJS += eepro100.o
 
572
OBJS += ne2000.o
 
573
OBJS += pcnet.o
 
574
OBJS += rtl8139.o
 
575
OBJS += e1000.o
 
576
 
 
577
# Serial mouse
 
578
OBJS += msmouse.o
438
579
 
439
580
ifeq ($(TARGET_BASE_ARCH), i386)
440
581
# Hardware support
441
 
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
442
 
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
443
 
VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
444
 
VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
 
582
OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
 
583
OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
 
584
OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
 
585
OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
 
586
OBJS += device-hotplug.o pci-hotplug.o
445
587
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
446
588
endif
447
589
ifeq ($(TARGET_BASE_ARCH), ppc)
448
590
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
449
591
# shared objects
450
 
VL_OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
 
592
OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
451
593
# PREP target
452
 
VL_OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
453
 
VL_OBJS+= prep_pci.o ppc_prep.o
 
594
OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
 
595
OBJS+= prep_pci.o ppc_prep.o
454
596
# Mac shared devices
455
 
VL_OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
 
597
OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
456
598
# OldWorld PowerMac
457
 
VL_OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
 
599
OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
458
600
# NewWorld PowerMac
459
 
VL_OBJS+= unin_pci.o ppc_chrp.o
 
601
OBJS+= unin_pci.o ppc_newworld.o
460
602
# PowerPC 4xx boards
461
 
VL_OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
 
603
OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
 
604
OBJS+= ppc440.o ppc440_bamboo.o
 
605
# PowerPC E500 boards
 
606
OBJS+= ppce500_pci.o ppce500_mpc8544ds.o
 
607
ifdef FDT_LIBS
 
608
OBJS+= device_tree.o
 
609
LIBS+= $(FDT_LIBS)
 
610
endif
 
611
ifdef CONFIG_KVM
 
612
OBJS+= kvm_ppc.o
 
613
endif
462
614
endif
463
615
ifeq ($(TARGET_BASE_ARCH), mips)
464
 
VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
465
 
VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
466
 
VL_OBJS+= jazz_led.o
467
 
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
468
 
VL_OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
469
 
VL_OBJS+= mipsnet.o
470
 
VL_OBJS+= pflash_cfi01.o
471
 
CPPFLAGS += -DHAS_AUDIO
 
616
OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
 
617
OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
 
618
OBJS+= g364fb.o jazz_led.o
 
619
OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
 
620
OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
 
621
OBJS+= mipsnet.o
 
622
OBJS+= pflash_cfi01.o
 
623
OBJS+= vmware_vga.o
 
624
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
472
625
endif
473
626
ifeq ($(TARGET_BASE_ARCH), cris)
474
 
VL_OBJS+= etraxfs.o
475
 
VL_OBJS+= ptimer.o
476
 
VL_OBJS+= etraxfs_timer.o
477
 
VL_OBJS+= etraxfs_ser.o
 
627
# Boards
 
628
OBJS+= etraxfs.o axis_dev88.o
 
629
 
 
630
# IO blocks
 
631
OBJS+= etraxfs_dma.o
 
632
OBJS+= etraxfs_pic.o
 
633
OBJS+= etraxfs_eth.o
 
634
OBJS+= etraxfs_timer.o
 
635
OBJS+= etraxfs_ser.o
 
636
 
 
637
OBJS+= ptimer.o
 
638
OBJS+= pflash_cfi02.o nand.o
478
639
endif
479
640
ifeq ($(TARGET_BASE_ARCH), sparc)
480
641
ifeq ($(TARGET_ARCH), sparc64)
481
 
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
482
 
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
483
 
VL_OBJS+= cirrus_vga.o parallel.o ptimer.o
 
642
OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
 
643
OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
 
644
OBJS+= cirrus_vga.o parallel.o ptimer.o
484
645
else
485
 
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
486
 
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
487
 
VL_OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
 
646
OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
 
647
OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
 
648
OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
488
649
endif
489
650
endif
490
651
ifeq ($(TARGET_BASE_ARCH), arm)
491
 
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
492
 
VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
493
 
VL_OBJS+= versatile_pci.o ptimer.o
494
 
VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
495
 
VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
496
 
VL_OBJS+= pl061.o
497
 
VL_OBJS+= arm-semi.o
498
 
VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
499
 
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
500
 
VL_OBJS+= pflash_cfi01.o gumstix.o
501
 
VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o
502
 
VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
503
 
VL_OBJS+= palm.o tsc210x.o
504
 
VL_OBJS+= mst_fpga.o mainstone.o
 
652
OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
 
653
OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 
654
OBJS+= versatile_pci.o ptimer.o
 
655
OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
 
656
OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
 
657
OBJS+= pl061.o
 
658
OBJS+= arm-semi.o
 
659
OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 
660
OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 
661
OBJS+= pflash_cfi01.o gumstix.o
 
662
OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
 
663
OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
 
664
OBJS+= omap2.o omap_dss.o soc_dma.o
 
665
OBJS+= omap_sx1.o palm.o tsc210x.o
 
666
OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
 
667
OBJS+= tsc2005.o bt-hci-csr.o
 
668
OBJS+= mst_fpga.o mainstone.o
 
669
OBJS+= musicpal.o pflash_cfi02.o
505
670
CPPFLAGS += -DHAS_AUDIO
506
671
endif
507
672
ifeq ($(TARGET_BASE_ARCH), sh4)
508
 
VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
509
 
VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
 
673
OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
 
674
OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
 
675
OBJS+= ide.o
510
676
endif
511
677
ifeq ($(TARGET_BASE_ARCH), m68k)
512
 
VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
513
 
VL_OBJS+= m68k-semi.o dummy_m68k.o
 
678
OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
 
679
OBJS+= m68k-semi.o dummy_m68k.o
514
680
endif
515
681
ifdef CONFIG_GDBSTUB
516
 
VL_OBJS+=gdbstub.o
 
682
OBJS+=gdbstub.o gdbstub-xml.o
517
683
endif
518
684
ifdef CONFIG_COCOA
519
685
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
525
691
CPPFLAGS+=-I$(SRC_PATH)/slirp
526
692
endif
527
693
 
528
 
VL_LDFLAGS=$(VL_OS_LDFLAGS)
529
 
VL_LIBS=$(AIOLIBS)
 
694
LIBS+=$(AIOLIBS)
530
695
# specific flags are needed for non soft mmu emulator
531
696
ifdef CONFIG_STATIC
532
 
VL_LDFLAGS+=-static
533
 
endif
534
 
ifndef CONFIG_SOFTMMU
535
 
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
 
697
LDFLAGS+=-static
536
698
endif
537
699
ifndef CONFIG_DARWIN
538
700
ifndef CONFIG_WIN32
539
701
ifndef CONFIG_SOLARIS
540
 
VL_LIBS+=-lutil
 
702
ifndef CONFIG_AIX
 
703
LIBS+=-lutil
 
704
endif
541
705
endif
542
706
endif
543
707
endif
544
708
ifdef TARGET_GPROF
545
 
vl.o: BASE_CFLAGS+=-p
546
 
VL_LDFLAGS+=-p
 
709
vl.o: CFLAGS+=-p
 
710
LDFLAGS+=-p
547
711
endif
548
712
 
549
713
ifeq ($(ARCH),ia64)
550
 
VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
551
 
endif
552
 
 
553
 
ifeq ($(ARCH),sparc64)
554
 
  VL_LDFLAGS+=-m64
555
 
  ifneq ($(CONFIG_SOLARIS),yes)
556
 
    VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
557
 
  endif
558
 
endif
559
 
 
560
 
ifeq ($(ARCH),x86_64)
561
 
  VL_LDFLAGS+=-m64
562
 
  ifneq ($(CONFIG_SOLARIS),yes)
563
 
    VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
564
 
  endif
 
714
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
565
715
endif
566
716
 
567
717
ifdef CONFIG_WIN32
568
718
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
569
719
endif
570
720
 
571
 
$(QEMU_SYSTEM): $(VL_OBJS) ../libqemu_common.a libqemu.a
572
 
        $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
573
 
 
574
 
depend: $(SRCS)
575
 
        $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
576
 
 
577
 
vldepend: $(VL_OBJS:.o=.c)
578
 
        $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
579
 
 
580
 
# libqemu
581
 
 
582
 
libqemu.a: $(LIBOBJS)
 
721
# profiling code
 
722
ifdef TARGET_GPROF
 
723
LDFLAGS+=-p
 
724
main.o: CFLAGS+=-p
 
725
endif
 
726
 
 
727
$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
 
728
 
 
729
$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
 
730
        $(LINK)
 
731
 
 
732
endif # !CONFIG_USER_ONLY
 
733
 
 
734
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
583
735
        rm -f $@
584
 
        $(AR) rcs $@ $(LIBOBJS)
585
 
 
586
 
translate.o: translate.c gen-op.h opc.h cpu.h
587
 
 
588
 
translate-all.o: translate-all.c opc.h cpu.h
589
 
 
590
 
translate-op.o: translate-all.c op.h opc.h cpu.h
591
 
 
592
 
op.h: op.o $(DYNGEN)
593
 
        $(DYNGEN) -o $@ $<
594
 
 
595
 
opc.h: op.o $(DYNGEN)
596
 
        $(DYNGEN) -c -o $@ $<
597
 
 
598
 
gen-op.h: op.o $(DYNGEN)
599
 
        $(DYNGEN) -g -o $@ $<
600
 
 
601
 
op.o: op.c
602
 
        $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
603
 
 
604
 
# HELPER_CFLAGS is used for all the code compiled with static register
605
 
# variables
606
 
ifeq ($(TARGET_BASE_ARCH), i386)
607
 
# XXX: rename helper.c to op_helper.c
608
 
helper.o: helper.c
609
 
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
736
ifeq ($(TARGET_XML_FILES),)
 
737
        echo > $@
610
738
else
611
 
op_helper.o: op_helper.c
612
 
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
739
        $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
613
740
endif
614
741
 
615
 
cpu-exec.o: cpu-exec.c
616
 
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
617
 
 
618
 
# Note: this is a workaround. The real fix is to avoid compiling
619
 
# cpu_signal_handler() in cpu-exec.c.
620
 
signal.o: signal.c
621
 
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
622
 
 
623
 
%.o: %.c
624
 
        $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
625
 
 
626
 
%.o: %.S
627
 
        $(CC) $(CPPFLAGS) -c -o $@ $<
628
 
 
629
742
clean:
630
 
        rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o fpu/*.o
631
 
        rm -f *.d */*.d
 
743
        rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
 
744
        rm -f *.d */*.d tcg/*.o
632
745
 
633
746
install: all
634
747
ifneq ($(PROGS),)
635
748
        $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
636
749
endif
637
750
 
638
 
ifneq ($(wildcard .depend),)
639
 
include .depend
640
 
endif
641
 
 
642
 
ifeq (1, 0)
643
 
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
644
 
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
645
 
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
646
 
endif
647
 
 
648
751
# Include automatically generated dependency files
649
752
-include $(wildcard *.d */*.d)