bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 1 | include config.mak |
| 2 | |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 3 | TARGET_BASE_ARCH:=$(TARGET_ARCH) |
| 4 | ifeq ($(TARGET_ARCH), x86_64) |
| 5 | TARGET_BASE_ARCH:=i386 |
| 6 | endif |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 7 | ifeq ($(TARGET_ARCH), ppc64) |
| 8 | TARGET_BASE_ARCH:=ppc |
| 9 | endif |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 10 | ifeq ($(TARGET_ARCH), sparc64) |
| 11 | TARGET_BASE_ARCH:=sparc |
| 12 | endif |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 13 | TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
bellard | 85571bc | 2004-11-07 18:04:02 +0000 | [diff] [blame] | 14 | VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 15 | DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) |
bellard | 3035f7f | 2004-03-21 17:02:00 +0000 | [diff] [blame] | 16 | ifdef CONFIG_USER_ONLY |
| 17 | VPATH+=:$(SRC_PATH)/linux-user |
| 18 | DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) |
| 19 | endif |
bellard | ab2572d | 2004-06-03 19:07:57 +0000 | [diff] [blame] | 20 | CFLAGS=-Wall -O2 -g -fno-strict-aliasing |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 21 | #CFLAGS+=-Werror |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 22 | LDFLAGS=-g |
| 23 | LIBS= |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 24 | HELPER_CFLAGS=$(CFLAGS) |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 25 | DYNGEN=../dyngen$(EXESUF) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 26 | # user emulator name |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 27 | TARGET_ARCH2=$(TARGET_ARCH) |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 28 | ifeq ($(TARGET_ARCH),arm) |
| 29 | ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 30 | TARGET_ARCH2=armeb |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 31 | endif |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 32 | endif |
pbrook | 908f52b | 2006-06-18 19:16:53 +0000 | [diff] [blame] | 33 | ifeq ($(TARGET_ARCH),sh4) |
| 34 | ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
| 35 | TARGET_ARCH2=sh4eb |
| 36 | endif |
| 37 | endif |
bellard | 01f5e59 | 2005-12-06 21:42:17 +0000 | [diff] [blame] | 38 | ifeq ($(TARGET_ARCH),mips) |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 39 | ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
| 40 | TARGET_ARCH2=mipsel |
bellard | 01f5e59 | 2005-12-06 21:42:17 +0000 | [diff] [blame] | 41 | endif |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 42 | endif |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 43 | QEMU_USER=qemu-$(TARGET_ARCH2) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 44 | # system emulator name |
| 45 | ifdef CONFIG_SOFTMMU |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 46 | ifeq ($(TARGET_ARCH), i386) |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 47 | QEMU_SYSTEM=qemu$(EXESUF) |
bellard | 0db6347 | 2003-10-27 21:37:46 +0000 | [diff] [blame] | 48 | else |
bellard | c91fde6 | 2006-05-02 22:52:36 +0000 | [diff] [blame] | 49 | QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 50 | endif |
| 51 | else |
bellard | 0db6347 | 2003-10-27 21:37:46 +0000 | [diff] [blame] | 52 | QEMU_SYSTEM=qemu-fast |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 53 | endif |
| 54 | |
bellard | 16e9b7d | 2003-10-27 21:09:52 +0000 | [diff] [blame] | 55 | ifdef CONFIG_USER_ONLY |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 56 | PROGS=$(QEMU_USER) |
bellard | 16e9b7d | 2003-10-27 21:09:52 +0000 | [diff] [blame] | 57 | else |
bellard | 16e9b7d | 2003-10-27 21:09:52 +0000 | [diff] [blame] | 58 | PROGS+=$(QEMU_SYSTEM) |
bellard | de5eaa6 | 2003-11-16 23:18:17 +0000 | [diff] [blame] | 59 | ifndef CONFIG_SOFTMMU |
| 60 | CONFIG_STATIC=y |
| 61 | endif |
bellard | 728c9fd | 2004-01-05 00:08:14 +0000 | [diff] [blame] | 62 | endif # !CONFIG_USER_ONLY |
| 63 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 64 | ifdef CONFIG_STATIC |
| 65 | LDFLAGS+=-static |
| 66 | endif |
| 67 | |
| 68 | ifeq ($(ARCH),i386) |
bellard | 6e1b3e4 | 2006-08-17 17:41:26 +0000 | [diff] [blame] | 69 | HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer |
| 70 | OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 71 | ifeq ($(HAVE_GCC3_OPTIONS),yes) |
bellard | 3611a29 | 2004-08-03 21:42:45 +0000 | [diff] [blame] | 72 | OP_CFLAGS+= -falign-functions=0 -fno-gcse |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 73 | else |
| 74 | OP_CFLAGS+= -malign-functions=0 |
| 75 | endif |
bellard | 3a4739d | 2003-10-28 00:48:22 +0000 | [diff] [blame] | 76 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 77 | ifdef TARGET_GPROF |
bellard | 3a4739d | 2003-10-28 00:48:22 +0000 | [diff] [blame] | 78 | USE_I386_LD=y |
| 79 | endif |
| 80 | ifdef CONFIG_STATIC |
| 81 | USE_I386_LD=y |
| 82 | endif |
| 83 | ifdef USE_I386_LD |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 84 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld |
| 85 | else |
| 86 | # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
| 87 | # that the kernel ELF loader considers as an executable. I think this |
| 88 | # is the simplest way to make it self virtualizable! |
| 89 | LDFLAGS+=-Wl,-shared |
| 90 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 91 | endif |
| 92 | |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 93 | ifeq ($(ARCH),x86_64) |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 94 | OP_CFLAGS=$(CFLAGS) -falign-functions=0 |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 95 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 96 | endif |
| 97 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 98 | ifeq ($(ARCH),ppc) |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 99 | CFLAGS+= -D__powerpc__ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 100 | OP_CFLAGS=$(CFLAGS) |
| 101 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld |
| 102 | endif |
| 103 | |
| 104 | ifeq ($(ARCH),s390) |
| 105 | OP_CFLAGS=$(CFLAGS) |
| 106 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld |
| 107 | endif |
| 108 | |
| 109 | ifeq ($(ARCH),sparc) |
bellard | fdbb469 | 2006-06-14 17:32:25 +0000 | [diff] [blame] | 110 | ifeq ($(CONFIG_SOLARIS),yes) |
| 111 | CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 |
| 112 | LDFLAGS+=-m32 |
| 113 | OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 |
| 114 | else |
bellard | 74ccb34 | 2006-07-18 21:23:34 +0000 | [diff] [blame] | 115 | CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 116 | LDFLAGS+=-m32 |
| 117 | OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 |
| 118 | HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat |
| 119 | # -static is used to avoid g1/g3 usage by the dynamic linker |
| 120 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc.ld -static |
| 121 | endif |
bellard | fdbb469 | 2006-06-14 17:32:25 +0000 | [diff] [blame] | 122 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 123 | |
| 124 | ifeq ($(ARCH),sparc64) |
bellard | 74ccb34 | 2006-07-18 21:23:34 +0000 | [diff] [blame] | 125 | CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 126 | LDFLAGS+=-m64 |
bellard | 74ccb34 | 2006-07-18 21:23:34 +0000 | [diff] [blame] | 127 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 128 | OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -ffixed-i0 |
| 129 | endif |
| 130 | |
| 131 | ifeq ($(ARCH),alpha) |
| 132 | # -msmall-data is not used because we want two-instruction relocations |
| 133 | # for the constant constructions |
| 134 | OP_CFLAGS=-Wall -O2 -g |
| 135 | # Ensure there's only a single GP |
| 136 | CFLAGS += -msmall-data |
| 137 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/alpha.ld |
| 138 | endif |
| 139 | |
| 140 | ifeq ($(ARCH),ia64) |
bellard | b8076a7 | 2005-04-07 22:20:31 +0000 | [diff] [blame] | 141 | CFLAGS += -mno-sdata |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 142 | OP_CFLAGS=$(CFLAGS) |
bellard | b8076a7 | 2005-04-07 22:20:31 +0000 | [diff] [blame] | 143 | LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 144 | endif |
| 145 | |
| 146 | ifeq ($(ARCH),arm) |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 147 | OP_CFLAGS=$(CFLAGS) -mno-sched-prolog -fno-omit-frame-pointer |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 148 | LDFLAGS+=-Wl,-T,$(SRC_PATH)/arm.ld |
| 149 | endif |
| 150 | |
bellard | 38e584a | 2003-08-10 22:14:22 +0000 | [diff] [blame] | 151 | ifeq ($(ARCH),m68k) |
| 152 | OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer |
| 153 | LDFLAGS+=-Wl,-T,m68k.ld |
| 154 | endif |
| 155 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 156 | ifeq ($(HAVE_GCC3_OPTIONS),yes) |
| 157 | # very important to generate a return at the end of every operation |
| 158 | OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls |
| 159 | endif |
| 160 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 161 | ifeq ($(CONFIG_DARWIN),yes) |
| 162 | OP_CFLAGS+= -mdynamic-no-pic |
bellard | e80cfcf | 2004-12-19 23:18:01 +0000 | [diff] [blame] | 163 | LIBS+=-lmx |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 164 | endif |
| 165 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 166 | ######################################################### |
| 167 | |
bellard | d524939 | 2004-08-03 21:14:23 +0000 | [diff] [blame] | 168 | DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 169 | LIBS+=-lm |
bellard | b932cab | 2004-08-01 21:46:49 +0000 | [diff] [blame] | 170 | ifndef CONFIG_USER_ONLY |
| 171 | LIBS+=-lz |
| 172 | endif |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 173 | ifdef CONFIG_WIN32 |
bellard | 3db38e8 | 2004-07-14 17:19:55 +0000 | [diff] [blame] | 174 | LIBS+=-lwinmm -lws2_32 -liphlpapi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 175 | endif |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 176 | ifdef CONFIG_SOLARIS |
| 177 | LIBS+=-lsocket -lnsl -lresolv |
| 178 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 179 | |
| 180 | # profiling code |
| 181 | ifdef TARGET_GPROF |
| 182 | LDFLAGS+=-p |
| 183 | main.o: CFLAGS+=-p |
| 184 | endif |
| 185 | |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 186 | OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
| 187 | elfload.o linuxload.o |
| 188 | ifdef TARGET_HAS_BFLT |
| 189 | OBJS+= flatload.o |
| 190 | endif |
| 191 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 192 | ifeq ($(TARGET_ARCH), i386) |
| 193 | OBJS+= vm86.o |
| 194 | endif |
bellard | f72b519 | 2004-02-16 21:55:35 +0000 | [diff] [blame] | 195 | ifeq ($(TARGET_ARCH), arm) |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 196 | OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
bellard | f72b519 | 2004-02-16 21:55:35 +0000 | [diff] [blame] | 197 | nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
bellard | a4f8197 | 2005-04-23 18:25:41 +0000 | [diff] [blame] | 198 | nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
bellard | f72b519 | 2004-02-16 21:55:35 +0000 | [diff] [blame] | 199 | endif |
pbrook | e6e5906 | 2006-10-22 00:18:54 +0000 | [diff] [blame] | 200 | ifeq ($(TARGET_ARCH), m68k) |
| 201 | OBJS+= m68k-sim.o m68k-semi.o |
| 202 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 203 | SRCS:= $(OBJS:.o=.c) |
| 204 | OBJS+= libqemu.a |
| 205 | |
| 206 | # cpu emulator library |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 207 | LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
bellard | e3086fb | 2005-02-10 21:48:51 +0000 | [diff] [blame] | 208 | translate.o op.o |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 209 | ifdef CONFIG_SOFTFLOAT |
| 210 | LIBOBJS+=fpu/softfloat.o |
| 211 | else |
| 212 | LIBOBJS+=fpu/softfloat-native.o |
| 213 | endif |
| 214 | DEFINES+=-I$(SRC_PATH)/fpu |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 215 | |
| 216 | ifeq ($(TARGET_ARCH), i386) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 217 | LIBOBJS+=helper.o helper2.o |
bellard | f72b519 | 2004-02-16 21:55:35 +0000 | [diff] [blame] | 218 | ifeq ($(ARCH), i386) |
| 219 | LIBOBJS+=translate-copy.o |
| 220 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 221 | endif |
| 222 | |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 223 | ifeq ($(TARGET_ARCH), x86_64) |
| 224 | LIBOBJS+=helper.o helper2.o |
| 225 | endif |
| 226 | |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 227 | ifeq ($(TARGET_BASE_ARCH), ppc) |
bellard | 728c9fd | 2004-01-05 00:08:14 +0000 | [diff] [blame] | 228 | LIBOBJS+= op_helper.o helper.o |
bellard | 6786730 | 2003-11-23 17:05:30 +0000 | [diff] [blame] | 229 | endif |
| 230 | |
bellard | 6af0bf9 | 2005-07-02 14:58:51 +0000 | [diff] [blame] | 231 | ifeq ($(TARGET_ARCH), mips) |
| 232 | LIBOBJS+= op_helper.o helper.o |
| 233 | endif |
| 234 | |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 235 | ifeq ($(TARGET_BASE_ARCH), sparc) |
bellard | e95c8d5 | 2004-09-30 22:22:08 +0000 | [diff] [blame] | 236 | LIBOBJS+= op_helper.o helper.o |
| 237 | endif |
| 238 | |
bellard | b7bcbe9 | 2005-02-22 19:27:29 +0000 | [diff] [blame] | 239 | ifeq ($(TARGET_BASE_ARCH), arm) |
bellard | b5ff1b3 | 2005-11-26 10:38:39 +0000 | [diff] [blame] | 240 | LIBOBJS+= op_helper.o helper.o |
bellard | b7bcbe9 | 2005-02-22 19:27:29 +0000 | [diff] [blame] | 241 | endif |
| 242 | |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 243 | ifeq ($(TARGET_BASE_ARCH), sh4) |
| 244 | LIBOBJS+= op_helper.o helper.o |
| 245 | endif |
| 246 | |
pbrook | e6e5906 | 2006-10-22 00:18:54 +0000 | [diff] [blame] | 247 | ifeq ($(TARGET_BASE_ARCH), m68k) |
| 248 | LIBOBJS+= helper.o |
| 249 | endif |
| 250 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 251 | # NOTE: the disassembler code is only needed for debugging |
| 252 | LIBOBJS+=disas.o |
| 253 | ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 254 | USE_I386_DIS=y |
| 255 | endif |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 256 | ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 257 | USE_I386_DIS=y |
| 258 | endif |
| 259 | ifdef USE_I386_DIS |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 260 | LIBOBJS+=i386-dis.o |
| 261 | endif |
| 262 | ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
| 263 | LIBOBJS+=alpha-dis.o |
| 264 | endif |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 265 | ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 266 | LIBOBJS+=ppc-dis.o |
| 267 | endif |
bellard | 6af0bf9 | 2005-07-02 14:58:51 +0000 | [diff] [blame] | 268 | ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
| 269 | LIBOBJS+=mips-dis.o |
| 270 | endif |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 271 | ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 272 | LIBOBJS+=sparc-dis.o |
| 273 | endif |
| 274 | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
| 275 | LIBOBJS+=arm-dis.o |
| 276 | endif |
bellard | 48024e4 | 2005-11-06 16:52:11 +0000 | [diff] [blame] | 277 | ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
| 278 | LIBOBJS+=m68k-dis.o |
| 279 | endif |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 280 | ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
| 281 | LIBOBJS+=sh4-dis.o |
| 282 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 283 | |
bellard | 1fddef4 | 2005-04-17 19:16:13 +0000 | [diff] [blame] | 284 | ifdef CONFIG_GDBSTUB |
| 285 | OBJS+=gdbstub.o |
| 286 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 287 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 288 | all: $(PROGS) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 289 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 290 | $(QEMU_USER): $(OBJS) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 291 | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 292 | ifeq ($(ARCH),alpha) |
| 293 | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
| 294 | # the address space (31 bit so sign extending doesn't matter) |
| 295 | echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
| 296 | endif |
| 297 | |
| 298 | # must use static linking to avoid leaving stuff in virtual address space |
pbrook | aef445b | 2006-09-18 01:15:29 +0000 | [diff] [blame] | 299 | VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
bellard | 83f6409 | 2006-08-01 16:21:11 +0000 | [diff] [blame] | 300 | VL_OBJS+=block.o block-raw.o |
bellard | 42ca638 | 2006-08-05 21:29:27 +0000 | [diff] [blame] | 301 | 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 |
bellard | 7fb843f | 2006-02-01 23:06:55 +0000 | [diff] [blame] | 302 | ifdef CONFIG_WIN32 |
| 303 | VL_OBJS+=tap-win32.o |
| 304 | endif |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 305 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 306 | SOUND_HW = sb16.o es1370.o |
bellard | 7372f88 | 2004-11-11 16:55:09 +0000 | [diff] [blame] | 307 | AUDIODRV = audio.o noaudio.o wavaudio.o |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 308 | ifdef CONFIG_SDL |
| 309 | AUDIODRV += sdlaudio.o |
| 310 | endif |
| 311 | ifdef CONFIG_OSS |
| 312 | AUDIODRV += ossaudio.o |
| 313 | endif |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 314 | ifdef CONFIG_COREAUDIO |
| 315 | AUDIODRV += coreaudio.o |
bellard | 85571bc | 2004-11-07 18:04:02 +0000 | [diff] [blame] | 316 | endif |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 317 | ifdef CONFIG_ALSA |
| 318 | AUDIODRV += alsaaudio.o |
| 319 | LIBS += -lasound |
| 320 | endif |
| 321 | ifdef CONFIG_DSOUND |
| 322 | AUDIODRV += dsoundaudio.o |
| 323 | LIBS += -lole32 -ldxguid |
| 324 | endif |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 325 | ifdef CONFIG_FMOD |
bellard | 85571bc | 2004-11-07 18:04:02 +0000 | [diff] [blame] | 326 | AUDIODRV += fmodaudio.o |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 327 | audio.o fmodaudio.o: DEFINES := -I$(CONFIG_FMOD_INC) $(DEFINES) |
| 328 | LIBS += $(CONFIG_FMOD_LIB) |
bellard | 85571bc | 2004-11-07 18:04:02 +0000 | [diff] [blame] | 329 | endif |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 330 | ifdef CONFIG_ADLIB |
| 331 | SOUND_HW += fmopl.o adlib.o |
| 332 | endif |
bellard | ec36b69 | 2006-07-16 18:57:03 +0000 | [diff] [blame] | 333 | AUDIODRV+= wavcapture.o |
bellard | 85571bc | 2004-11-07 18:04:02 +0000 | [diff] [blame] | 334 | |
pbrook | 2e5d83b | 2006-05-25 23:58:51 +0000 | [diff] [blame] | 335 | # SCSI layer |
pbrook | 7d8406b | 2006-05-30 01:48:12 +0000 | [diff] [blame] | 336 | VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
pbrook | 2e5d83b | 2006-05-25 23:58:51 +0000 | [diff] [blame] | 337 | |
bellard | a594cfb | 2005-11-06 16:13:29 +0000 | [diff] [blame] | 338 | # USB layer |
pbrook | 2e5d83b | 2006-05-25 23:58:51 +0000 | [diff] [blame] | 339 | VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
bellard | a594cfb | 2005-11-06 16:13:29 +0000 | [diff] [blame] | 340 | |
pbrook | a41b2ff | 2006-02-05 04:14:41 +0000 | [diff] [blame] | 341 | # PCI network cards |
bellard | e3c2613 | 2006-07-04 11:33:00 +0000 | [diff] [blame] | 342 | VL_OBJS+= ne2000.o rtl8139.o pcnet.o |
pbrook | a41b2ff | 2006-02-05 04:14:41 +0000 | [diff] [blame] | 343 | |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 344 | ifeq ($(TARGET_BASE_ARCH), i386) |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 345 | # Hardware support |
pbrook | a41b2ff | 2006-02-05 04:14:41 +0000 | [diff] [blame] | 346 | VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
bellard | fd06c37 | 2006-04-24 21:58:30 +0000 | [diff] [blame] | 347 | VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
pbrook | 502a539 | 2006-05-13 16:11:23 +0000 | [diff] [blame] | 348 | VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o |
| 349 | VL_OBJS+= usb-uhci.o |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 350 | DEFINES += -DHAS_AUDIO |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 351 | endif |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 352 | ifeq ($(TARGET_BASE_ARCH), ppc) |
pbrook | a41b2ff | 2006-02-05 04:14:41 +0000 | [diff] [blame] | 353 | VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
bellard | 6420120 | 2004-05-26 22:55:16 +0000 | [diff] [blame] | 354 | VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
bellard | e68b9b2 | 2005-06-05 15:21:57 +0000 | [diff] [blame] | 355 | VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
pbrook | 502a539 | 2006-05-13 16:11:23 +0000 | [diff] [blame] | 356 | VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 357 | DEFINES += -DHAS_AUDIO |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 358 | endif |
bellard | 6af0bf9 | 2005-07-02 14:58:51 +0000 | [diff] [blame] | 359 | ifeq ($(TARGET_ARCH), mips) |
pbrook | a41b2ff | 2006-02-05 04:14:41 +0000 | [diff] [blame] | 360 | VL_OBJS+= mips_r4k.o dma.o vga.o serial.o i8254.o i8259.o |
bellard | 697584a | 2005-08-21 09:41:56 +0000 | [diff] [blame] | 361 | #VL_OBJS+= #ide.o pckbd.o fdc.o m48t59.o |
bellard | 6af0bf9 | 2005-07-02 14:58:51 +0000 | [diff] [blame] | 362 | endif |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 363 | ifeq ($(TARGET_BASE_ARCH), sparc) |
bellard | 3475187 | 2005-07-02 14:31:34 +0000 | [diff] [blame] | 364 | ifeq ($(TARGET_ARCH), sparc64) |
pbrook | 502a539 | 2006-05-13 16:11:23 +0000 | [diff] [blame] | 365 | VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 366 | VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
| 367 | VL_OBJS+= cirrus_vga.o parallel.o |
bellard | 3475187 | 2005-07-02 14:31:34 +0000 | [diff] [blame] | 368 | else |
bellard | 67e999b | 2006-09-03 16:09:07 +0000 | [diff] [blame] | 369 | VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
| 370 | VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o |
bellard | b817493 | 2006-09-10 19:25:12 +0000 | [diff] [blame] | 371 | VL_OBJS+= cs4231.o |
bellard | 3475187 | 2005-07-02 14:31:34 +0000 | [diff] [blame] | 372 | endif |
bellard | e95c8d5 | 2004-09-30 22:22:08 +0000 | [diff] [blame] | 373 | endif |
bellard | b5ff1b3 | 2005-11-26 10:38:39 +0000 | [diff] [blame] | 374 | ifeq ($(TARGET_BASE_ARCH), arm) |
pbrook | cdbdb64 | 2006-04-09 01:32:52 +0000 | [diff] [blame] | 375 | VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
pbrook | 1640695 | 2006-04-27 23:15:07 +0000 | [diff] [blame] | 376 | VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o |
pbrook | 502a539 | 2006-05-13 16:11:23 +0000 | [diff] [blame] | 377 | VL_OBJS+= versatile_pci.o |
pbrook | e69954b | 2006-09-23 17:40:58 +0000 | [diff] [blame] | 378 | VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
bellard | b5ff1b3 | 2005-11-26 10:38:39 +0000 | [diff] [blame] | 379 | endif |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 380 | ifeq ($(TARGET_BASE_ARCH), sh4) |
| 381 | VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o |
| 382 | endif |
bellard | a541f29 | 2004-04-12 20:39:29 +0000 | [diff] [blame] | 383 | ifdef CONFIG_GDBSTUB |
| 384 | VL_OBJS+=gdbstub.o |
bellard | 728c9fd | 2004-01-05 00:08:14 +0000 | [diff] [blame] | 385 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 386 | ifdef CONFIG_SDL |
| 387 | VL_OBJS+=sdl.o |
bellard | de5eaa6 | 2003-11-16 23:18:17 +0000 | [diff] [blame] | 388 | endif |
bellard | 2423686 | 2006-04-30 21:28:36 +0000 | [diff] [blame] | 389 | VL_OBJS+=vnc.o |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 390 | ifdef CONFIG_COCOA |
| 391 | VL_OBJS+=cocoa.o |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 392 | COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
| 393 | ifdef CONFIG_COREAUDIO |
| 394 | COCOA_LIBS+=-framework CoreAudio |
| 395 | endif |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 396 | endif |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 397 | ifdef CONFIG_SLIRP |
| 398 | DEFINES+=-I$(SRC_PATH)/slirp |
| 399 | SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
| 400 | slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ |
bellard | c7f7464 | 2004-08-24 21:57:12 +0000 | [diff] [blame] | 401 | tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 402 | VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 403 | endif |
| 404 | |
bellard | c321f67 | 2003-10-30 01:18:42 +0000 | [diff] [blame] | 405 | VL_LDFLAGS= |
| 406 | # specific flags are needed for non soft mmu emulator |
bellard | c321f67 | 2003-10-30 01:18:42 +0000 | [diff] [blame] | 407 | ifdef CONFIG_STATIC |
| 408 | VL_LDFLAGS+=-static |
| 409 | endif |
bellard | de5eaa6 | 2003-11-16 23:18:17 +0000 | [diff] [blame] | 410 | ifndef CONFIG_SOFTMMU |
| 411 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
| 412 | endif |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 413 | ifndef CONFIG_DARWIN |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 414 | ifndef CONFIG_WIN32 |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 415 | ifndef CONFIG_SOLARIS |
bellard | 9f909fe | 2006-07-13 23:00:26 +0000 | [diff] [blame] | 416 | VL_LIBS=-lutil -lrt |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 417 | endif |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 418 | endif |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 419 | endif |
bellard | e3086fb | 2005-02-10 21:48:51 +0000 | [diff] [blame] | 420 | ifdef TARGET_GPROF |
| 421 | vl.o: CFLAGS+=-p |
| 422 | VL_LDFLAGS+=-p |
| 423 | endif |
bellard | c321f67 | 2003-10-30 01:18:42 +0000 | [diff] [blame] | 424 | |
bellard | b8076a7 | 2005-04-07 22:20:31 +0000 | [diff] [blame] | 425 | ifeq ($(ARCH),ia64) |
| 426 | VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
| 427 | endif |
| 428 | |
bellard | 74ccb34 | 2006-07-18 21:23:34 +0000 | [diff] [blame] | 429 | ifeq ($(ARCH),sparc64) |
| 430 | VL_LDFLAGS+=-m64 |
| 431 | VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld |
| 432 | endif |
| 433 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 434 | ifdef CONFIG_WIN32 |
| 435 | SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
| 436 | endif |
| 437 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 438 | $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 439 | $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
| 440 | |
| 441 | cocoa.o: cocoa.m |
| 442 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 443 | |
bellard | 3d11d0e | 2004-12-12 16:56:30 +0000 | [diff] [blame] | 444 | sdl.o: sdl.c keymaps.c sdl_keysym.h |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 445 | $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< |
| 446 | |
bellard | 2423686 | 2006-04-30 21:28:36 +0000 | [diff] [blame] | 447 | vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h |
| 448 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
| 449 | |
bellard | 9f059ec | 2004-11-14 18:59:52 +0000 | [diff] [blame] | 450 | sdlaudio.o: sdlaudio.c |
| 451 | $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $< |
| 452 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 453 | depend: $(SRCS) |
bellard | 16e9b7d | 2003-10-27 21:09:52 +0000 | [diff] [blame] | 454 | $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 455 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 456 | vldepend: $(VL_OBJS:.o=.c) |
| 457 | $(CC) -MM $(CFLAGS) $(DEFINES) $^ 1>.depend |
| 458 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 459 | # libqemu |
| 460 | |
| 461 | libqemu.a: $(LIBOBJS) |
| 462 | rm -f $@ |
| 463 | $(AR) rcs $@ $(LIBOBJS) |
| 464 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 465 | translate.o: translate.c gen-op.h opc.h cpu.h |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 466 | |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 467 | translate-all.o: translate-all.c opc.h cpu.h |
| 468 | |
| 469 | translate-op.o: translate-all.c op.h opc.h cpu.h |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 470 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 471 | op.h: op.o $(DYNGEN) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 472 | $(DYNGEN) -o $@ $< |
| 473 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 474 | opc.h: op.o $(DYNGEN) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 475 | $(DYNGEN) -c -o $@ $< |
| 476 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 477 | gen-op.h: op.o $(DYNGEN) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 478 | $(DYNGEN) -g -o $@ $< |
| 479 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 480 | op.o: op.c |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 481 | $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
| 482 | |
bellard | 6e1b3e4 | 2006-08-17 17:41:26 +0000 | [diff] [blame] | 483 | # HELPER_CFLAGS is used for all the code compiled with static register |
| 484 | # variables |
| 485 | ifeq ($(TARGET_BASE_ARCH), i386) |
| 486 | # XXX: rename helper.c to op_helper.c |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 487 | helper.o: helper.c |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 488 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
bellard | 6e1b3e4 | 2006-08-17 17:41:26 +0000 | [diff] [blame] | 489 | else |
| 490 | op_helper.o: op_helper.c |
| 491 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
| 492 | endif |
| 493 | |
| 494 | cpu-exec.o: cpu-exec.c |
| 495 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 496 | |
bellard | 00a67ba | 2006-10-28 12:19:07 +0000 | [diff] [blame^] | 497 | # Note: this is a workaround. The real fix is to avoid compiling |
| 498 | # cpu_signal_handler() in cpu-exec.c. |
| 499 | signal.o: signal.c |
| 500 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
| 501 | |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 502 | ifeq ($(TARGET_BASE_ARCH), i386) |
bellard | 664e0f1 | 2005-01-08 18:58:29 +0000 | [diff] [blame] | 503 | op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 504 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 505 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 506 | ifeq ($(TARGET_ARCH), arm) |
| 507 | op.o: op.c op_template.h |
pbrook | bdd5003 | 2006-02-06 04:11:15 +0000 | [diff] [blame] | 508 | pl110.o: pl110_template.h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 509 | endif |
| 510 | |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 511 | ifeq ($(TARGET_BASE_ARCH), sparc) |
bellard | 3475187 | 2005-07-02 14:31:34 +0000 | [diff] [blame] | 512 | op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
| 513 | magic_load.o: elf_op.h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 514 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 515 | |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 516 | ifeq ($(TARGET_BASE_ARCH), ppc) |
bellard | 728c9fd | 2004-01-05 00:08:14 +0000 | [diff] [blame] | 517 | op.o: op.c op_template.h op_mem.h |
| 518 | op_helper.o: op_helper_mem.h |
bellard | 3fc6c08 | 2005-07-02 20:59:34 +0000 | [diff] [blame] | 519 | translate.o: translate.c translate_init.c |
bellard | 728c9fd | 2004-01-05 00:08:14 +0000 | [diff] [blame] | 520 | endif |
| 521 | |
bellard | 6af0bf9 | 2005-07-02 14:58:51 +0000 | [diff] [blame] | 522 | ifeq ($(TARGET_ARCH), mips) |
| 523 | op.o: op.c op_template.c op_mem.c |
| 524 | op_helper.o: op_helper_mem.c |
| 525 | endif |
| 526 | |
bellard | 5fe141f | 2006-04-23 17:12:42 +0000 | [diff] [blame] | 527 | loader.o: loader.c elf_ops.h |
| 528 | |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 529 | ifeq ($(TARGET_ARCH), sh4) |
| 530 | op.o: op.c op_mem.c cpu.h |
| 531 | op_helper.o: op_helper.c exec.h cpu.h |
| 532 | helper.o: helper.c exec.h cpu.h |
bellard | 27c7ca7 | 2006-04-27 21:32:09 +0000 | [diff] [blame] | 533 | sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
| 534 | shix.o: shix.c sh7750_regs.h sh7750_regnames.h |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 535 | sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
bellard | 27c7ca7 | 2006-04-27 21:32:09 +0000 | [diff] [blame] | 536 | tc58128.o: tc58128.c |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 537 | endif |
| 538 | |
pbrook | 214feb5 | 2006-05-13 16:30:17 +0000 | [diff] [blame] | 539 | $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
| 540 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 541 | %.o: %.c |
| 542 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
| 543 | |
bellard | f72b519 | 2004-02-16 21:55:35 +0000 | [diff] [blame] | 544 | %.o: %.S |
| 545 | $(CC) $(DEFINES) -c -o $@ $< |
| 546 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 547 | clean: |
bellard | e362b55 | 2005-04-26 20:34:26 +0000 | [diff] [blame] | 548 | rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 549 | |
| 550 | install: all |
bellard | 9b14bb0 | 2004-03-26 22:43:34 +0000 | [diff] [blame] | 551 | ifneq ($(PROGS),) |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 552 | $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
bellard | 9b14bb0 | 2004-03-26 22:43:34 +0000 | [diff] [blame] | 553 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 554 | |
| 555 | ifneq ($(wildcard .depend),) |
| 556 | include .depend |
| 557 | endif |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 558 | |
bellard | c0fe382 | 2005-11-05 18:55:28 +0000 | [diff] [blame] | 559 | ifeq (1, 0) |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 560 | audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
bellard | c0fe382 | 2005-11-05 18:55:28 +0000 | [diff] [blame] | 561 | fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 562 | CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
| 563 | endif |