~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to Makefile.target

  • Committer: blueswir1
  • Date: 2007-11-25 08:48:16 UTC
  • Revision ID: git-v1:b76482e76560345c00e7d6c89199ced204a926d2
 Fix buffer mux handling for unconnected serial ports


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3737 c046a42c-6fe2-441c-8c8c-71466251a162

Show diffs side-by-side

added added

removed removed

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