blob: 78e3e7f1068471611e7b3e97cf4af51f06825b0d [file] [log] [blame]
bellard626df762003-08-10 21:39:31 +00001include config.mak
2
bellard0b0babc2005-01-03 23:38:40 +00003TARGET_BASE_ARCH:=$(TARGET_ARCH)
4ifeq ($(TARGET_ARCH), x86_64)
5TARGET_BASE_ARCH:=i386
6endif
bellard64b3ab22005-01-30 22:43:42 +00007ifeq ($(TARGET_ARCH), sparc64)
8TARGET_BASE_ARCH:=sparc
9endif
bellard0b0babc2005-01-03 23:38:40 +000010TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
bellard85571bc2004-11-07 18:04:02 +000011VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
bellard3035f7f2004-03-21 17:02:00 +000012DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
13ifdef CONFIG_USER_ONLY
14VPATH+=:$(SRC_PATH)/linux-user
15DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
16endif
bellardab2572d2004-06-03 19:07:57 +000017CFLAGS=-Wall -O2 -g -fno-strict-aliasing
bellard0b0babc2005-01-03 23:38:40 +000018#CFLAGS+=-Werror
bellard626df762003-08-10 21:39:31 +000019LDFLAGS=-g
20LIBS=
bellard626df762003-08-10 21:39:31 +000021HELPER_CFLAGS=$(CFLAGS)
bellard67b915a2004-03-31 23:37:16 +000022DYNGEN=../dyngen$(EXESUF)
bellard1e43adf2003-09-30 20:54:24 +000023# user emulator name
bellard808c4952004-12-19 23:33:47 +000024ifeq ($(TARGET_ARCH),arm)
25 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
26 QEMU_USER=qemu-armeb
27 else
28 QEMU_USER=qemu-arm
29 endif
30else
31 QEMU_USER=qemu-$(TARGET_ARCH)
32endif
bellard1e43adf2003-09-30 20:54:24 +000033# system emulator name
34ifdef CONFIG_SOFTMMU
bellarda541f292004-04-12 20:39:29 +000035ifeq ($(TARGET_ARCH), i386)
bellard67b915a2004-03-31 23:37:16 +000036QEMU_SYSTEM=qemu$(EXESUF)
bellard0db63472003-10-27 21:37:46 +000037else
bellarda541f292004-04-12 20:39:29 +000038QEMU_SYSTEM=qemu-system-$(TARGET_ARCH)$(EXESUF)
39endif
40else
bellard0db63472003-10-27 21:37:46 +000041QEMU_SYSTEM=qemu-fast
bellard1e43adf2003-09-30 20:54:24 +000042endif
43
bellard16e9b7d2003-10-27 21:09:52 +000044ifdef CONFIG_USER_ONLY
bellard1e43adf2003-09-30 20:54:24 +000045PROGS=$(QEMU_USER)
bellard16e9b7d2003-10-27 21:09:52 +000046else
bellard16e9b7d2003-10-27 21:09:52 +000047ifeq ($(TARGET_ARCH), i386)
bellardc321f672003-10-30 01:18:42 +000048
49ifeq ($(ARCH), i386)
bellard16e9b7d2003-10-27 21:09:52 +000050PROGS+=$(QEMU_SYSTEM)
bellardde5eaa62003-11-16 23:18:17 +000051ifndef CONFIG_SOFTMMU
52CONFIG_STATIC=y
53endif
bellard38ca2ab2004-03-13 18:32:13 +000054else
55# the system emulator using soft mmu is portable
bellardc321f672003-10-30 01:18:42 +000056ifdef CONFIG_SOFTMMU
57PROGS+=$(QEMU_SYSTEM)
58endif
bellard38ca2ab2004-03-13 18:32:13 +000059endif # ARCH != i386
bellardc321f672003-10-30 01:18:42 +000060
bellard38ca2ab2004-03-13 18:32:13 +000061endif # TARGET_ARCH = i386
bellard728c9fd2004-01-05 00:08:14 +000062
bellard0b0babc2005-01-03 23:38:40 +000063ifeq ($(TARGET_ARCH), x86_64)
64ifdef CONFIG_SOFTMMU
65PROGS+=$(QEMU_SYSTEM)
66endif
67endif # TARGET_ARCH = x86_64
68
bellard728c9fd2004-01-05 00:08:14 +000069ifeq ($(TARGET_ARCH), ppc)
70
71ifeq ($(ARCH), ppc)
72PROGS+=$(QEMU_SYSTEM)
bellard626df762003-08-10 21:39:31 +000073endif
74
bellard728c9fd2004-01-05 00:08:14 +000075ifeq ($(ARCH), i386)
76ifdef CONFIG_SOFTMMU
77PROGS+=$(QEMU_SYSTEM)
78endif
79endif # ARCH = i386
80
bellard0b0babc2005-01-03 23:38:40 +000081ifeq ($(ARCH), x86_64)
bellard75dfaa12004-04-25 19:04:19 +000082ifdef CONFIG_SOFTMMU
83PROGS+=$(QEMU_SYSTEM)
84endif
bellard0b0babc2005-01-03 23:38:40 +000085endif # ARCH = x86_64
bellard75dfaa12004-04-25 19:04:19 +000086
bellard728c9fd2004-01-05 00:08:14 +000087endif # TARGET_ARCH = ppc
bellarde95c8d52004-09-30 22:22:08 +000088
89ifeq ($(TARGET_ARCH), sparc)
90
91ifeq ($(ARCH), ppc)
92PROGS+=$(QEMU_SYSTEM)
93endif
94
95ifeq ($(ARCH), i386)
96ifdef CONFIG_SOFTMMU
97PROGS+=$(QEMU_SYSTEM)
98endif
99endif # ARCH = i386
100
bellard0b0babc2005-01-03 23:38:40 +0000101ifeq ($(ARCH), x86_64)
bellarde95c8d52004-09-30 22:22:08 +0000102ifdef CONFIG_SOFTMMU
103PROGS+=$(QEMU_SYSTEM)
104endif
bellard0b0babc2005-01-03 23:38:40 +0000105endif # ARCH = x86_64
bellarde95c8d52004-09-30 22:22:08 +0000106
107endif # TARGET_ARCH = sparc
bellard64b3ab22005-01-30 22:43:42 +0000108
109ifeq ($(TARGET_ARCH), sparc64)
110ifdef CONFIG_SOFTMMU
111PROGS+=$(QEMU_SYSTEM)
112endif
113endif # TARGET_ARCH = sparc64
114
bellard728c9fd2004-01-05 00:08:14 +0000115endif # !CONFIG_USER_ONLY
116
bellard626df762003-08-10 21:39:31 +0000117ifdef CONFIG_STATIC
118LDFLAGS+=-static
119endif
120
121ifeq ($(ARCH),i386)
122CFLAGS+=-fomit-frame-pointer
123OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
124ifeq ($(HAVE_GCC3_OPTIONS),yes)
bellard3611a292004-08-03 21:42:45 +0000125OP_CFLAGS+= -falign-functions=0 -fno-gcse
bellard626df762003-08-10 21:39:31 +0000126else
127OP_CFLAGS+= -malign-functions=0
128endif
bellard3a4739d2003-10-28 00:48:22 +0000129
bellard626df762003-08-10 21:39:31 +0000130ifdef TARGET_GPROF
bellard3a4739d2003-10-28 00:48:22 +0000131USE_I386_LD=y
132endif
133ifdef CONFIG_STATIC
134USE_I386_LD=y
135endif
136ifdef USE_I386_LD
bellard626df762003-08-10 21:39:31 +0000137LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld
138else
139# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
140# that the kernel ELF loader considers as an executable. I think this
141# is the simplest way to make it self virtualizable!
142LDFLAGS+=-Wl,-shared
143endif
bellard626df762003-08-10 21:39:31 +0000144endif
145
bellard0b0babc2005-01-03 23:38:40 +0000146ifeq ($(ARCH),x86_64)
bellardbc51c5c2004-03-17 23:46:04 +0000147OP_CFLAGS=$(CFLAGS) -falign-functions=0
bellard0b0babc2005-01-03 23:38:40 +0000148LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
bellardbc51c5c2004-03-17 23:46:04 +0000149endif
150
bellard626df762003-08-10 21:39:31 +0000151ifeq ($(ARCH),ppc)
bellard83fb7ad2004-07-05 21:25:26 +0000152CFLAGS+= -D__powerpc__
bellard626df762003-08-10 21:39:31 +0000153OP_CFLAGS=$(CFLAGS)
154LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
155endif
156
157ifeq ($(ARCH),s390)
158OP_CFLAGS=$(CFLAGS)
159LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld
160endif
161
162ifeq ($(ARCH),sparc)
163CFLAGS+=-m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
164LDFLAGS+=-m32
165OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
166HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
167# -static is used to avoid g1/g3 usage by the dynamic linker
168LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static
169endif
170
171ifeq ($(ARCH),sparc64)
172CFLAGS+=-m64 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
173LDFLAGS+=-m64
174OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0
175endif
176
177ifeq ($(ARCH),alpha)
178# -msmall-data is not used because we want two-instruction relocations
179# for the constant constructions
180OP_CFLAGS=-Wall -O2 -g
181# Ensure there's only a single GP
182CFLAGS += -msmall-data
183LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld
184endif
185
186ifeq ($(ARCH),ia64)
187OP_CFLAGS=$(CFLAGS)
188endif
189
190ifeq ($(ARCH),arm)
bellardba680552005-03-13 09:49:52 +0000191OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer
bellard626df762003-08-10 21:39:31 +0000192LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld
193endif
194
bellard38e584a2003-08-10 22:14:22 +0000195ifeq ($(ARCH),m68k)
196OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
197LDFLAGS+=-Wl,-T,m68k.ld
198endif
199
bellard626df762003-08-10 21:39:31 +0000200ifeq ($(HAVE_GCC3_OPTIONS),yes)
201# very important to generate a return at the end of every operation
202OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
203endif
204
bellard83fb7ad2004-07-05 21:25:26 +0000205ifeq ($(CONFIG_DARWIN),yes)
206OP_CFLAGS+= -mdynamic-no-pic
bellarde80cfcf2004-12-19 23:18:01 +0000207LIBS+=-lmx
bellard83fb7ad2004-07-05 21:25:26 +0000208endif
209
bellard626df762003-08-10 21:39:31 +0000210#########################################################
211
bellardd5249392004-08-03 21:14:23 +0000212DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
bellard626df762003-08-10 21:39:31 +0000213LIBS+=-lm
bellardb932cab2004-08-01 21:46:49 +0000214ifndef CONFIG_USER_ONLY
215LIBS+=-lz
216endif
bellard67b915a2004-03-31 23:37:16 +0000217ifdef CONFIG_WIN32
bellard3db38e82004-07-14 17:19:55 +0000218LIBS+=-lwinmm -lws2_32 -liphlpapi
bellard67b915a2004-03-31 23:37:16 +0000219endif
bellard626df762003-08-10 21:39:31 +0000220
221# profiling code
222ifdef TARGET_GPROF
223LDFLAGS+=-p
224main.o: CFLAGS+=-p
225endif
226
bellard3035f7f2004-03-21 17:02:00 +0000227OBJS= elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o
bellard626df762003-08-10 21:39:31 +0000228ifeq ($(TARGET_ARCH), i386)
229OBJS+= vm86.o
230endif
bellardf72b5192004-02-16 21:55:35 +0000231ifeq ($(TARGET_ARCH), arm)
232OBJS+=nwfpe/softfloat.o nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
233nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
234 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o
235endif
bellard626df762003-08-10 21:39:31 +0000236SRCS:= $(OBJS:.o=.c)
237OBJS+= libqemu.a
238
239# cpu emulator library
bellarde3086fb2005-02-10 21:48:51 +0000240LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
241 translate.o op.o
bellard626df762003-08-10 21:39:31 +0000242
243ifeq ($(TARGET_ARCH), i386)
bellard1e43adf2003-09-30 20:54:24 +0000244LIBOBJS+=helper.o helper2.o
bellardf72b5192004-02-16 21:55:35 +0000245ifeq ($(ARCH), i386)
246LIBOBJS+=translate-copy.o
247endif
bellard626df762003-08-10 21:39:31 +0000248endif
249
bellard0b0babc2005-01-03 23:38:40 +0000250ifeq ($(TARGET_ARCH), x86_64)
251LIBOBJS+=helper.o helper2.o
252endif
253
bellard67867302003-11-23 17:05:30 +0000254ifeq ($(TARGET_ARCH), ppc)
bellard728c9fd2004-01-05 00:08:14 +0000255LIBOBJS+= op_helper.o helper.o
bellard67867302003-11-23 17:05:30 +0000256endif
257
bellard64b3ab22005-01-30 22:43:42 +0000258ifeq ($(TARGET_BASE_ARCH), sparc)
bellarde95c8d52004-09-30 22:22:08 +0000259LIBOBJS+= op_helper.o helper.o
260endif
261
bellardb7bcbe92005-02-22 19:27:29 +0000262ifeq ($(TARGET_BASE_ARCH), arm)
263LIBOBJS+= op_helper.o
264endif
265
bellard626df762003-08-10 21:39:31 +0000266# NOTE: the disassembler code is only needed for debugging
267LIBOBJS+=disas.o
268ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
bellardbc51c5c2004-03-17 23:46:04 +0000269USE_I386_DIS=y
270endif
bellard0b0babc2005-01-03 23:38:40 +0000271ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
bellardbc51c5c2004-03-17 23:46:04 +0000272USE_I386_DIS=y
273endif
274ifdef USE_I386_DIS
bellard626df762003-08-10 21:39:31 +0000275LIBOBJS+=i386-dis.o
276endif
277ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
278LIBOBJS+=alpha-dis.o
279endif
280ifeq ($(findstring ppc, $(TARGET_ARCH) $(ARCH)),ppc)
281LIBOBJS+=ppc-dis.o
282endif
bellard64b3ab22005-01-30 22:43:42 +0000283ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
bellard626df762003-08-10 21:39:31 +0000284LIBOBJS+=sparc-dis.o
285endif
286ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
287LIBOBJS+=arm-dis.o
288endif
289
290ifeq ($(ARCH),ia64)
291OBJS += ia64-syscall.o
292endif
293
bellard1e43adf2003-09-30 20:54:24 +0000294all: $(PROGS)
bellard626df762003-08-10 21:39:31 +0000295
bellard1e43adf2003-09-30 20:54:24 +0000296$(QEMU_USER): $(OBJS)
bellard626df762003-08-10 21:39:31 +0000297 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
298ifeq ($(ARCH),alpha)
299# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
300# the address space (31 bit so sign extending doesn't matter)
301 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
302endif
303
304# must use static linking to avoid leaving stuff in virtual address space
bellardb932cab2004-08-01 21:46:49 +0000305VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o
bellard585d0ed2004-12-12 11:24:44 +0000306VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o
bellarda541f292004-04-12 20:39:29 +0000307
bellard85571bc2004-11-07 18:04:02 +0000308SOUND_HW = sb16.o
bellard7372f882004-11-11 16:55:09 +0000309AUDIODRV = audio.o noaudio.o wavaudio.o
bellardfb065182004-11-09 23:09:44 +0000310ifdef CONFIG_SDL
311AUDIODRV += sdlaudio.o
312endif
313ifdef CONFIG_OSS
314AUDIODRV += ossaudio.o
315endif
bellard85571bc2004-11-07 18:04:02 +0000316
bellardfb065182004-11-09 23:09:44 +0000317pc.o: DEFINES := -DUSE_SB16 $(DEFINES)
318
319ifdef CONFIG_ADLIB
bellard85571bc2004-11-07 18:04:02 +0000320SOUND_HW += fmopl.o adlib.o
bellard85571bc2004-11-07 18:04:02 +0000321endif
322
bellard102a52e2004-11-14 19:57:29 +0000323ifdef CONFIG_FMOD
bellard85571bc2004-11-07 18:04:02 +0000324AUDIODRV += fmodaudio.o
bellard102a52e2004-11-14 19:57:29 +0000325audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES)
326LIBS += $(CONFIG_FMOD_LIB)
bellard85571bc2004-11-07 18:04:02 +0000327endif
328
bellard0b0babc2005-01-03 23:38:40 +0000329ifeq ($(TARGET_BASE_ARCH), i386)
bellarda541f292004-04-12 20:39:29 +0000330# Hardware support
bellard85571bc2004-11-07 18:04:02 +0000331VL_OBJS+= ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
332VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pc.o
bellard6508fe52005-01-15 12:02:56 +0000333VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o
bellard67b915a2004-03-31 23:37:16 +0000334endif
bellard728c9fd2004-01-05 00:08:14 +0000335ifeq ($(TARGET_ARCH), ppc)
bellard85571bc2004-11-07 18:04:02 +0000336VL_OBJS+= ppc.o ide.o ne2000.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
bellard64201202004-05-26 22:55:16 +0000337VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
bellard85571bc2004-11-07 18:04:02 +0000338VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o mixeng.o
bellarda541f292004-04-12 20:39:29 +0000339endif
bellard64b3ab22005-01-30 22:43:42 +0000340ifeq ($(TARGET_BASE_ARCH), sparc)
bellard6f7e9ae2005-03-13 09:43:36 +0000341VL_OBJS+= sun4m.o tcx.o lance.o iommu.o m48t08.o magic-load.o slavio_intctl.o slavio_timer.o slavio_serial.o fdc.o esp.o
bellarde95c8d52004-09-30 22:22:08 +0000342endif
bellarda541f292004-04-12 20:39:29 +0000343ifdef CONFIG_GDBSTUB
344VL_OBJS+=gdbstub.o
bellard728c9fd2004-01-05 00:08:14 +0000345endif
bellard626df762003-08-10 21:39:31 +0000346ifdef CONFIG_SDL
347VL_OBJS+=sdl.o
bellardde5eaa62003-11-16 23:18:17 +0000348endif
bellard5b0753e2005-03-01 21:37:28 +0000349ifdef CONFIG_COCOA
350VL_OBJS+=cocoa.o
351COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa
352endif
bellard7c1f25b2004-04-22 00:02:08 +0000353ifdef CONFIG_SLIRP
354DEFINES+=-I$(SRC_PATH)/slirp
355SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
356slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
bellardc7f74642004-08-24 21:57:12 +0000357tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
bellard7c1f25b2004-04-22 00:02:08 +0000358VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
bellard626df762003-08-10 21:39:31 +0000359endif
360
bellardc321f672003-10-30 01:18:42 +0000361VL_LDFLAGS=
362# specific flags are needed for non soft mmu emulator
bellardc321f672003-10-30 01:18:42 +0000363ifdef CONFIG_STATIC
364VL_LDFLAGS+=-static
365endif
bellardde5eaa62003-11-16 23:18:17 +0000366ifndef CONFIG_SOFTMMU
367VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
368endif
bellard83fb7ad2004-07-05 21:25:26 +0000369ifndef CONFIG_DARWIN
bellard11d9f692004-04-02 20:55:59 +0000370ifndef CONFIG_WIN32
371VL_LIBS=-lutil
372endif
bellard83fb7ad2004-07-05 21:25:26 +0000373endif
bellarde3086fb2005-02-10 21:48:51 +0000374ifdef TARGET_GPROF
375vl.o: CFLAGS+=-p
376VL_LDFLAGS+=-p
377endif
bellardc321f672003-10-30 01:18:42 +0000378
bellard1e43adf2003-09-30 20:54:24 +0000379$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
bellard5b0753e2005-03-01 21:37:28 +0000380 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
381
382cocoa.o: cocoa.m
383 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
bellard626df762003-08-10 21:39:31 +0000384
bellard3d11d0e2004-12-12 16:56:30 +0000385sdl.o: sdl.c keymaps.c sdl_keysym.h
bellard626df762003-08-10 21:39:31 +0000386 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
387
bellard9f059ec2004-11-14 18:59:52 +0000388sdlaudio.o: sdlaudio.c
389 $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
390
bellard626df762003-08-10 21:39:31 +0000391depend: $(SRCS)
bellard16e9b7d2003-10-27 21:09:52 +0000392 $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend
bellard626df762003-08-10 21:39:31 +0000393
394# libqemu
395
396libqemu.a: $(LIBOBJS)
397 rm -f $@
398 $(AR) rcs $@ $(LIBOBJS)
399
bellard1e43adf2003-09-30 20:54:24 +0000400translate.o: translate.c gen-op.h opc.h cpu.h
bellard626df762003-08-10 21:39:31 +0000401
bellard1e43adf2003-09-30 20:54:24 +0000402translate-all.o: translate-all.c op.h opc.h cpu.h
bellard626df762003-08-10 21:39:31 +0000403
bellard1e43adf2003-09-30 20:54:24 +0000404op.h: op.o $(DYNGEN)
bellard626df762003-08-10 21:39:31 +0000405 $(DYNGEN) -o $@ $<
406
bellard1e43adf2003-09-30 20:54:24 +0000407opc.h: op.o $(DYNGEN)
bellard626df762003-08-10 21:39:31 +0000408 $(DYNGEN) -c -o $@ $<
409
bellard1e43adf2003-09-30 20:54:24 +0000410gen-op.h: op.o $(DYNGEN)
bellard626df762003-08-10 21:39:31 +0000411 $(DYNGEN) -g -o $@ $<
412
bellard1e43adf2003-09-30 20:54:24 +0000413op.o: op.c
bellard626df762003-08-10 21:39:31 +0000414 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
415
bellard1e43adf2003-09-30 20:54:24 +0000416helper.o: helper.c
bellard626df762003-08-10 21:39:31 +0000417 $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
418
bellard0b0babc2005-01-03 23:38:40 +0000419ifeq ($(TARGET_BASE_ARCH), i386)
bellard664e0f12005-01-08 18:58:29 +0000420op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
bellard1e43adf2003-09-30 20:54:24 +0000421endif
bellard626df762003-08-10 21:39:31 +0000422
bellard1e43adf2003-09-30 20:54:24 +0000423ifeq ($(TARGET_ARCH), arm)
424op.o: op.c op_template.h
425endif
426
bellard64b3ab22005-01-30 22:43:42 +0000427ifeq ($(TARGET_BASE_ARCH), sparc)
bellarde95c8d52004-09-30 22:22:08 +0000428op.o: op.c op_template.h op_mem.h
bellard1e43adf2003-09-30 20:54:24 +0000429endif
bellard626df762003-08-10 21:39:31 +0000430
bellard728c9fd2004-01-05 00:08:14 +0000431ifeq ($(TARGET_ARCH), ppc)
432op.o: op.c op_template.h op_mem.h
433op_helper.o: op_helper_mem.h
434endif
435
bellard85571bc2004-11-07 18:04:02 +0000436mixeng.o: mixeng.c mixeng.h mixeng_template.h
437
bellard626df762003-08-10 21:39:31 +0000438%.o: %.c
439 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
440
bellardf72b5192004-02-16 21:55:35 +0000441%.o: %.S
442 $(CC) $(DEFINES) -c -o $@ $<
443
bellard626df762003-08-10 21:39:31 +0000444clean:
bellard7c1f25b2004-04-22 00:02:08 +0000445 rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o
bellard1e43adf2003-09-30 20:54:24 +0000446
447install: all
bellard9b14bb02004-03-26 22:43:34 +0000448ifneq ($(PROGS),)
bellard11d9f692004-04-02 20:55:59 +0000449 install -m 755 -s $(PROGS) "$(bindir)"
bellard9b14bb02004-03-26 22:43:34 +0000450endif
bellard626df762003-08-10 21:39:31 +0000451
452ifneq ($(wildcard .depend),)
453include .depend
454endif