~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to Makefile.target

  • Committer: ths
  • Date: 2007-10-08 12:45:38 UTC
  • Revision ID: git-v1:450d4ff553af32fc9d83fef20d7106b0151526b8
CRIS disassembler, originally from binutils, by Edgar E. Iglesias.


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

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
ifeq ($(TARGET_ARCH), ppc64)
14
14
TARGET_BASE_ARCH:=ppc
15
15
endif
16
 
ifeq ($(TARGET_ARCH), ppc64h)
17
 
TARGET_BASE_ARCH:=ppc
18
 
endif
19
16
ifeq ($(TARGET_ARCH), ppcemb)
20
17
TARGET_BASE_ARCH:=ppc
21
18
endif
23
20
TARGET_BASE_ARCH:=sparc
24
21
endif
25
22
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
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
 
23
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
 
24
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
 
25
ifdef CONFIG_DARWIN_USER
 
26
VPATH+=:$(SRC_PATH)/darwin-user
 
27
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
 
28
endif
 
29
ifdef CONFIG_LINUX_USER
 
30
VPATH+=:$(SRC_PATH)/linux-user
 
31
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
 
32
endif
 
33
BASE_CFLAGS=
 
34
BASE_LDFLAGS=
28
35
#CFLAGS+=-Werror
29
36
LIBS=
 
37
HELPER_CFLAGS=$(CFLAGS)
30
38
DYNGEN=../dyngen$(EXESUF)
31
39
# user emulator name
32
 
ifndef TARGET_ARCH2
33
40
TARGET_ARCH2=$(TARGET_ARCH)
34
 
endif
35
41
ifeq ($(TARGET_ARCH),arm)
36
42
  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
37
43
    TARGET_ARCH2=armeb
57
63
    TARGET_ARCH2=mips64el
58
64
  endif
59
65
endif
 
66
QEMU_USER=qemu-$(TARGET_ARCH2)
 
67
# system emulator name
 
68
ifdef CONFIG_SOFTMMU
 
69
ifeq ($(TARGET_ARCH), i386)
 
70
QEMU_SYSTEM=qemu$(EXESUF)
 
71
else
 
72
QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
 
73
endif
 
74
else
 
75
QEMU_SYSTEM=qemu-fast
 
76
endif
60
77
 
61
78
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
 
79
PROGS=$(QEMU_USER)
 
80
else
 
81
PROGS+=$(QEMU_SYSTEM)
 
82
ifndef CONFIG_SOFTMMU
 
83
CONFIG_STATIC=y
 
84
endif
 
85
endif # !CONFIG_USER_ONLY
72
86
 
73
 
PROGS=$(QEMU_PROG)
 
87
ifdef CONFIG_STATIC
 
88
BASE_LDFLAGS+=-static
 
89
endif
74
90
 
75
91
# 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
 
92
OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
78
93
 
79
94
# cc-option
80
95
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
92
107
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
93
108
OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
94
109
 
95
 
HELPER_CFLAGS=
96
 
 
97
110
ifeq ($(ARCH),i386)
98
111
HELPER_CFLAGS+=-fomit-frame-pointer
99
112
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
 
113
ifdef TARGET_GPROF
 
114
USE_I386_LD=y
 
115
endif
 
116
ifdef CONFIG_STATIC
 
117
USE_I386_LD=y
 
118
endif
 
119
ifdef USE_I386_LD
 
120
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
121
else
 
122
ifdef CONFIG_LINUX_USER
 
123
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
 
124
# that the kernel ELF loader considers as an executable. I think this
 
125
# is the simplest way to make it self virtualizable!
 
126
BASE_LDFLAGS+=-Wl,-shared
 
127
endif
 
128
endif
 
129
endif
 
130
 
 
131
ifeq ($(ARCH),x86_64)
 
132
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
106
133
endif
107
134
 
108
135
ifeq ($(ARCH),ppc)
109
136
CPPFLAGS+= -D__powerpc__
110
 
OP_CFLAGS+= -mlongcall
 
137
ifdef CONFIG_LINUX_USER
 
138
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
139
endif
 
140
endif
 
141
 
 
142
ifeq ($(ARCH),s390)
 
143
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
111
144
endif
112
145
 
113
146
ifeq ($(ARCH),sparc)
114
 
  CFLAGS+=-ffixed-g2 -ffixed-g3
 
147
  BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
115
148
  OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
116
149
  ifeq ($(CONFIG_SOLARIS),yes)
117
150
    OP_CFLAGS+=-fno-omit-frame-pointer
118
151
  else
119
 
    CFLAGS+=-ffixed-g1 -ffixed-g6
120
 
    HELPER_CFLAGS+=-ffixed-i0
 
152
    BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
 
153
    HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
 
154
    # -static is used to avoid g1/g3 usage by the dynamic linker
 
155
    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
121
156
  endif
122
157
endif
123
158
 
124
159
ifeq ($(ARCH),sparc64)
 
160
  BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
125
161
  OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
126
162
  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
 
163
    BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
164
    OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
131
165
  endif
132
166
endif
133
167
 
135
169
# -msmall-data is not used for OP_CFLAGS because we want two-instruction
136
170
# relocations for the constant constructions
137
171
# 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
 
172
BASE_CFLAGS+=-msmall-data
143
173
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
144
174
endif
145
175
 
146
176
ifeq ($(ARCH),ia64)
147
 
CFLAGS+=-mno-sdata
 
177
BASE_CFLAGS+=-mno-sdata
148
178
OP_CFLAGS+=-mno-sdata
 
179
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
149
180
endif
150
181
 
151
182
ifeq ($(ARCH),arm)
152
183
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
 
184
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
153
185
endif
154
186
 
155
187
ifeq ($(ARCH),m68k)
156
188
OP_CFLAGS+=-fomit-frame-pointer
 
189
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
157
190
endif
158
191
 
159
192
ifeq ($(ARCH),mips)
160
193
OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
 
194
ifeq ($(WORDS_BIGENDIAN),yes)
 
195
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
196
else
 
197
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
198
endif
161
199
endif
162
200
 
163
201
ifeq ($(ARCH),mips64)
164
202
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)
 
203
ifeq ($(WORDS_BIGENDIAN),yes)
 
204
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
205
else
 
206
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
 
207
endif
 
208
endif
 
209
 
 
210
ifeq ($(CONFIG_DARWIN),yes)
 
211
LIBS+=-lmx
 
212
endif
 
213
 
 
214
ifdef CONFIG_DARWIN_USER
 
215
# Leave some space for the regular program loading zone
 
216
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
 
217
endif
 
218
 
 
219
BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
 
220
BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
169
221
OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
 
222
OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
 
223
 
 
224
#########################################################
170
225
 
171
226
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
172
227
LIBS+=-lm
 
228
ifndef CONFIG_USER_ONLY
 
229
LIBS+=-lz
 
230
endif
173
231
ifdef CONFIG_WIN32
174
232
LIBS+=-lwinmm -lws2_32 -liphlpapi
175
233
endif
179
237
LIBS+=-lsunmath
180
238
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
181
239
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
 
#########################################################
 
240
BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
 
241
endif
 
242
endif
 
243
 
 
244
# profiling code
 
245
ifdef TARGET_GPROF
 
246
BASE_LDFLAGS+=-p
 
247
main.o: BASE_CFLAGS+=-p
 
248
endif
 
249
 
 
250
ifdef CONFIG_LINUX_USER
 
251
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
 
252
      elfload.o linuxload.o
 
253
LIBS+= $(AIOLIBS)
 
254
ifdef TARGET_HAS_BFLT
 
255
OBJS+= flatload.o
 
256
endif
 
257
 
 
258
ifeq ($(TARGET_ARCH), i386)
 
259
OBJS+= vm86.o
 
260
endif
 
261
ifeq ($(TARGET_ARCH), arm)
 
262
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
 
263
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
 
264
 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
 
265
endif
 
266
ifeq ($(TARGET_ARCH), m68k)
 
267
OBJS+= m68k-sim.o m68k-semi.o
 
268
endif
 
269
endif #CONFIG_LINUX_USER
 
270
 
 
271
ifdef CONFIG_DARWIN_USER
 
272
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
 
273
endif
 
274
 
 
275
SRCS:= $(OBJS:.o=.c)
 
276
OBJS+= libqemu.a
 
277
 
192
278
# 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
 
279
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
 
280
        translate.o op.o host-utils.o
205
281
ifdef CONFIG_SOFTFLOAT
206
282
LIBOBJS+=fpu/softfloat.o
207
283
else
208
284
LIBOBJS+=fpu/softfloat-native.o
209
285
endif
210
286
CPPFLAGS+=-I$(SRC_PATH)/fpu
211
 
LIBOBJS+= op_helper.o helper.o
 
287
 
 
288
ifeq ($(TARGET_ARCH), i386)
 
289
LIBOBJS+=helper.o helper2.o
 
290
ifeq ($(ARCH), i386)
 
291
LIBOBJS+=translate-copy.o
 
292
endif
 
293
endif
 
294
 
 
295
ifeq ($(TARGET_ARCH), x86_64)
 
296
LIBOBJS+=helper.o helper2.o
 
297
endif
 
298
 
 
299
ifeq ($(TARGET_BASE_ARCH), ppc)
 
300
LIBOBJS+= op_helper.o helper.o
 
301
endif
 
302
 
 
303
ifeq ($(TARGET_BASE_ARCH), mips)
 
304
LIBOBJS+= op_helper.o helper.o
 
305
endif
 
306
 
 
307
ifeq ($(TARGET_BASE_ARCH), sparc)
 
308
LIBOBJS+= op_helper.o helper.o
 
309
endif
212
310
 
213
311
ifeq ($(TARGET_BASE_ARCH), arm)
214
 
LIBOBJS+= neon_helper.o iwmmxt_helper.o
 
312
LIBOBJS+= op_helper.o helper.o
 
313
endif
 
314
 
 
315
ifeq ($(TARGET_BASE_ARCH), sh4)
 
316
LIBOBJS+= op_helper.o helper.o
 
317
endif
 
318
 
 
319
ifeq ($(TARGET_BASE_ARCH), m68k)
 
320
LIBOBJS+= op_helper.o helper.o
215
321
endif
216
322
 
217
323
ifeq ($(TARGET_BASE_ARCH), alpha)
218
 
LIBOBJS+= alpha_palcode.o
219
 
endif
220
 
 
221
 
ifeq ($(TARGET_BASE_ARCH), cris)
222
 
LIBOBJS+= cris-dis.o
223
 
 
224
 
ifndef CONFIG_USER_ONLY
225
 
LIBOBJS+= mmu.o
226
 
endif
 
324
LIBOBJS+= op_helper.o helper.o alpha_palcode.o
227
325
endif
228
326
 
229
327
# NOTE: the disassembler code is only needed for debugging
258
356
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
259
357
LIBOBJS+=sh4-dis.o
260
358
endif
261
 
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
262
 
LIBOBJS+=hppa-dis.o
263
 
endif
264
359
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
265
360
LIBOBJS+=s390-dis.o
266
361
endif
267
362
 
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
363
ifdef CONFIG_GDBSTUB
430
 
OBJS+=gdbstub.o gdbstub-xml.o
 
364
OBJS+=gdbstub.o
431
365
endif
432
366
 
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)
 
367
all: $(PROGS)
 
368
 
 
369
$(QEMU_USER): $(OBJS)
 
370
        $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^  $(LIBS)
442
371
ifeq ($(ARCH),alpha)
443
372
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
444
373
# the address space (31 bit so sign extending doesn't matter)
445
374
        echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
446
375
endif
447
376
 
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
 
377
# must use static linking to avoid leaving stuff in virtual address space
 
378
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o
 
379
VL_OBJS+=cutils.o
 
380
VL_OBJS+=block.o block-raw.o
 
381
VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o
 
382
VL_OBJS+=irq.o
596
383
ifdef CONFIG_WIN32
597
 
OBJS+=block-raw-win32.o
598
 
else
599
 
OBJS+=block-raw-posix.o migration-exec.o
 
384
VL_OBJS+=tap-win32.o
600
385
endif
601
386
 
602
 
LIBS+=-lz
 
387
SOUND_HW = sb16.o es1370.o
 
388
AUDIODRV = audio.o noaudio.o wavaudio.o mixeng.o
 
389
ifdef CONFIG_SDL
 
390
AUDIODRV += sdlaudio.o
 
391
endif
 
392
ifdef CONFIG_OSS
 
393
AUDIODRV += ossaudio.o
 
394
endif
 
395
ifdef CONFIG_COREAUDIO
 
396
AUDIODRV += coreaudio.o
 
397
endif
603
398
ifdef CONFIG_ALSA
 
399
AUDIODRV += alsaaudio.o
604
400
LIBS += -lasound
605
401
endif
606
 
ifdef CONFIG_ESD
607
 
LIBS += -lesd
608
 
endif
609
 
ifdef CONFIG_PA
610
 
LIBS += -lpulse-simple
611
 
endif
612
402
ifdef CONFIG_DSOUND
 
403
AUDIODRV += dsoundaudio.o
613
404
LIBS += -lole32 -ldxguid
614
405
endif
615
406
ifdef CONFIG_FMOD
 
407
AUDIODRV += fmodaudio.o
 
408
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
616
409
LIBS += $(CONFIG_FMOD_LIB)
617
410
endif
618
 
ifdef CONFIG_OSS
619
 
LIBS += $(CONFIG_OSS_LIB)
620
 
endif
621
 
 
622
 
SOUND_HW = sb16.o es1370.o
623
 
ifdef CONFIG_AC97
624
 
SOUND_HW += ac97.o
625
 
endif
626
411
ifdef CONFIG_ADLIB
627
412
SOUND_HW += fmopl.o adlib.o
628
413
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
 
414
AUDIODRV+= wavcapture.o
635
415
 
636
416
ifdef CONFIG_VNC_TLS
637
417
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
638
418
LIBS += $(CONFIG_VNC_TLS_LIBS)
639
419
endif
640
420
 
641
 
ifdef CONFIG_BLUEZ
642
 
LIBS += $(CONFIG_BLUEZ_LIBS)
643
 
endif
 
421
VL_OBJS += i2c.o smbus.o
644
422
 
645
423
# SCSI layer
646
 
OBJS+= lsi53c895a.o esp.o
 
424
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
647
425
 
648
426
# USB layer
649
 
OBJS+= usb-ohci.o
 
427
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
 
428
VL_OBJS+= usb-wacom.o
650
429
 
651
430
# EEPROM emulation
652
 
OBJS += eeprom93xx.o
 
431
VL_OBJS += eeprom93xx.o
653
432
 
654
433
# PCI network cards
655
 
OBJS += eepro100.o
656
 
OBJS += ne2000.o
657
 
OBJS += pcnet.o
658
 
OBJS += rtl8139.o
659
 
OBJS += e1000.o
 
434
VL_OBJS += eepro100.o
 
435
VL_OBJS += ne2000.o
 
436
VL_OBJS += pcnet.o
 
437
VL_OBJS += rtl8139.o
660
438
 
661
439
ifeq ($(TARGET_BASE_ARCH), i386)
662
440
# 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
 
441
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
 
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 smbus_eeprom.o vmmouse.o vmport.o vmware_vga.o
667
445
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
668
446
endif
669
447
ifeq ($(TARGET_BASE_ARCH), ppc)
670
 
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
671
 
# shared objects
672
 
OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
673
 
# 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
676
 
# Mac shared devices
677
 
OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
678
 
# OldWorld PowerMac
679
 
OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
680
 
# NewWorld PowerMac
681
 
OBJS+= unin_pci.o ppc_chrp.o
 
448
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
 
449
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o pflash_cfi02.o
 
450
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o
 
451
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
682
452
# PowerPC 4xx boards
683
 
OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
 
453
VL_OBJS+= ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
 
454
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
684
455
endif
685
456
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
694
 
endif
695
 
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
 
457
VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o
 
458
VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
 
459
VL_OBJS+= jazz_led.o
 
460
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
 
461
VL_OBJS+= piix_pci.o smbus_eeprom.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV)
 
462
CPPFLAGS += -DHAS_AUDIO
705
463
endif
706
464
ifeq ($(TARGET_BASE_ARCH), sparc)
707
465
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
 
466
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
 
467
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
 
468
VL_OBJS+= cirrus_vga.o parallel.o ptimer.o
711
469
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
 
470
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
 
471
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
 
472
VL_OBJS+= cs4231.o ptimer.o
715
473
endif
716
474
endif
717
475
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
 
476
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
 
477
VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
 
478
VL_OBJS+= versatile_pci.o sd.o ptimer.o
 
479
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
 
480
VL_OBJS+= arm-semi.o
 
481
VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 
482
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o
 
483
VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o $(AUDIODRV) wm8750.o
 
484
VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o palm.o ecc.o
736
485
CPPFLAGS += -DHAS_AUDIO
737
486
endif
738
487
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
 
488
VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
 
489
VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
741
490
endif
742
491
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
 
492
VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
 
493
VL_OBJS+= m68k-semi.o
745
494
endif
746
495
ifdef CONFIG_GDBSTUB
747
 
OBJS+=gdbstub.o gdbstub-xml.o
748
 
endif
 
496
VL_OBJS+=gdbstub.o
 
497
endif
 
498
ifdef CONFIG_SDL
 
499
VL_OBJS+=sdl.o x_keymap.o
 
500
endif
 
501
VL_OBJS+=vnc.o d3des.o
749
502
ifdef CONFIG_COCOA
 
503
VL_OBJS+=cocoa.o
750
504
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
751
505
ifdef CONFIG_COREAUDIO
752
506
COCOA_LIBS+=-framework CoreAudio
754
508
endif
755
509
ifdef CONFIG_SLIRP
756
510
CPPFLAGS+=-I$(SRC_PATH)/slirp
 
511
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
 
512
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
 
513
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
 
514
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
757
515
endif
758
516
 
759
 
LIBS+=$(AIOLIBS)
 
517
VL_LDFLAGS=$(VL_OS_LDFLAGS)
 
518
VL_LIBS=$(AIOLIBS)
760
519
# specific flags are needed for non soft mmu emulator
761
520
ifdef CONFIG_STATIC
762
 
LDFLAGS+=-static
 
521
VL_LDFLAGS+=-static
 
522
endif
 
523
ifndef CONFIG_SOFTMMU
 
524
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
763
525
endif
764
526
ifndef CONFIG_DARWIN
765
527
ifndef CONFIG_WIN32
766
528
ifndef CONFIG_SOLARIS
767
 
LIBS+=-lutil
 
529
VL_LIBS+=-lutil
768
530
endif
769
531
endif
770
532
endif
771
533
ifdef TARGET_GPROF
772
 
vl.o: CFLAGS+=-p
773
 
LDFLAGS+=-p
 
534
vl.o: BASE_CFLAGS+=-p
 
535
VL_LDFLAGS+=-p
774
536
endif
775
537
 
776
538
ifeq ($(ARCH),ia64)
777
 
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
 
539
VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
 
540
endif
 
541
 
 
542
ifeq ($(ARCH),sparc64)
 
543
  VL_LDFLAGS+=-m64
 
544
  ifneq ($(CONFIG_SOLARIS),yes)
 
545
    VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
 
546
  endif
778
547
endif
779
548
 
780
549
ifdef CONFIG_WIN32
781
550
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
782
551
endif
783
552
 
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
 
553
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
 
554
        $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
 
555
 
 
556
cocoa.o: cocoa.m
 
557
        $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
558
 
 
559
sdl.o: sdl.c keymaps.c sdl_keysym.h
 
560
        $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
561
 
 
562
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
 
563
        $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
564
 
 
565
sdlaudio.o: sdlaudio.c
 
566
        $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
567
 
 
568
depend: $(SRCS)
 
569
        $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
 
570
 
 
571
vldepend: $(VL_OBJS:.o=.c)
 
572
        $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
 
573
 
 
574
# libqemu
 
575
 
 
576
libqemu.a: $(LIBOBJS)
796
577
        rm -f $@
797
 
ifeq ($(TARGET_XML_FILES),)
798
 
        echo > $@
 
578
        $(AR) rcs $@ $(LIBOBJS)
 
579
 
 
580
translate.o: translate.c gen-op.h opc.h cpu.h
 
581
 
 
582
translate-all.o: translate-all.c opc.h cpu.h
 
583
 
 
584
translate-op.o: translate-all.c op.h opc.h cpu.h
 
585
 
 
586
op.h: op.o $(DYNGEN)
 
587
        $(DYNGEN) -o $@ $<
 
588
 
 
589
opc.h: op.o $(DYNGEN)
 
590
        $(DYNGEN) -c -o $@ $<
 
591
 
 
592
gen-op.h: op.o $(DYNGEN)
 
593
        $(DYNGEN) -g -o $@ $<
 
594
 
 
595
op.o: op.c
 
596
        $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
597
 
 
598
# HELPER_CFLAGS is used for all the code compiled with static register
 
599
# variables
 
600
ifeq ($(TARGET_BASE_ARCH), i386)
 
601
# XXX: rename helper.c to op_helper.c
 
602
helper.o: helper.c
 
603
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
799
604
else
800
 
        $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
801
 
endif
 
605
op_helper.o: op_helper.c
 
606
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
607
endif
 
608
 
 
609
cpu-exec.o: cpu-exec.c
 
610
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
611
 
 
612
# Note: this is a workaround. The real fix is to avoid compiling
 
613
# cpu_signal_handler() in cpu-exec.c.
 
614
signal.o: signal.c
 
615
        $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
 
616
 
 
617
vga.o: pixel_ops.h
 
618
 
 
619
tcx.o: pixel_ops.h
 
620
 
 
621
ifeq ($(TARGET_BASE_ARCH), i386)
 
622
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
 
623
endif
 
624
 
 
625
ifeq ($(TARGET_ARCH), arm)
 
626
op.o: op.c op_template.h
 
627
pl110.o: pl110_template.h
 
628
endif
 
629
 
 
630
ifeq ($(TARGET_BASE_ARCH), sparc)
 
631
helper.o: cpu.h exec-all.h
 
632
op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h exec.h cpu.h
 
633
op_helper.o: exec.h softmmu_template.h cpu.h
 
634
translate.o: cpu.h exec-all.h disas.h
 
635
endif
 
636
 
 
637
ifeq ($(TARGET_BASE_ARCH), ppc)
 
638
op.o: op.c op_template.h op_mem.h op_helper.h
 
639
op_helper.o: op_helper.c mfrom_table.c op_helper_mem.h op_helper.h
 
640
translate.o: translate.c translate_init.c
 
641
endif
 
642
 
 
643
ifeq ($(TARGET_BASE_ARCH), mips)
 
644
helper.o: cpu.h exec-all.h
 
645
op.o: op_template.c fop_template.c op_mem.c exec.h cpu.h
 
646
op_helper.o: op_helper_mem.c exec.h softmmu_template.h cpu.h
 
647
translate.o: translate_init.c exec-all.h disas.h
 
648
endif
 
649
 
 
650
loader.o: loader.c elf_ops.h
 
651
 
 
652
ifeq ($(TARGET_ARCH), sh4)
 
653
op.o: op.c op_mem.c cpu.h
 
654
op_helper.o: op_helper.c exec.h cpu.h
 
655
helper.o: helper.c exec.h cpu.h
 
656
sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h
 
657
shix.o: shix.c sh7750_regs.h sh7750_regnames.h
 
658
sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h
 
659
tc58128.o: tc58128.c
 
660
endif
 
661
 
 
662
ifeq ($(TARGET_BASE_ARCH), alpha)
 
663
op.o: op.c op_template.h op_mem.h
 
664
op_helper.o: op_helper_mem.h
 
665
endif
 
666
 
 
667
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
802
668
 
803
669
%.o: %.c
804
 
        $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
 
670
        $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
805
671
 
806
672
%.o: %.S
807
673
        $(CC) $(CPPFLAGS) -c -o $@ $<
808
674
 
809
675
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
 
676
        rm -f *.o  *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
812
677
 
813
678
install: all
814
679
ifneq ($(PROGS),)
815
680
        $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
816
681
endif
817
682
 
818
 
# Include automatically generated dependency files
819
 
-include $(wildcard *.d */*.d)
 
683
ifneq ($(wildcard .depend),)
 
684
include .depend
 
685
endif
 
686
 
 
687
ifeq (1, 0)
 
688
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
 
689
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
 
690
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
 
691
endif