root / Makefile.target @ 6c041c54
History | View | Annotate | Download (14.9 kB)
1 | 626df76a | bellard | include config.mak |
---|---|---|---|
2 | 626df76a | bellard | |
3 | 0b0babc6 | bellard | TARGET_BASE_ARCH:=$(TARGET_ARCH) |
4 | 0b0babc6 | bellard | ifeq ($(TARGET_ARCH), x86_64) |
5 | 0b0babc6 | bellard | TARGET_BASE_ARCH:=i386 |
6 | 0b0babc6 | bellard | endif |
7 | a2458627 | bellard | ifeq ($(TARGET_ARCH), ppc64) |
8 | a2458627 | bellard | TARGET_BASE_ARCH:=ppc |
9 | a2458627 | bellard | endif |
10 | 64b3ab24 | bellard | ifeq ($(TARGET_ARCH), sparc64) |
11 | 64b3ab24 | bellard | TARGET_BASE_ARCH:=sparc |
12 | 64b3ab24 | bellard | endif |
13 | 0b0babc6 | bellard | TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
14 | 85571bc7 | bellard | VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio |
15 | 6f30fa85 | ths | CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) |
16 | 831b7825 | ths | ifdef CONFIG_DARWIN_USER |
17 | 831b7825 | ths | VPATH+=:$(SRC_PATH)/darwin-user |
18 | 831b7825 | ths | CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
19 | 831b7825 | ths | endif |
20 | 831b7825 | ths | ifdef CONFIG_LINUX_USER |
21 | 3035f7ff | bellard | VPATH+=:$(SRC_PATH)/linux-user |
22 | 6f30fa85 | ths | CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) |
23 | 3035f7ff | bellard | endif |
24 | 6f30fa85 | ths | BASE_CFLAGS= |
25 | 6f30fa85 | ths | BASE_LDFLAGS= |
26 | 0b0babc6 | bellard | #CFLAGS+=-Werror |
27 | 626df76a | bellard | LIBS= |
28 | 626df76a | bellard | HELPER_CFLAGS=$(CFLAGS) |
29 | 67b915a5 | bellard | DYNGEN=../dyngen$(EXESUF) |
30 | 1e43adfc | bellard | # user emulator name |
31 | c91fde65 | bellard | TARGET_ARCH2=$(TARGET_ARCH) |
32 | 808c4954 | bellard | ifeq ($(TARGET_ARCH),arm) |
33 | 808c4954 | bellard | ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
34 | c91fde65 | bellard | TARGET_ARCH2=armeb |
35 | 808c4954 | bellard | endif |
36 | c91fde65 | bellard | endif |
37 | 908f52b0 | pbrook | ifeq ($(TARGET_ARCH),sh4) |
38 | 908f52b0 | pbrook | ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
39 | 908f52b0 | pbrook | TARGET_ARCH2=sh4eb |
40 | 908f52b0 | pbrook | endif |
41 | 908f52b0 | pbrook | endif |
42 | 01f5e596 | bellard | ifeq ($(TARGET_ARCH),mips) |
43 | c91fde65 | bellard | ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
44 | c91fde65 | bellard | TARGET_ARCH2=mipsel |
45 | 01f5e596 | bellard | endif |
46 | 01f5e596 | bellard | endif |
47 | c91fde65 | bellard | QEMU_USER=qemu-$(TARGET_ARCH2) |
48 | 1e43adfc | bellard | # system emulator name |
49 | 1e43adfc | bellard | ifdef CONFIG_SOFTMMU |
50 | a541f297 | bellard | ifeq ($(TARGET_ARCH), i386) |
51 | 67b915a5 | bellard | QEMU_SYSTEM=qemu$(EXESUF) |
52 | 0db63474 | bellard | else |
53 | c91fde65 | bellard | QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
54 | a541f297 | bellard | endif |
55 | a541f297 | bellard | else |
56 | 0db63474 | bellard | QEMU_SYSTEM=qemu-fast |
57 | 1e43adfc | bellard | endif |
58 | 1e43adfc | bellard | |
59 | 16e9b7de | bellard | ifdef CONFIG_USER_ONLY |
60 | 1e43adfc | bellard | PROGS=$(QEMU_USER) |
61 | 16e9b7de | bellard | else |
62 | c321f673 | bellard | PROGS+=$(QEMU_SYSTEM) |
63 | de5eaa64 | bellard | ifndef CONFIG_SOFTMMU |
64 | de5eaa64 | bellard | CONFIG_STATIC=y |
65 | de5eaa64 | bellard | endif |
66 | 728c9fd5 | bellard | endif # !CONFIG_USER_ONLY |
67 | 626df76a | bellard | |
68 | 626df76a | bellard | ifdef CONFIG_STATIC |
69 | 6f30fa85 | ths | BASE_LDFLAGS+=-static |
70 | 626df76a | bellard | endif |
71 | 626df76a | bellard | |
72 | 6f30fa85 | ths | # We require -O2 to avoid the stack setup prologue in EXIT_TB |
73 | 6c041c54 | ths | OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing |
74 | 6c041c54 | ths | |
75 | 6c041c54 | ths | # cc-option |
76 | 6c041c54 | ths | # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) |
77 | 6c041c54 | ths | |
78 | 6c041c54 | ths | cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
79 | 6c041c54 | ths | > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
80 | 6c041c54 | ths | |
81 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "") |
82 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-gcse, "") |
83 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "") |
84 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "") |
85 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "") |
86 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-align-labels, "") |
87 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "") |
88 | 6c041c54 | ths | OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, "")) |
89 | 6f30fa85 | ths | |
90 | 626df76a | bellard | ifeq ($(ARCH),i386) |
91 | 6f30fa85 | ths | HELPER_CFLAGS+=-fomit-frame-pointer |
92 | 6f30fa85 | ths | OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer |
93 | 626df76a | bellard | ifdef TARGET_GPROF |
94 | 3a4739d6 | bellard | USE_I386_LD=y |
95 | 3a4739d6 | bellard | endif |
96 | 3a4739d6 | bellard | ifdef CONFIG_STATIC |
97 | 3a4739d6 | bellard | USE_I386_LD=y |
98 | 3a4739d6 | bellard | endif |
99 | 3a4739d6 | bellard | ifdef USE_I386_LD |
100 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
101 | 626df76a | bellard | else |
102 | 831b7825 | ths | ifdef CONFIG_LINUX_USER |
103 | 626df76a | bellard | # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
104 | 626df76a | bellard | # that the kernel ELF loader considers as an executable. I think this |
105 | 626df76a | bellard | # is the simplest way to make it self virtualizable! |
106 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-shared |
107 | 626df76a | bellard | endif |
108 | 626df76a | bellard | endif |
109 | 831b7825 | ths | endif |
110 | 626df76a | bellard | |
111 | 0b0babc6 | bellard | ifeq ($(ARCH),x86_64) |
112 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
113 | bc51c5c9 | bellard | endif |
114 | bc51c5c9 | bellard | |
115 | 626df76a | bellard | ifeq ($(ARCH),ppc) |
116 | 6f30fa85 | ths | CPPFLAGS+= -D__powerpc__ |
117 | 831b7825 | ths | ifdef CONFIG_LINUX_USER |
118 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
119 | 626df76a | bellard | endif |
120 | 831b7825 | ths | endif |
121 | 626df76a | bellard | |
122 | 626df76a | bellard | ifeq ($(ARCH),s390) |
123 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
124 | 626df76a | bellard | endif |
125 | 626df76a | bellard | |
126 | 626df76a | bellard | ifeq ($(ARCH),sparc) |
127 | fdbb4691 | bellard | ifeq ($(CONFIG_SOLARIS),yes) |
128 | 6f30fa85 | ths | BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 |
129 | 6f30fa85 | ths | BASE_LDFLAGS+=-m32 |
130 | 6f30fa85 | ths | OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 |
131 | fdbb4691 | bellard | else |
132 | 6f30fa85 | ths | BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 |
133 | 6f30fa85 | ths | BASE_LDFLAGS+=-m32 |
134 | 6f30fa85 | ths | OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 |
135 | 626df76a | bellard | HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat |
136 | 626df76a | bellard | # -static is used to avoid g1/g3 usage by the dynamic linker |
137 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
138 | 626df76a | bellard | endif |
139 | fdbb4691 | bellard | endif |
140 | 626df76a | bellard | |
141 | 626df76a | bellard | ifeq ($(ARCH),sparc64) |
142 | 6f30fa85 | ths | BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
143 | 6f30fa85 | ths | BASE_LDFLAGS+=-m64 |
144 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
145 | 6f30fa85 | ths | OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0 |
146 | 626df76a | bellard | endif |
147 | 626df76a | bellard | |
148 | 626df76a | bellard | ifeq ($(ARCH),alpha) |
149 | 6f30fa85 | ths | # -msmall-data is not used for OP_CFLAGS because we want two-instruction |
150 | 6f30fa85 | ths | # relocations for the constant constructions |
151 | 626df76a | bellard | # Ensure there's only a single GP |
152 | 6f30fa85 | ths | BASE_CFLAGS+=-msmall-data |
153 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
154 | 626df76a | bellard | endif |
155 | 626df76a | bellard | |
156 | 626df76a | bellard | ifeq ($(ARCH),ia64) |
157 | 6f30fa85 | ths | BASE_CFLAGS+=-mno-sdata |
158 | 6f30fa85 | ths | OP_CFLAGS+=-mno-sdata |
159 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
160 | 626df76a | bellard | endif |
161 | 626df76a | bellard | |
162 | 626df76a | bellard | ifeq ($(ARCH),arm) |
163 | 6f30fa85 | ths | OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer |
164 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
165 | 626df76a | bellard | endif |
166 | 626df76a | bellard | |
167 | 38e584a0 | bellard | ifeq ($(ARCH),m68k) |
168 | 6f30fa85 | ths | OP_CFLAGS+=-fomit-frame-pointer |
169 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
170 | 6f30fa85 | ths | endif |
171 | 6f30fa85 | ths | |
172 | 6f30fa85 | ths | ifeq ($(ARCH),mips) |
173 | 6f30fa85 | ths | BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
174 | 38e584a0 | bellard | endif |
175 | 38e584a0 | bellard | |
176 | 83fb7adf | bellard | ifeq ($(CONFIG_DARWIN),yes) |
177 | e80cfcfc | bellard | LIBS+=-lmx |
178 | 83fb7adf | bellard | endif |
179 | 83fb7adf | bellard | |
180 | 01feaa05 | ths | ifdef CONFIG_DARWIN_USER |
181 | 01feaa05 | ths | # Leave some space for the regular program loading zone |
182 | 01feaa05 | ths | BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 |
183 | 01feaa05 | ths | endif |
184 | 01feaa05 | ths | |
185 | ea785922 | ths | BASE_CFLAGS+=$(OS_CFLAGS) |
186 | 6f30fa85 | ths | OP_CFLAGS+=$(OS_CFLAGS) |
187 | 6f30fa85 | ths | |
188 | 626df76a | bellard | ######################################################### |
189 | 626df76a | bellard | |
190 | 6f30fa85 | ths | CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
191 | 626df76a | bellard | LIBS+=-lm |
192 | b932caba | bellard | ifndef CONFIG_USER_ONLY |
193 | b932caba | bellard | LIBS+=-lz |
194 | b932caba | bellard | endif |
195 | 67b915a5 | bellard | ifdef CONFIG_WIN32 |
196 | 3db38e87 | bellard | LIBS+=-lwinmm -lws2_32 -liphlpapi |
197 | 67b915a5 | bellard | endif |
198 | ec530c81 | bellard | ifdef CONFIG_SOLARIS |
199 | ec530c81 | bellard | LIBS+=-lsocket -lnsl -lresolv |
200 | ec530c81 | bellard | endif |
201 | 626df76a | bellard | |
202 | 626df76a | bellard | # profiling code |
203 | 626df76a | bellard | ifdef TARGET_GPROF |
204 | 6f30fa85 | ths | BASE_LDFLAGS+=-p |
205 | 6f30fa85 | ths | main.o: BASE_CFLAGS+=-p |
206 | 626df76a | bellard | endif |
207 | 626df76a | bellard | |
208 | 831b7825 | ths | ifdef CONFIG_LINUX_USER |
209 | e5fe0c52 | pbrook | OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
210 | e5fe0c52 | pbrook | elfload.o linuxload.o |
211 | e5fe0c52 | pbrook | ifdef TARGET_HAS_BFLT |
212 | e5fe0c52 | pbrook | OBJS+= flatload.o |
213 | e5fe0c52 | pbrook | endif |
214 | e5fe0c52 | pbrook | |
215 | 626df76a | bellard | ifeq ($(TARGET_ARCH), i386) |
216 | 626df76a | bellard | OBJS+= vm86.o |
217 | 626df76a | bellard | endif |
218 | f72b519c | bellard | ifeq ($(TARGET_ARCH), arm) |
219 | 158142c2 | bellard | OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
220 | f72b519c | bellard | nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
221 | a4f81979 | bellard | nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
222 | f72b519c | bellard | endif |
223 | e6e5906b | pbrook | ifeq ($(TARGET_ARCH), m68k) |
224 | e6e5906b | pbrook | OBJS+= m68k-sim.o m68k-semi.o |
225 | e6e5906b | pbrook | endif |
226 | 831b7825 | ths | endif #CONFIG_LINUX_USER |
227 | 831b7825 | ths | |
228 | 831b7825 | ths | ifdef CONFIG_DARWIN_USER |
229 | 831b7825 | ths | OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o |
230 | 831b7825 | ths | endif |
231 | 831b7825 | ths | |
232 | 626df76a | bellard | SRCS:= $(OBJS:.o=.c) |
233 | 626df76a | bellard | OBJS+= libqemu.a |
234 | 626df76a | bellard | |
235 | 626df76a | bellard | # cpu emulator library |
236 | 158142c2 | bellard | LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
237 | e3086fbf | bellard | translate.o op.o |
238 | 158142c2 | bellard | ifdef CONFIG_SOFTFLOAT |
239 | 158142c2 | bellard | LIBOBJS+=fpu/softfloat.o |
240 | 158142c2 | bellard | else |
241 | 158142c2 | bellard | LIBOBJS+=fpu/softfloat-native.o |
242 | 158142c2 | bellard | endif |
243 | 6f30fa85 | ths | CPPFLAGS+=-I$(SRC_PATH)/fpu |
244 | 626df76a | bellard | |
245 | 626df76a | bellard | ifeq ($(TARGET_ARCH), i386) |
246 | 1e43adfc | bellard | LIBOBJS+=helper.o helper2.o |
247 | f72b519c | bellard | ifeq ($(ARCH), i386) |
248 | f72b519c | bellard | LIBOBJS+=translate-copy.o |
249 | f72b519c | bellard | endif |
250 | 626df76a | bellard | endif |
251 | 626df76a | bellard | |
252 | 0b0babc6 | bellard | ifeq ($(TARGET_ARCH), x86_64) |
253 | 0b0babc6 | bellard | LIBOBJS+=helper.o helper2.o |
254 | 0b0babc6 | bellard | endif |
255 | 0b0babc6 | bellard | |
256 | a2458627 | bellard | ifeq ($(TARGET_BASE_ARCH), ppc) |
257 | 728c9fd5 | bellard | LIBOBJS+= op_helper.o helper.o |
258 | 67867308 | bellard | endif |
259 | 67867308 | bellard | |
260 | 6af0bf9c | bellard | ifeq ($(TARGET_ARCH), mips) |
261 | 6af0bf9c | bellard | LIBOBJS+= op_helper.o helper.o |
262 | 6af0bf9c | bellard | endif |
263 | 6af0bf9c | bellard | |
264 | 64b3ab24 | bellard | ifeq ($(TARGET_BASE_ARCH), sparc) |
265 | e95c8d51 | bellard | LIBOBJS+= op_helper.o helper.o |
266 | e95c8d51 | bellard | endif |
267 | e95c8d51 | bellard | |
268 | b7bcbe95 | bellard | ifeq ($(TARGET_BASE_ARCH), arm) |
269 | b5ff1b31 | bellard | LIBOBJS+= op_helper.o helper.o |
270 | b7bcbe95 | bellard | endif |
271 | b7bcbe95 | bellard | |
272 | fdf9b3e8 | bellard | ifeq ($(TARGET_BASE_ARCH), sh4) |
273 | fdf9b3e8 | bellard | LIBOBJS+= op_helper.o helper.o |
274 | fdf9b3e8 | bellard | endif |
275 | fdf9b3e8 | bellard | |
276 | e6e5906b | pbrook | ifeq ($(TARGET_BASE_ARCH), m68k) |
277 | e6e5906b | pbrook | LIBOBJS+= helper.o |
278 | e6e5906b | pbrook | endif |
279 | e6e5906b | pbrook | |
280 | 626df76a | bellard | # NOTE: the disassembler code is only needed for debugging |
281 | 626df76a | bellard | LIBOBJS+=disas.o |
282 | 626df76a | bellard | ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
283 | bc51c5c9 | bellard | USE_I386_DIS=y |
284 | bc51c5c9 | bellard | endif |
285 | 0b0babc6 | bellard | ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
286 | bc51c5c9 | bellard | USE_I386_DIS=y |
287 | bc51c5c9 | bellard | endif |
288 | bc51c5c9 | bellard | ifdef USE_I386_DIS |
289 | 626df76a | bellard | LIBOBJS+=i386-dis.o |
290 | 626df76a | bellard | endif |
291 | 626df76a | bellard | ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
292 | 626df76a | bellard | LIBOBJS+=alpha-dis.o |
293 | 626df76a | bellard | endif |
294 | a2458627 | bellard | ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
295 | 626df76a | bellard | LIBOBJS+=ppc-dis.o |
296 | 626df76a | bellard | endif |
297 | 6af0bf9c | bellard | ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
298 | 6af0bf9c | bellard | LIBOBJS+=mips-dis.o |
299 | 6af0bf9c | bellard | endif |
300 | 64b3ab24 | bellard | ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
301 | 626df76a | bellard | LIBOBJS+=sparc-dis.o |
302 | 626df76a | bellard | endif |
303 | 626df76a | bellard | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
304 | 626df76a | bellard | LIBOBJS+=arm-dis.o |
305 | 626df76a | bellard | endif |
306 | 48024e4a | bellard | ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
307 | 48024e4a | bellard | LIBOBJS+=m68k-dis.o |
308 | 48024e4a | bellard | endif |
309 | fdf9b3e8 | bellard | ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
310 | fdf9b3e8 | bellard | LIBOBJS+=sh4-dis.o |
311 | fdf9b3e8 | bellard | endif |
312 | 626df76a | bellard | |
313 | 1fddef4b | bellard | ifdef CONFIG_GDBSTUB |
314 | 1fddef4b | bellard | OBJS+=gdbstub.o |
315 | 1fddef4b | bellard | endif |
316 | 626df76a | bellard | |
317 | 1e43adfc | bellard | all: $(PROGS) |
318 | 626df76a | bellard | |
319 | 1e43adfc | bellard | $(QEMU_USER): $(OBJS) |
320 | 6f30fa85 | ths | $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS) |
321 | 626df76a | bellard | ifeq ($(ARCH),alpha) |
322 | 626df76a | bellard | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
323 | 626df76a | bellard | # the address space (31 bit so sign extending doesn't matter) |
324 | 626df76a | bellard | echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
325 | 626df76a | bellard | endif |
326 | 626df76a | bellard | |
327 | 626df76a | bellard | # must use static linking to avoid leaving stuff in virtual address space |
328 | aef445bd | pbrook | VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
329 | 18607dcb | bellard | VL_OBJS+=cutils.o |
330 | 83f64091 | bellard | VL_OBJS+=block.o block-raw.o |
331 | 42ca6388 | bellard | 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 |
332 | 7fb843f8 | bellard | ifdef CONFIG_WIN32 |
333 | 7fb843f8 | bellard | VL_OBJS+=tap-win32.o |
334 | 7fb843f8 | bellard | endif |
335 | a541f297 | bellard | |
336 | 1d14ffa9 | bellard | SOUND_HW = sb16.o es1370.o |
337 | 7372f88d | bellard | AUDIODRV = audio.o noaudio.o wavaudio.o |
338 | fb065187 | bellard | ifdef CONFIG_SDL |
339 | fb065187 | bellard | AUDIODRV += sdlaudio.o |
340 | fb065187 | bellard | endif |
341 | fb065187 | bellard | ifdef CONFIG_OSS |
342 | fb065187 | bellard | AUDIODRV += ossaudio.o |
343 | fb065187 | bellard | endif |
344 | 1d14ffa9 | bellard | ifdef CONFIG_COREAUDIO |
345 | 1d14ffa9 | bellard | AUDIODRV += coreaudio.o |
346 | 1d14ffa9 | bellard | endif |
347 | 1d14ffa9 | bellard | ifdef CONFIG_ALSA |
348 | 1d14ffa9 | bellard | AUDIODRV += alsaaudio.o |
349 | 1d14ffa9 | bellard | LIBS += -lasound |
350 | 1d14ffa9 | bellard | endif |
351 | 1d14ffa9 | bellard | ifdef CONFIG_DSOUND |
352 | 1d14ffa9 | bellard | AUDIODRV += dsoundaudio.o |
353 | 1d14ffa9 | bellard | LIBS += -lole32 -ldxguid |
354 | 85571bc7 | bellard | endif |
355 | 102a52e4 | bellard | ifdef CONFIG_FMOD |
356 | 85571bc7 | bellard | AUDIODRV += fmodaudio.o |
357 | 6f30fa85 | ths | audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS) |
358 | 102a52e4 | bellard | LIBS += $(CONFIG_FMOD_LIB) |
359 | 85571bc7 | bellard | endif |
360 | 1d14ffa9 | bellard | ifdef CONFIG_ADLIB |
361 | 1d14ffa9 | bellard | SOUND_HW += fmopl.o adlib.o |
362 | 1d14ffa9 | bellard | endif |
363 | ec36b695 | bellard | AUDIODRV+= wavcapture.o |
364 | 85571bc7 | bellard | |
365 | 2e5d83bb | pbrook | # SCSI layer |
366 | 7d8406be | pbrook | VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
367 | 2e5d83bb | pbrook | |
368 | a594cfbf | bellard | # USB layer |
369 | 2e5d83bb | pbrook | VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
370 | a594cfbf | bellard | |
371 | a41b2ff2 | pbrook | # PCI network cards |
372 | e3c2613f | bellard | VL_OBJS+= ne2000.o rtl8139.o pcnet.o |
373 | a41b2ff2 | pbrook | |
374 | 0b0babc6 | bellard | ifeq ($(TARGET_BASE_ARCH), i386) |
375 | a541f297 | bellard | # Hardware support |
376 | a41b2ff2 | pbrook | VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
377 | fd06c375 | bellard | VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
378 | 502a5395 | pbrook | VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o |
379 | 3fffc223 | ths | VL_OBJS+= usb-uhci.o smbus_eeprom.o |
380 | 6f30fa85 | ths | CPPFLAGS += -DHAS_AUDIO |
381 | 67b915a5 | bellard | endif |
382 | a2458627 | bellard | ifeq ($(TARGET_BASE_ARCH), ppc) |
383 | a41b2ff2 | pbrook | VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
384 | 64201201 | bellard | VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
385 | e68b9b2b | bellard | VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
386 | 502a5395 | pbrook | VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
387 | 6f30fa85 | ths | CPPFLAGS += -DHAS_AUDIO |
388 | a541f297 | bellard | endif |
389 | 6af0bf9c | bellard | ifeq ($(TARGET_ARCH), mips) |
390 | 4de9b249 | ths | VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o |
391 | 9542611a | ths | VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o |
392 | 5856de80 | ths | VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV) |
393 | 5856de80 | ths | DEFINES += -DHAS_AUDIO |
394 | 6af0bf9c | bellard | endif |
395 | 64b3ab24 | bellard | ifeq ($(TARGET_BASE_ARCH), sparc) |
396 | 3475187d | bellard | ifeq ($(TARGET_ARCH), sparc64) |
397 | 502a5395 | pbrook | VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
398 | 83469015 | bellard | VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
399 | 83469015 | bellard | VL_OBJS+= cirrus_vga.o parallel.o |
400 | 3475187d | bellard | else |
401 | 67e999be | bellard | VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
402 | 67e999be | bellard | VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o |
403 | b8174937 | bellard | VL_OBJS+= cs4231.o |
404 | 3475187d | bellard | endif |
405 | e95c8d51 | bellard | endif |
406 | b5ff1b31 | bellard | ifeq ($(TARGET_BASE_ARCH), arm) |
407 | cdbdb648 | pbrook | VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
408 | 16406950 | pbrook | VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o |
409 | 502a5395 | pbrook | VL_OBJS+= versatile_pci.o |
410 | e69954b9 | pbrook | VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
411 | 8e71621f | pbrook | VL_OBJS+= arm-semi.o |
412 | b5ff1b31 | bellard | endif |
413 | fdf9b3e8 | bellard | ifeq ($(TARGET_BASE_ARCH), sh4) |
414 | fdf9b3e8 | bellard | VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o |
415 | fdf9b3e8 | bellard | endif |
416 | a541f297 | bellard | ifdef CONFIG_GDBSTUB |
417 | a541f297 | bellard | VL_OBJS+=gdbstub.o |
418 | 728c9fd5 | bellard | endif |
419 | 626df76a | bellard | ifdef CONFIG_SDL |
420 | 6070dd07 | ths | VL_OBJS+=sdl.o x_keymap.o |
421 | de5eaa64 | bellard | endif |
422 | 24236869 | bellard | VL_OBJS+=vnc.o |
423 | 5b0753e0 | bellard | ifdef CONFIG_COCOA |
424 | 5b0753e0 | bellard | VL_OBJS+=cocoa.o |
425 | 1d14ffa9 | bellard | COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
426 | 1d14ffa9 | bellard | ifdef CONFIG_COREAUDIO |
427 | 1d14ffa9 | bellard | COCOA_LIBS+=-framework CoreAudio |
428 | 1d14ffa9 | bellard | endif |
429 | 5b0753e0 | bellard | endif |
430 | 7c1f25b4 | bellard | ifdef CONFIG_SLIRP |
431 | 6f30fa85 | ths | CPPFLAGS+=-I$(SRC_PATH)/slirp |
432 | 7c1f25b4 | bellard | SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
433 | 7c1f25b4 | bellard | slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ |
434 | c7f74643 | bellard | tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
435 | 7c1f25b4 | bellard | VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
436 | 626df76a | bellard | endif |
437 | 626df76a | bellard | |
438 | c321f673 | bellard | VL_LDFLAGS= |
439 | 70956b77 | ths | VL_LIBS=$(AIOLIBS) |
440 | c321f673 | bellard | # specific flags are needed for non soft mmu emulator |
441 | c321f673 | bellard | ifdef CONFIG_STATIC |
442 | c321f673 | bellard | VL_LDFLAGS+=-static |
443 | c321f673 | bellard | endif |
444 | de5eaa64 | bellard | ifndef CONFIG_SOFTMMU |
445 | de5eaa64 | bellard | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
446 | de5eaa64 | bellard | endif |
447 | 83fb7adf | bellard | ifndef CONFIG_DARWIN |
448 | 11d9f695 | bellard | ifndef CONFIG_WIN32 |
449 | ec530c81 | bellard | ifndef CONFIG_SOLARIS |
450 | 70956b77 | ths | VL_LIBS+=-lutil |
451 | 11d9f695 | bellard | endif |
452 | 83fb7adf | bellard | endif |
453 | ec530c81 | bellard | endif |
454 | e3086fbf | bellard | ifdef TARGET_GPROF |
455 | 6f30fa85 | ths | vl.o: BASE_CFLAGS+=-p |
456 | e3086fbf | bellard | VL_LDFLAGS+=-p |
457 | e3086fbf | bellard | endif |
458 | c321f673 | bellard | |
459 | b8076a74 | bellard | ifeq ($(ARCH),ia64) |
460 | b8076a74 | bellard | VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
461 | b8076a74 | bellard | endif |
462 | b8076a74 | bellard | |
463 | 74ccb34e | bellard | ifeq ($(ARCH),sparc64) |
464 | 74ccb34e | bellard | VL_LDFLAGS+=-m64 |
465 | 74ccb34e | bellard | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld |
466 | 74ccb34e | bellard | endif |
467 | 74ccb34e | bellard | |
468 | 1d14ffa9 | bellard | ifdef CONFIG_WIN32 |
469 | 1d14ffa9 | bellard | SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
470 | 1d14ffa9 | bellard | endif |
471 | 1d14ffa9 | bellard | |
472 | 1e43adfc | bellard | $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
473 | 3a11702b | pbrook | $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
474 | 5b0753e0 | bellard | |
475 | 5b0753e0 | bellard | cocoa.o: cocoa.m |
476 | 6f30fa85 | ths | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
477 | 626df76a | bellard | |
478 | 3d11d0eb | bellard | sdl.o: sdl.c keymaps.c sdl_keysym.h |
479 | 6f30fa85 | ths | $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
480 | 626df76a | bellard | |
481 | 24236869 | bellard | vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h |
482 | 6f30fa85 | ths | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
483 | 24236869 | bellard | |
484 | 9f059eca | bellard | sdlaudio.o: sdlaudio.c |
485 | 6f30fa85 | ths | $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
486 | 9f059eca | bellard | |
487 | 626df76a | bellard | depend: $(SRCS) |
488 | 6f30fa85 | ths | $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
489 | 626df76a | bellard | |
490 | 1d14ffa9 | bellard | vldepend: $(VL_OBJS:.o=.c) |
491 | 6f30fa85 | ths | $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
492 | 1d14ffa9 | bellard | |
493 | 626df76a | bellard | # libqemu |
494 | 626df76a | bellard | |
495 | 626df76a | bellard | libqemu.a: $(LIBOBJS) |
496 | 626df76a | bellard | rm -f $@ |
497 | 626df76a | bellard | $(AR) rcs $@ $(LIBOBJS) |
498 | 626df76a | bellard | |
499 | 1e43adfc | bellard | translate.o: translate.c gen-op.h opc.h cpu.h |
500 | 626df76a | bellard | |
501 | 158142c2 | bellard | translate-all.o: translate-all.c opc.h cpu.h |
502 | 158142c2 | bellard | |
503 | 158142c2 | bellard | translate-op.o: translate-all.c op.h opc.h cpu.h |
504 | 626df76a | bellard | |
505 | 1e43adfc | bellard | op.h: op.o $(DYNGEN) |
506 | 626df76a | bellard | $(DYNGEN) -o $@ $< |
507 | 626df76a | bellard | |
508 | 1e43adfc | bellard | opc.h: op.o $(DYNGEN) |
509 | 626df76a | bellard | $(DYNGEN) -c -o $@ $< |
510 | 626df76a | bellard | |
511 | 1e43adfc | bellard | gen-op.h: op.o $(DYNGEN) |
512 | 626df76a | bellard | $(DYNGEN) -g -o $@ $< |
513 | 626df76a | bellard | |
514 | 1e43adfc | bellard | op.o: op.c |
515 | 6f30fa85 | ths | $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< |
516 | 626df76a | bellard | |
517 | 6e1b3e4d | bellard | # HELPER_CFLAGS is used for all the code compiled with static register |
518 | 6e1b3e4d | bellard | # variables |
519 | 6e1b3e4d | bellard | ifeq ($(TARGET_BASE_ARCH), i386) |
520 | 6e1b3e4d | bellard | # XXX: rename helper.c to op_helper.c |
521 | 1e43adfc | bellard | helper.o: helper.c |
522 | 6f30fa85 | ths | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
523 | 6e1b3e4d | bellard | else |
524 | 6e1b3e4d | bellard | op_helper.o: op_helper.c |
525 | 6f30fa85 | ths | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
526 | 6e1b3e4d | bellard | endif |
527 | 6e1b3e4d | bellard | |
528 | 6e1b3e4d | bellard | cpu-exec.o: cpu-exec.c |
529 | 6f30fa85 | ths | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
530 | 626df76a | bellard | |
531 | 00a67ba1 | bellard | # Note: this is a workaround. The real fix is to avoid compiling |
532 | 00a67ba1 | bellard | # cpu_signal_handler() in cpu-exec.c. |
533 | 00a67ba1 | bellard | signal.o: signal.c |
534 | 6f30fa85 | ths | $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
535 | 00a67ba1 | bellard | |
536 | 0b0babc6 | bellard | ifeq ($(TARGET_BASE_ARCH), i386) |
537 | 664e0f19 | bellard | op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
538 | 1e43adfc | bellard | endif |
539 | 1e43adfc | bellard | |
540 | 1e43adfc | bellard | ifeq ($(TARGET_ARCH), arm) |
541 | 1e43adfc | bellard | op.o: op.c op_template.h |
542 | bdd5003a | pbrook | pl110.o: pl110_template.h |
543 | 1e43adfc | bellard | endif |
544 | 626df76a | bellard | |
545 | 64b3ab24 | bellard | ifeq ($(TARGET_BASE_ARCH), sparc) |
546 | 3475187d | bellard | op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
547 | 3475187d | bellard | magic_load.o: elf_op.h |
548 | 1e43adfc | bellard | endif |
549 | 626df76a | bellard | |
550 | a2458627 | bellard | ifeq ($(TARGET_BASE_ARCH), ppc) |
551 | 728c9fd5 | bellard | op.o: op.c op_template.h op_mem.h |
552 | 728c9fd5 | bellard | op_helper.o: op_helper_mem.h |
553 | 3fc6c082 | bellard | translate.o: translate.c translate_init.c |
554 | 728c9fd5 | bellard | endif |
555 | 728c9fd5 | bellard | |
556 | 6af0bf9c | bellard | ifeq ($(TARGET_ARCH), mips) |
557 | c281868e | ths | op.o: op.c op_template.c fop_template.c op_mem.c |
558 | 6af0bf9c | bellard | op_helper.o: op_helper_mem.c |
559 | 33d68b5f | ths | translate.o: translate.c translate_init.c |
560 | 6af0bf9c | bellard | endif |
561 | 6af0bf9c | bellard | |
562 | 5fe141fd | bellard | loader.o: loader.c elf_ops.h |
563 | 5fe141fd | bellard | |
564 | fdf9b3e8 | bellard | ifeq ($(TARGET_ARCH), sh4) |
565 | fdf9b3e8 | bellard | op.o: op.c op_mem.c cpu.h |
566 | fdf9b3e8 | bellard | op_helper.o: op_helper.c exec.h cpu.h |
567 | fdf9b3e8 | bellard | helper.o: helper.c exec.h cpu.h |
568 | 27c7ca7e | bellard | sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
569 | 27c7ca7e | bellard | shix.o: shix.c sh7750_regs.h sh7750_regnames.h |
570 | fdf9b3e8 | bellard | sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
571 | 27c7ca7e | bellard | tc58128.o: tc58128.c |
572 | fdf9b3e8 | bellard | endif |
573 | fdf9b3e8 | bellard | |
574 | 214feb51 | pbrook | $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
575 | 214feb51 | pbrook | |
576 | 626df76a | bellard | %.o: %.c |
577 | 6f30fa85 | ths | $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
578 | 626df76a | bellard | |
579 | f72b519c | bellard | %.o: %.S |
580 | 6f30fa85 | ths | $(CC) $(CPPFLAGS) -c -o $@ $< |
581 | f72b519c | bellard | |
582 | 626df76a | bellard | clean: |
583 | e362b55a | bellard | rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
584 | 1e43adfc | bellard | |
585 | 1e43adfc | bellard | install: all |
586 | 9b14bb04 | bellard | ifneq ($(PROGS),) |
587 | 6a882643 | pbrook | $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
588 | 9b14bb04 | bellard | endif |
589 | 626df76a | bellard | |
590 | 626df76a | bellard | ifneq ($(wildcard .depend),) |
591 | 626df76a | bellard | include .depend |
592 | 626df76a | bellard | endif |
593 | 1d14ffa9 | bellard | |
594 | c0fe3827 | bellard | ifeq (1, 0) |
595 | 1d14ffa9 | bellard | audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
596 | c0fe3827 | bellard | fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
597 | 1d14ffa9 | bellard | CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
598 | 1d14ffa9 | bellard | endif |