blob: f9f1c5984f3cd911783ff6abe80df76201cd1f77 [file] [log] [blame]
bellard626df762003-08-10 21:39:31 +00001include config.mak
aliguori17759182009-01-21 18:12:52 +00002include $(SRC_PATH)/rules.mak
bellard626df762003-08-10 21:39:31 +00003
bellard0b0babc2005-01-03 23:38:40 +00004TARGET_BASE_ARCH:=$(TARGET_ARCH)
5ifeq ($(TARGET_ARCH), x86_64)
6TARGET_BASE_ARCH:=i386
7endif
ths540635b2007-09-30 01:58:33 +00008ifeq ($(TARGET_ARCH), mipsn32)
9TARGET_BASE_ARCH:=mips
10endif
thsfbe4f652007-04-01 11:16:48 +000011ifeq ($(TARGET_ARCH), mips64)
12TARGET_BASE_ARCH:=mips
13endif
bellarda2458622005-07-23 22:39:53 +000014ifeq ($(TARGET_ARCH), ppc64)
15TARGET_BASE_ARCH:=ppc
16endif
j_mayer22f8a8b2007-10-14 08:38:29 +000017ifeq ($(TARGET_ARCH), ppc64h)
18TARGET_BASE_ARCH:=ppc
19endif
j_mayerd4082e92007-04-24 07:34:03 +000020ifeq ($(TARGET_ARCH), ppcemb)
21TARGET_BASE_ARCH:=ppc
22endif
bellard64b3ab22005-01-30 22:43:42 +000023ifeq ($(TARGET_ARCH), sparc64)
24TARGET_BASE_ARCH:=sparc
25endif
bellard0b0babc2005-01-03 23:38:40 +000026TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
bellard4fb240a2007-11-07 19:24:02 +000027VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
balrog46dc3882008-06-02 02:09:09 +000028CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
bellard0b0babc2005-01-03 23:38:40 +000029#CFLAGS+=-Werror
bellard626df762003-08-10 21:39:31 +000030LIBS=
bellard1e43adf2003-09-30 20:54:24 +000031# user emulator name
bellard0c64b9c2008-01-06 18:27:58 +000032ifndef TARGET_ARCH2
bellardc91fde62006-05-02 22:52:36 +000033TARGET_ARCH2=$(TARGET_ARCH)
bellard0c64b9c2008-01-06 18:27:58 +000034endif
bellard808c4952004-12-19 23:33:47 +000035ifeq ($(TARGET_ARCH),arm)
36 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
bellardc91fde62006-05-02 22:52:36 +000037 TARGET_ARCH2=armeb
bellard808c4952004-12-19 23:33:47 +000038 endif
bellardc91fde62006-05-02 22:52:36 +000039endif
pbrook908f52b2006-06-18 19:16:53 +000040ifeq ($(TARGET_ARCH),sh4)
41 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
42 TARGET_ARCH2=sh4eb
43 endif
44endif
bellard01f5e592005-12-06 21:42:17 +000045ifeq ($(TARGET_ARCH),mips)
bellardc91fde62006-05-02 22:52:36 +000046 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
47 TARGET_ARCH2=mipsel
bellard01f5e592005-12-06 21:42:17 +000048 endif
bellard808c4952004-12-19 23:33:47 +000049endif
ths540635b2007-09-30 01:58:33 +000050ifeq ($(TARGET_ARCH),mipsn32)
51 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
52 TARGET_ARCH2=mipsn32el
53 endif
54endif
thsfbe4f652007-04-01 11:16:48 +000055ifeq ($(TARGET_ARCH),mips64)
56 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
57 TARGET_ARCH2=mips64el
58 endif
59endif
bellard1e43adf2003-09-30 20:54:24 +000060
bellard16e9b7d2003-10-27 21:09:52 +000061ifdef CONFIG_USER_ONLY
bellard40293e52008-01-31 11:32:10 +000062# user emulator name
63QEMU_PROG=qemu-$(TARGET_ARCH2)
bellard16e9b7d2003-10-27 21:09:52 +000064else
bellard40293e52008-01-31 11:32:10 +000065# system emulator name
66ifeq ($(TARGET_ARCH), i386)
67QEMU_PROG=qemu$(EXESUF)
68else
69QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
bellardde5eaa62003-11-16 23:18:17 +000070endif
bellard40293e52008-01-31 11:32:10 +000071endif
bellard728c9fd2004-01-05 00:08:14 +000072
bellard40293e52008-01-31 11:32:10 +000073PROGS=$(QEMU_PROG)
bellard626df762003-08-10 21:39:31 +000074
ths6c041c52007-03-18 23:23:31 +000075# cc-option
aliguoric7328802009-01-21 18:12:27 +000076# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
ths6c041c52007-03-18 23:23:31 +000077
aliguoric7328802009-01-21 18:12:27 +000078cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
79 > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
ths6f30fa82007-01-05 01:00:47 +000080
bellard40293e52008-01-31 11:32:10 +000081HELPER_CFLAGS=
82
bellard626df762003-08-10 21:39:31 +000083ifeq ($(ARCH),i386)
ths6f30fa82007-01-05 01:00:47 +000084HELPER_CFLAGS+=-fomit-frame-pointer
bellardbc51c5c2004-03-17 23:46:04 +000085endif
86
malcd19076f2009-04-02 01:16:39 +000087ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
88translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
89endif
90
bellard626df762003-08-10 21:39:31 +000091ifeq ($(ARCH),sparc)
aliguoric7328802009-01-21 18:12:27 +000092 ifneq ($(CONFIG_SOLARIS),yes)
bellard40293e52008-01-31 11:32:10 +000093 HELPER_CFLAGS+=-ffixed-i0
blueswir131422552007-04-16 18:27:06 +000094 endif
bellardfdbb4692006-06-14 17:32:25 +000095endif
bellard626df762003-08-10 21:39:31 +000096
bellard626df762003-08-10 21:39:31 +000097ifeq ($(ARCH),alpha)
bellard626df762003-08-10 21:39:31 +000098# Ensure there's only a single GP
bellard40293e52008-01-31 11:32:10 +000099CFLAGS+=-msmall-data
bellard626df762003-08-10 21:39:31 +0000100endif
101
aurel32f54b3f92008-04-12 20:14:54 +0000102ifeq ($(ARCH),hppa)
aurel32f54b3f92008-04-12 20:14:54 +0000103BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
104endif
105
bellard626df762003-08-10 21:39:31 +0000106ifeq ($(ARCH),ia64)
bellard40293e52008-01-31 11:32:10 +0000107CFLAGS+=-mno-sdata
bellard38e584a2003-08-10 22:14:22 +0000108endif
109
bellard40293e52008-01-31 11:32:10 +0000110CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
111LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
bellard626df762003-08-10 21:39:31 +0000112
ths6f30fa82007-01-05 01:00:47 +0000113CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
bellard626df762003-08-10 21:39:31 +0000114LIBS+=-lm
bellard67b915a2004-03-31 23:37:16 +0000115ifdef CONFIG_WIN32
bellard3db38e82004-07-14 17:19:55 +0000116LIBS+=-lwinmm -lws2_32 -liphlpapi
bellard67b915a2004-03-31 23:37:16 +0000117endif
bellardec530c82006-04-25 22:36:06 +0000118ifdef CONFIG_SOLARIS
119LIBS+=-lsocket -lnsl -lresolv
ths0475a5c2007-04-01 18:54:44 +0000120ifdef NEEDS_LIBSUNMATH
121LIBS+=-lsunmath
122LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
bellard40293e52008-01-31 11:32:10 +0000123CFLAGS+=-I/opt/SUNWspro/prod/include/cc
ths0475a5c2007-04-01 18:54:44 +0000124endif
bellardec530c82006-04-25 22:36:06 +0000125endif
bellard626df762003-08-10 21:39:31 +0000126
aliguori7ba1e612008-11-05 16:04:33 +0000127kvm.o: CFLAGS+=$(KVM_CFLAGS)
128kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
129
bellard40293e52008-01-31 11:32:10 +0000130all: $(PROGS)
Paul Brookc2fb2632009-05-25 18:54:53 +0100131# Dummy command so that make thinks it has done something
132 @true
bellard626df762003-08-10 21:39:31 +0000133
bellard40293e52008-01-31 11:32:10 +0000134#########################################################
bellard626df762003-08-10 21:39:31 +0000135# cpu emulator library
blueswir12d6ebb02009-04-18 19:25:43 +0000136LIBOBJS=exec.o translate-all.o cpu-exec.o\
blueswir1cf2be982008-03-21 18:03:09 +0000137 translate.o host-utils.o
blueswir12d6ebb02009-04-18 19:25:43 +0000138ifdef CONFIG_KQEMU
139LIBOBJS+= kqemu.o
140endif
bellard57fec1f2008-02-01 10:50:11 +0000141# TCG code generator
aurel3249516bc2008-12-07 18:15:45 +0000142LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
bellard57fec1f2008-02-01 10:50:11 +0000143CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
blueswir18289b272008-02-27 17:53:27 +0000144ifeq ($(ARCH),sparc64)
145CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
146endif
bellard158142c2005-03-13 16:54:06 +0000147ifdef CONFIG_SOFTFLOAT
148LIBOBJS+=fpu/softfloat.o
149else
150LIBOBJS+=fpu/softfloat-native.o
151endif
ths6f30fa82007-01-05 01:00:47 +0000152CPPFLAGS+=-I$(SRC_PATH)/fpu
bellard728c9fd2004-01-05 00:08:14 +0000153LIBOBJS+= op_helper.o helper.o
bellarde95c8d52004-09-30 22:22:08 +0000154
bellardb7bcbe92005-02-22 19:27:29 +0000155ifeq ($(TARGET_BASE_ARCH), arm)
bellardeaa728e2008-05-28 12:51:20 +0000156LIBOBJS+= neon_helper.o iwmmxt_helper.o
pbrooke6e59062006-10-22 00:18:54 +0000157endif
158
j_mayercf6c1b12007-04-05 20:46:02 +0000159ifeq ($(TARGET_BASE_ARCH), alpha)
bellardeaa728e2008-05-28 12:51:20 +0000160LIBOBJS+= alpha_palcode.o
j_mayercf6c1b12007-04-05 20:46:02 +0000161endif
162
thse7daa602007-10-08 13:38:27 +0000163ifeq ($(TARGET_BASE_ARCH), cris)
thse7daa602007-10-08 13:38:27 +0000164LIBOBJS+= cris-dis.o
165
166ifndef CONFIG_USER_ONLY
167LIBOBJS+= mmu.o
168endif
169endif
170
bellard626df762003-08-10 21:39:31 +0000171# NOTE: the disassembler code is only needed for debugging
ths5fafdf22007-09-16 21:08:06 +0000172LIBOBJS+=disas.o
bellard626df762003-08-10 21:39:31 +0000173ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
bellardbc51c5c2004-03-17 23:46:04 +0000174USE_I386_DIS=y
175endif
bellard0b0babc2005-01-03 23:38:40 +0000176ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
bellardbc51c5c2004-03-17 23:46:04 +0000177USE_I386_DIS=y
178endif
179ifdef USE_I386_DIS
bellard626df762003-08-10 21:39:31 +0000180LIBOBJS+=i386-dis.o
181endif
182ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
183LIBOBJS+=alpha-dis.o
184endif
bellarda2458622005-07-23 22:39:53 +0000185ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
bellard626df762003-08-10 21:39:31 +0000186LIBOBJS+=ppc-dis.o
187endif
thsfbe4f652007-04-01 11:16:48 +0000188ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
bellard6af0bf92005-07-02 14:58:51 +0000189LIBOBJS+=mips-dis.o
190endif
bellard64b3ab22005-01-30 22:43:42 +0000191ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
bellard626df762003-08-10 21:39:31 +0000192LIBOBJS+=sparc-dis.o
193endif
194ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
195LIBOBJS+=arm-dis.o
196endif
bellard48024e42005-11-06 16:52:11 +0000197ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
198LIBOBJS+=m68k-dis.o
199endif
bellardfdf9b3e2006-04-27 21:07:38 +0000200ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
201LIBOBJS+=sh4-dis.o
202endif
aurel32f54b3f92008-04-12 20:14:54 +0000203ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
204LIBOBJS+=hppa-dis.o
205endif
ths8f860bb2007-07-31 23:44:21 +0000206ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
207LIBOBJS+=s390-dis.o
208endif
bellard626df762003-08-10 21:39:31 +0000209
bellard40293e52008-01-31 11:32:10 +0000210# libqemu
211
212libqemu.a: $(LIBOBJS)
bellard40293e52008-01-31 11:32:10 +0000213
aurel3286e840e2008-12-07 15:21:23 +0000214translate.o: translate.c cpu.h
bellard40293e52008-01-31 11:32:10 +0000215
aurel3286e840e2008-12-07 15:21:23 +0000216translate-all.o: translate-all.c cpu.h
bellard40293e52008-01-31 11:32:10 +0000217
aurel3286e840e2008-12-07 15:21:23 +0000218tcg/tcg.o: cpu.h
bellard40293e52008-01-31 11:32:10 +0000219
220# HELPER_CFLAGS is used for all the code compiled with static register
221# variables
aliguori807544e2009-01-21 18:12:44 +0000222op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
bellard40293e52008-01-31 11:32:10 +0000223
aliguori807544e2009-01-21 18:12:44 +0000224cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
bellard40293e52008-01-31 11:32:10 +0000225
226#########################################################
227# Linux user emulator target
228
229ifdef CONFIG_LINUX_USER
230
bellard40293e52008-01-31 11:32:10 +0000231ifndef TARGET_ABI_DIR
232 TARGET_ABI_DIR=$(TARGET_ARCH)
233endif
aurel323ebdd112008-04-09 06:53:01 +0000234VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
bellard40293e52008-01-31 11:32:10 +0000235CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
236
237ifdef CONFIG_STATIC
238LDFLAGS+=-static
239endif
240
241ifeq ($(ARCH),i386)
242ifdef TARGET_GPROF
243USE_I386_LD=y
244endif
245ifdef CONFIG_STATIC
246USE_I386_LD=y
247endif
248ifdef USE_I386_LD
249LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
250else
251# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
252# that the kernel ELF loader considers as an executable. I think this
253# is the simplest way to make it self virtualizable!
254LDFLAGS+=-Wl,-shared
255endif
256endif
257
258ifeq ($(ARCH),x86_64)
259LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
260endif
261
262ifeq ($(ARCH),ppc)
263LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
264endif
265
malc810260a2008-07-23 19:17:46 +0000266ifeq ($(ARCH),ppc64)
267LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
268endif
269
bellard40293e52008-01-31 11:32:10 +0000270ifeq ($(ARCH),s390)
271LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
272endif
273
274ifeq ($(ARCH),sparc)
275# -static is used to avoid g1/g3 usage by the dynamic linker
276LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
277endif
278
279ifeq ($(ARCH),sparc64)
280LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
281endif
282
283ifeq ($(ARCH),alpha)
284LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
285endif
286
287ifeq ($(ARCH),ia64)
288LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
289endif
290
291ifeq ($(ARCH),arm)
292LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
293endif
294
295ifeq ($(ARCH),m68k)
296LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
297endif
298
299ifeq ($(ARCH),mips)
300ifeq ($(WORDS_BIGENDIAN),yes)
301LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
302else
303LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
304endif
305endif
306
307ifeq ($(ARCH),mips64)
308ifeq ($(WORDS_BIGENDIAN),yes)
309LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
310else
311LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
312endif
313endif
314
aurel326d946cd2008-11-06 16:15:18 +0000315# profiling code
316ifdef TARGET_GPROF
317LDFLAGS+=-p
318CFLAGS+=-p
319endif
320
pbrook17e23772008-06-09 13:47:45 +0000321OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
Jan Kiszka322f9d02009-05-08 09:01:00 +0200322 elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o
aliguorie5d355d2009-04-24 18:03:15 +0000323LIBS+= $(PTHREADLIBS)
324LIBS+= $(CLOCKLIBS)
bellard40293e52008-01-31 11:32:10 +0000325ifdef TARGET_HAS_BFLT
326OBJS+= flatload.o
327endif
328ifdef TARGET_HAS_ELFLOAD32
329OBJS+= elfload32.o
330elfload32.o: elfload.c
331endif
332
333ifeq ($(TARGET_ARCH), i386)
334OBJS+= vm86.o
335endif
336ifeq ($(TARGET_ARCH), arm)
337OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
338nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
339 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
340endif
341ifeq ($(TARGET_ARCH), m68k)
342OBJS+= m68k-sim.o m68k-semi.o
343endif
344
bellard40293e52008-01-31 11:32:10 +0000345# Note: this is a workaround. The real fix is to avoid compiling
346# cpu_signal_handler() in cpu-exec.c.
aliguori807544e2009-01-21 18:12:44 +0000347signal.o: CFLAGS += $(HELPER_CFLAGS)
bellard40293e52008-01-31 11:32:10 +0000348
Anthony Liguori0bfe3ca2009-05-14 19:29:53 +0100349$(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a
350$(QEMU_PROG): $(OBJS) ../libqemu_user.a libqemu.a
351 $(call LINK,$(OBJS))
bellard626df762003-08-10 21:39:31 +0000352ifeq ($(ARCH),alpha)
353# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
354# the address space (31 bit so sign extending doesn't matter)
355 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
356endif
357
bellard40293e52008-01-31 11:32:10 +0000358endif #CONFIG_LINUX_USER
359
360#########################################################
361# Darwin user emulator target
362
363ifdef CONFIG_DARWIN_USER
364
365VPATH+=:$(SRC_PATH)/darwin-user
366CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
367
368# Leave some space for the regular program loading zone
369LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
370
371LIBS+=-lmx
372
Jan Kiszka322f9d02009-05-08 09:01:00 +0200373OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
374 gdbstub.o gdbstub-xml.o
bellard40293e52008-01-31 11:32:10 +0000375
bellard40293e52008-01-31 11:32:10 +0000376# Note: this is a workaround. The real fix is to avoid compiling
377# cpu_signal_handler() in cpu-exec.c.
aliguori807544e2009-01-21 18:12:44 +0000378signal.o: CFLAGS += $(HELPER_CFLAGS)
bellard40293e52008-01-31 11:32:10 +0000379
Anthony Liguori0bfe3ca2009-05-14 19:29:53 +0100380$(QEMU_PROG): ARLIBS=libqemu.a
381$(QEMU_PROG): $(OBJS) libqemu.a
382 $(call LINK,$(OBJS))
bellard40293e52008-01-31 11:32:10 +0000383
384endif #CONFIG_DARWIN_USER
385
386#########################################################
blueswir184778502008-10-26 20:33:16 +0000387# BSD user emulator target
388
389ifdef CONFIG_BSD_USER
390
391VPATH+=:$(SRC_PATH)/bsd-user
392CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
393
394ifdef CONFIG_STATIC
395LDFLAGS+=-static
396endif
397
398ifeq ($(ARCH),i386)
399ifdef TARGET_GPROF
400USE_I386_LD=y
401endif
402ifdef CONFIG_STATIC
403USE_I386_LD=y
404endif
405ifdef USE_I386_LD
406LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
407else
408# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
409# that the kernel ELF loader considers as an executable. I think this
410# is the simplest way to make it self virtualizable!
411LDFLAGS+=-Wl,-shared
412endif
413endif
414
415ifeq ($(ARCH),x86_64)
416LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
417endif
418
419ifeq ($(ARCH),ppc)
420LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
421endif
422
423ifeq ($(ARCH),ppc64)
424LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
425endif
426
427ifeq ($(ARCH),s390)
428LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
429endif
430
431ifeq ($(ARCH),sparc)
432# -static is used to avoid g1/g3 usage by the dynamic linker
433LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
434endif
435
436ifeq ($(ARCH),sparc64)
437LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
438endif
439
440ifeq ($(ARCH),alpha)
441LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
442endif
443
444ifeq ($(ARCH),ia64)
445LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
446endif
447
448ifeq ($(ARCH),arm)
449LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
450endif
451
452ifeq ($(ARCH),m68k)
453LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
454endif
455
456ifeq ($(ARCH),mips)
457ifeq ($(WORDS_BIGENDIAN),yes)
458LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
459else
460LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
461endif
462endif
463
464ifeq ($(ARCH),mips64)
465ifeq ($(WORDS_BIGENDIAN),yes)
466LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
467else
468LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
469endif
470endif
471
Jan Kiszka322f9d02009-05-08 09:01:00 +0200472OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
473 gdbstub.o gdbstub-xml.o
blueswir184778502008-10-26 20:33:16 +0000474OBJS+= uaccess.o
475
blueswir184778502008-10-26 20:33:16 +0000476# Note: this is a workaround. The real fix is to avoid compiling
477# cpu_signal_handler() in cpu-exec.c.
aliguori807544e2009-01-21 18:12:44 +0000478signal.o: CFLAGS += $(HELPER_CFLAGS)
blueswir184778502008-10-26 20:33:16 +0000479
Anthony Liguori0bfe3ca2009-05-14 19:29:53 +0100480$(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a
481$(QEMU_PROG): $(OBJS) libqemu.a ../libqemu_user.a
482 $(call LINK,$(OBJS))
blueswir184778502008-10-26 20:33:16 +0000483
484endif #CONFIG_BSD_USER
485
486#########################################################
bellard40293e52008-01-31 11:32:10 +0000487# System emulator target
488ifndef CONFIG_USER_ONLY
489
Paul Brook1ad21342009-05-19 16:17:58 +0100490OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \
491 gdbstub.o gdbstub-xml.o
aliguori1fd31ad2008-12-18 01:56:22 +0000492# virtio has to be here due to weird dependency between PCI and virtio-net.
493# need to fix this properly
Paul Brook53c25ce2009-05-18 14:51:59 +0100494OBJS+=virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
aliguori7ba1e612008-11-05 16:04:33 +0000495ifdef CONFIG_KVM
496OBJS+=kvm.o kvm-all.o
497endif
aliguoria3392f92008-09-11 18:00:19 +0000498
bellard40293e52008-01-31 11:32:10 +0000499LIBS+=-lz
bellard1d14ffa2005-10-30 18:58:22 +0000500ifdef CONFIG_ALSA
bellard1d14ffa2005-10-30 18:58:22 +0000501LIBS += -lasound
502endif
balrogca9cc282008-01-14 04:24:29 +0000503ifdef CONFIG_ESD
504LIBS += -lesd
505endif
malcb8e59f12008-07-02 21:03:08 +0000506ifdef CONFIG_PA
507LIBS += -lpulse-simple
508endif
bellard1d14ffa2005-10-30 18:58:22 +0000509ifdef CONFIG_DSOUND
bellard1d14ffa2005-10-30 18:58:22 +0000510LIBS += -lole32 -ldxguid
511endif
bellard102a52e2004-11-14 19:57:29 +0000512ifdef CONFIG_FMOD
bellard102a52e2004-11-14 19:57:29 +0000513LIBS += $(CONFIG_FMOD_LIB)
bellard85571bc2004-11-07 18:04:02 +0000514endif
blueswir12f6a1ab2008-08-21 18:00:53 +0000515ifdef CONFIG_OSS
516LIBS += $(CONFIG_OSS_LIB)
517endif
bellard4fb240a2007-11-07 19:24:02 +0000518
aliguorib0f3b8f2009-01-08 21:03:55 +0000519SOUND_HW = sb16.o es1370.o ac97.o
bellard1d14ffa2005-10-30 18:58:22 +0000520ifdef CONFIG_ADLIB
521SOUND_HW += fmopl.o adlib.o
malcc40e8662008-12-11 00:14:25 +0000522adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
bellard1d14ffa2005-10-30 18:58:22 +0000523endif
balrog423d65f2008-01-14 22:09:11 +0000524ifdef CONFIG_GUS
525SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
526endif
malccc53d262008-06-13 10:48:22 +0000527ifdef CONFIG_CS4231A
528SOUND_HW += cs4231a.o
529endif
bellard85571bc2004-11-07 18:04:02 +0000530
ths8d5d2d42007-08-25 01:37:51 +0000531ifdef CONFIG_VNC_TLS
532CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
533LIBS += $(CONFIG_VNC_TLS_LIBS)
534endif
535
aliguori2f9606b2009-03-06 20:27:28 +0000536ifdef CONFIG_VNC_SASL
537CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
538LIBS += $(CONFIG_VNC_SASL_LIBS)
539endif
540
balrogfb599c92008-09-28 23:49:55 +0000541ifdef CONFIG_BLUEZ
542LIBS += $(CONFIG_BLUEZ_LIBS)
543endif
544
aliguorie37630c2009-04-22 15:19:10 +0000545# xen backend driver support
Blue Swirl2567f572009-05-21 15:54:48 +0000546XEN_OBJS := xen_machine_pv.o xen_domainbuild.o
aliguorie37630c2009-04-22 15:19:10 +0000547ifeq ($(CONFIG_XEN), yes)
548 OBJS += $(XEN_OBJS)
549 LIBS += $(XEN_LIBS)
550endif
551
bellarda594cfb2005-11-06 16:13:29 +0000552# USB layer
bellard40293e52008-01-31 11:32:10 +0000553OBJS+= usb-ohci.o
bellarda594cfb2005-11-06 16:13:29 +0000554
pbrooka41b2ff2006-02-05 04:14:41 +0000555# PCI network cards
bellard40293e52008-01-31 11:32:10 +0000556OBJS += eepro100.o
557OBJS += ne2000.o
558OBJS += pcnet.o
559OBJS += rtl8139.o
balrog7c23b892008-02-03 02:20:18 +0000560OBJS += e1000.o
pbrooka41b2ff2006-02-05 04:14:41 +0000561
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +0100562# Generic watchdog support and some watchdog devices
Richard W.M. Jones9dd986c2009-04-25 13:56:19 +0100563OBJS += wdt_ib700.o wdt_i6300esb.o
564
bellard0b0babc2005-01-03 23:38:40 +0000565ifeq ($(TARGET_BASE_ARCH), i386)
bellarda541f292004-04-12 20:39:29 +0000566# Hardware support
blueswir1e9c28332009-04-11 09:04:44 +0000567OBJS+= ide.o pckbd.o vga.o $(SOUND_HW) dma.o
Anthony Liguori71b9b0c2009-05-22 10:10:36 -0500568OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
aliguori610626a2009-03-12 20:25:12 +0000569OBJS+= cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
aliguori16b29ae2008-12-17 23:28:44 +0000570OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
aliguorib6f6e3d2009-04-17 18:59:56 +0000571OBJS += device-hotplug.o pci-hotplug.o smbios.o
balrogb00052e2007-04-30 02:22:06 +0000572CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
bellard67b915a2004-03-31 23:37:16 +0000573endif
bellarda2458622005-07-23 22:39:53 +0000574ifeq ($(TARGET_BASE_ARCH), ppc)
aurel3270ad3de2008-12-14 17:30:18 +0000575CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
j_mayer3cbee152007-10-28 23:42:18 +0000576# shared objects
bellard40293e52008-01-31 11:32:10 +0000577OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
j_mayer3cbee152007-10-28 23:42:18 +0000578# PREP target
Anthony Liguori71b9b0c2009-05-22 10:10:36 -0500579OBJS+= pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
bellard40293e52008-01-31 11:32:10 +0000580OBJS+= prep_pci.o ppc_prep.o
j_mayer3cbee152007-10-28 23:42:18 +0000581# Mac shared devices
Blue Swirle20a8df2009-05-21 15:54:36 +0000582OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
j_mayer3cbee152007-10-28 23:42:18 +0000583# OldWorld PowerMac
bellard40293e52008-01-31 11:32:10 +0000584OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
j_mayer3cbee152007-10-28 23:42:18 +0000585# NewWorld PowerMac
blueswir1b98a0032009-02-08 12:49:13 +0000586OBJS+= unin_pci.o ppc_newworld.o
j_mayer3cbee152007-10-28 23:42:18 +0000587# PowerPC 4xx boards
aurel32825bb582008-12-02 23:53:50 +0000588OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
aurel322c9fade2008-12-16 10:44:14 +0000589OBJS+= ppc440.o ppc440_bamboo.o
aurel3274c62ba2009-03-02 16:42:23 +0000590# PowerPC E500 boards
aurel321db09b82009-03-02 16:42:42 +0000591OBJS+= ppce500_pci.o ppce500_mpc8544ds.o
aurel32f652e6a2008-12-16 10:43:48 +0000592ifdef FDT_LIBS
593OBJS+= device_tree.o
594LIBS+= $(FDT_LIBS)
595endif
aurel32d76d1652008-12-16 10:43:58 +0000596ifdef CONFIG_KVM
597OBJS+= kvm_ppc.o
598endif
bellarda541f292004-04-12 20:39:29 +0000599endif
thsfbe4f652007-04-01 11:16:48 +0000600ifeq ($(TARGET_BASE_ARCH), mips)
aurel32c1711482008-04-08 19:51:06 +0000601OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
aurel324ce7ff62008-04-07 19:47:14 +0000602OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
aurel32a65f56e2009-04-15 14:57:54 +0000603OBJS+= g364fb.o jazz_led.o dp8393x.o
Anthony Liguori71b9b0c2009-05-22 10:10:36 -0500604OBJS+= ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
aurel324ce7ff62008-04-07 19:47:14 +0000605OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
bellard40293e52008-01-31 11:32:10 +0000606OBJS+= mipsnet.o
607OBJS+= pflash_cfi01.o
aurel321f605a72009-02-08 14:51:19 +0000608OBJS+= vmware_vga.o
aurel324ce7ff62008-04-07 19:47:14 +0000609CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
bellard6af0bf92005-07-02 14:58:51 +0000610endif
thse7daa602007-10-08 13:38:27 +0000611ifeq ($(TARGET_BASE_ARCH), cris)
edgar_igl10c144e2009-01-07 12:19:50 +0000612# Boards
Edgar E. Iglesiasfd6dc902009-05-18 22:24:22 +0200613OBJS+= cris_pic_cpu.o etraxfs.o axis_dev88.o
edgar_igl10c144e2009-01-07 12:19:50 +0000614
615# IO blocks
edgar_igl48318012008-05-11 15:07:19 +0000616OBJS+= etraxfs_dma.o
edgar_igle62b5b12008-03-14 01:04:24 +0000617OBJS+= etraxfs_pic.o
edgar_igl48318012008-05-11 15:07:19 +0000618OBJS+= etraxfs_eth.o
bellard40293e52008-01-31 11:32:10 +0000619OBJS+= etraxfs_timer.o
620OBJS+= etraxfs_ser.o
edgar_igle62b5b12008-03-14 01:04:24 +0000621
Paul Brook1ad21342009-05-19 16:17:58 +0100622OBJS+= pflash_cfi02.o
thse7daa602007-10-08 13:38:27 +0000623endif
bellard64b3ab22005-01-30 22:43:42 +0000624ifeq ($(TARGET_BASE_ARCH), sparc)
bellard34751872005-07-02 14:31:34 +0000625ifeq ($(TARGET_ARCH), sparc64)
blueswir1e9c28332009-04-11 09:04:44 +0000626OBJS+= sun4u.o ide.o pckbd.o vga.o apb_pci.o
Anthony Liguori71b9b0c2009-05-22 10:10:36 -0500627OBJS+= fdc.o mc146818rtc.o serial.o
blueswir1e9c28332009-04-11 09:04:44 +0000628OBJS+= cirrus_vga.o parallel.o
bellard34751872005-07-02 14:31:34 +0000629else
Paul Brook1ad21342009-05-19 16:17:58 +0100630OBJS+= sun4m.o tcx.o iommu.o slavio_intctl.o
Anthony Liguori71b9b0c2009-05-22 10:10:36 -0500631OBJS+= slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
blueswir1e9c28332009-04-11 09:04:44 +0000632OBJS+= cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
bellard34751872005-07-02 14:31:34 +0000633endif
bellarde95c8d52004-09-30 22:22:08 +0000634endif
bellardb5ff1b32005-11-26 10:38:39 +0000635ifeq ($(TARGET_BASE_ARCH), arm)
blueswir1e9c28332009-04-11 09:04:44 +0000636OBJS+= integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
bellard40293e52008-01-31 11:32:10 +0000637OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
blueswir1e9c28332009-04-11 09:04:44 +0000638OBJS+= versatile_pci.o
bellard40293e52008-01-31 11:32:10 +0000639OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
640OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
641OBJS+= pl061.o
642OBJS+= arm-semi.o
643OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
644OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
645OBJS+= pflash_cfi01.o gumstix.o
Paul Brook1ad21342009-05-19 16:17:58 +0100646OBJS+= zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
balrogb4e31042008-03-06 21:07:38 +0000647OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
balrogafbb5192008-07-21 20:40:22 +0000648OBJS+= omap2.o omap_dss.o soc_dma.o
balrog997641a2008-12-15 02:05:00 +0000649OBJS+= omap_sx1.o palm.o tsc210x.o
balrog942ac052008-04-22 03:15:10 +0000650OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
bellard40293e52008-01-31 11:32:10 +0000651OBJS+= mst_fpga.o mainstone.o
balrog24859b62008-04-24 19:21:53 +0000652OBJS+= musicpal.o pflash_cfi02.o
pbrook714fa302009-04-01 12:27:59 +0000653OBJS+= framebuffer.o
Paul Brook4af39612009-05-14 23:11:09 +0100654OBJS+= syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
655OBJS+= syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
Paul Brook340d96e2009-05-18 16:45:48 +0100656OBJS+= syborg_virtio.o
balrog5a1237c2007-05-02 02:11:51 +0000657CPPFLAGS += -DHAS_AUDIO
bellardb5ff1b32005-11-26 10:38:39 +0000658endif
bellardfdf9b3e2006-04-27 21:07:38 +0000659ifeq ($(TARGET_BASE_ARCH), sh4)
bellard40293e52008-01-31 11:32:10 +0000660OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
blueswir1e9c28332009-04-11 09:04:44 +0000661OBJS+= sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
balroga4a771c2008-12-07 18:41:42 +0000662OBJS+= ide.o
bellardfdf9b3e2006-04-27 21:07:38 +0000663endif
pbrook06338792007-05-23 19:58:11 +0000664ifeq ($(TARGET_BASE_ARCH), m68k)
blueswir1e9c28332009-04-11 09:04:44 +0000665OBJS+= an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
bellard40293e52008-01-31 11:32:10 +0000666OBJS+= m68k-semi.o dummy_m68k.o
pbrook06338792007-05-23 19:58:11 +0000667endif
bellard5b0753e2005-03-01 21:37:28 +0000668ifdef CONFIG_COCOA
bellard1d14ffa2005-10-30 18:58:22 +0000669COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
670ifdef CONFIG_COREAUDIO
671COCOA_LIBS+=-framework CoreAudio
672endif
bellard5b0753e2005-03-01 21:37:28 +0000673endif
bellard7c1f25b2004-04-22 00:02:08 +0000674ifdef CONFIG_SLIRP
ths6f30fa82007-01-05 01:00:47 +0000675CPPFLAGS+=-I$(SRC_PATH)/slirp
bellard626df762003-08-10 21:39:31 +0000676endif
677
aliguorie5d355d2009-04-24 18:03:15 +0000678LIBS+=$(PTHREADLIBS)
679LIBS+=$(CLOCKLIBS)
bellardc321f672003-10-30 01:18:42 +0000680# specific flags are needed for non soft mmu emulator
bellardc321f672003-10-30 01:18:42 +0000681ifdef CONFIG_STATIC
bellard40293e52008-01-31 11:32:10 +0000682LDFLAGS+=-static
bellardde5eaa62003-11-16 23:18:17 +0000683endif
bellard83fb7ad2004-07-05 21:25:26 +0000684ifndef CONFIG_DARWIN
bellard11d9f692004-04-02 20:55:59 +0000685ifndef CONFIG_WIN32
bellardec530c82006-04-25 22:36:06 +0000686ifndef CONFIG_SOLARIS
malcb29fe3e2008-11-18 01:42:22 +0000687ifndef CONFIG_AIX
bellard40293e52008-01-31 11:32:10 +0000688LIBS+=-lutil
bellard11d9f692004-04-02 20:55:59 +0000689endif
bellard83fb7ad2004-07-05 21:25:26 +0000690endif
bellardec530c82006-04-25 22:36:06 +0000691endif
malcb29fe3e2008-11-18 01:42:22 +0000692endif
bellarde3086fb2005-02-10 21:48:51 +0000693ifdef TARGET_GPROF
bellard40293e52008-01-31 11:32:10 +0000694vl.o: CFLAGS+=-p
695LDFLAGS+=-p
bellarde3086fb2005-02-10 21:48:51 +0000696endif
bellardc321f672003-10-30 01:18:42 +0000697
bellardb8076a72005-04-07 22:20:31 +0000698ifeq ($(ARCH),ia64)
bellard40293e52008-01-31 11:32:10 +0000699LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
ths8a0ef212007-11-18 22:34:46 +0000700endif
701
bellard1d14ffa2005-10-30 18:58:22 +0000702ifdef CONFIG_WIN32
703SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
704endif
705
bellard40293e52008-01-31 11:32:10 +0000706# profiling code
707ifdef TARGET_GPROF
708LDFLAGS+=-p
709main.o: CFLAGS+=-p
bellard6e1b3e42006-08-17 17:41:26 +0000710endif
711
blueswir15824d652009-03-28 06:44:27 +0000712vl.o: qemu-options.h
713
Alexander Graf769ce762009-05-11 17:41:42 +0200714$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
Anthony Liguori79eb76a2009-05-22 09:23:45 -0500715$(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
Paul Brook1ad21342009-05-19 16:17:58 +0100716$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a $(HWLIB)
Anthony Liguori0bfe3ca2009-05-14 19:29:53 +0100717 $(call LINK,$(OBJS))
bellard626df762003-08-10 21:39:31 +0000718
bellard40293e52008-01-31 11:32:10 +0000719endif # !CONFIG_USER_ONLY
bellard00a67ba2006-10-28 12:19:07 +0000720
pbrook56aebc82008-10-11 17:55:29 +0000721gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
pbrook56aebc82008-10-11 17:55:29 +0000722ifeq ($(TARGET_XML_FILES),)
aurel321aef4c52009-03-28 23:46:00 +0000723 $(call quiet-command,rm -f $@ && echo > $@," GEN $(TARGET_DIR)$@")
pbrook56aebc82008-10-11 17:55:29 +0000724else
aurel321aef4c52009-03-28 23:46:00 +0000725 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
pbrook56aebc82008-10-11 17:55:29 +0000726endif
727
blueswir15824d652009-03-28 06:44:27 +0000728qemu-options.h: $(SRC_PATH)/qemu-options.hx
aliguori0d00e562009-04-05 17:40:46 +0000729 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
blueswir15824d652009-03-28 06:44:27 +0000730
bellard626df762003-08-10 21:39:31 +0000731clean:
aliguori016c62c2009-04-05 17:40:50 +0000732 rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o qemu-options.h gdbstub-xml.c
bellard57fec1f2008-02-01 10:50:11 +0000733 rm -f *.d */*.d tcg/*.o
bellard1e43adf2003-09-30 20:54:24 +0000734
ths5fafdf22007-09-16 21:08:06 +0000735install: all
bellard9b14bb02004-03-26 22:43:34 +0000736ifneq ($(PROGS),)
aliguori1625af82009-04-05 17:41:02 +0000737 $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)"
bellard9b14bb02004-03-26 22:43:34 +0000738endif
bellard626df762003-08-10 21:39:31 +0000739
j_mayer2f96c282007-10-28 13:07:12 +0000740# Include automatically generated dependency files
741-include $(wildcard *.d */*.d)