Revision 1e43adfc Makefile.target
b/Makefile.target | ||
---|---|---|
1 | 1 |
include config.mak |
2 | 2 |
|
3 |
VPATH=$(SRC_PATH) |
|
3 |
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH) |
|
4 |
VPATH=$(SRC_PATH):$(TARGET_PATH) |
|
4 | 5 |
CFLAGS=-Wall -O2 -g |
5 | 6 |
LDFLAGS=-g |
6 | 7 |
LIBS= |
7 |
DEFINES=-I. |
|
8 |
DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
|
|
8 | 9 |
HELPER_CFLAGS=$(CFLAGS) |
9 | 10 |
DYNGEN=../dyngen |
11 |
# user emulator name |
|
12 |
QEMU_USER=qemu-$(TARGET_ARCH) |
|
13 |
# system emulator name |
|
14 |
ifdef CONFIG_SOFTMMU |
|
15 |
QEMU_SYSTEM=qemu-softmmu |
|
16 |
else |
|
17 |
QEMU_SYSTEM=qemu |
|
18 |
endif |
|
19 |
|
|
10 | 20 |
ifndef CONFIG_SOFTMMU |
11 |
PROGS=qemu
|
|
21 |
PROGS=$(QEMU_USER)
|
|
12 | 22 |
endif |
13 | 23 |
|
14 | 24 |
ifdef CONFIG_STATIC |
... | ... | |
32 | 42 |
LDFLAGS+=-Wl,-shared |
33 | 43 |
endif |
34 | 44 |
ifeq ($(TARGET_ARCH), i386) |
35 |
PROGS+=vl
|
|
45 |
PROGS+=$(QEMU_SYSTEM)
|
|
36 | 46 |
endif |
37 | 47 |
endif |
38 | 48 |
|
... | ... | |
108 | 118 |
OBJS+= libqemu.a |
109 | 119 |
|
110 | 120 |
# cpu emulator library |
111 |
LIBOBJS=thunk.o exec.o translate.o cpu-exec.o gdbstub.o |
|
121 |
LIBOBJS=thunk.o exec.o translate-all.o cpu-exec.o gdbstub.o \ |
|
122 |
translate.o op.o |
|
112 | 123 |
|
113 | 124 |
ifeq ($(TARGET_ARCH), i386) |
114 |
LIBOBJS+=translate-i386.o op-i386.o helper-i386.o helper2-i386.o |
|
115 |
endif |
|
116 |
ifeq ($(TARGET_ARCH), arm) |
|
117 |
LIBOBJS+=translate-arm.o op-arm.o |
|
125 |
LIBOBJS+=helper.o helper2.o |
|
118 | 126 |
endif |
119 | 127 |
|
120 | 128 |
# NOTE: the disassembler code is only needed for debugging |
... | ... | |
139 | 147 |
OBJS += ia64-syscall.o |
140 | 148 |
endif |
141 | 149 |
|
142 |
all: $(PROGS) qemu-doc.html
|
|
150 |
all: $(PROGS) |
|
143 | 151 |
|
144 |
qemu: $(OBJS)
|
|
152 |
$(QEMU_USER): $(OBJS)
|
|
145 | 153 |
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
146 | 154 |
ifeq ($(ARCH),alpha) |
147 | 155 |
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
... | ... | |
156 | 164 |
SDL_LIBS+=-L/usr/X11R6/lib -lX11 -lXext -lXv -ldl -lm |
157 | 165 |
endif |
158 | 166 |
|
159 |
vl: $(VL_OBJS) libqemu.a
|
|
167 |
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
|
|
160 | 168 |
$(CC) -static -Wl,-T,$(SRC_PATH)/i386-vl.ld -o $@ $^ $(LIBS) $(SDL_LIBS) |
161 | 169 |
|
162 | 170 |
sdl.o: sdl.c |
... | ... | |
171 | 179 |
rm -f $@ |
172 | 180 |
$(AR) rcs $@ $(LIBOBJS) |
173 | 181 |
|
174 |
translate-$(TARGET_ARCH).o: translate-$(TARGET_ARCH).c gen-op-$(TARGET_ARCH).h opc-$(TARGET_ARCH).h cpu-$(TARGET_ARCH).h
|
|
182 |
translate.o: translate.c gen-op.h opc.h cpu.h
|
|
175 | 183 |
|
176 |
translate.o: translate.c op-$(TARGET_ARCH).h opc-$(TARGET_ARCH).h cpu-$(TARGET_ARCH).h
|
|
184 |
translate-all.o: translate-all.c op.h opc.h cpu.h
|
|
177 | 185 |
|
178 |
op-$(TARGET_ARCH).h: op-$(TARGET_ARCH).o $(DYNGEN)
|
|
186 |
op.h: op.o $(DYNGEN)
|
|
179 | 187 |
$(DYNGEN) -o $@ $< |
180 | 188 |
|
181 |
opc-$(TARGET_ARCH).h: op-$(TARGET_ARCH).o $(DYNGEN)
|
|
189 |
opc.h: op.o $(DYNGEN)
|
|
182 | 190 |
$(DYNGEN) -c -o $@ $< |
183 | 191 |
|
184 |
gen-op-$(TARGET_ARCH).h: op-$(TARGET_ARCH).o $(DYNGEN)
|
|
192 |
gen-op.h: op.o $(DYNGEN)
|
|
185 | 193 |
$(DYNGEN) -g -o $@ $< |
186 | 194 |
|
187 |
op-$(TARGET_ARCH).o: op-$(TARGET_ARCH).c
|
|
195 |
op.o: op.c
|
|
188 | 196 |
$(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
189 | 197 |
|
190 |
helper-$(TARGET_ARCH).o: helper-$(TARGET_ARCH).c
|
|
198 |
helper.o: helper.c
|
|
191 | 199 |
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< |
192 | 200 |
|
193 |
op-i386.o: op-i386.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h |
|
201 |
ifeq ($(TARGET_ARCH), i386) |
|
202 |
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h |
|
203 |
endif |
|
204 |
|
|
205 |
ifeq ($(TARGET_ARCH), arm) |
|
206 |
op.o: op.c op_template.h |
|
207 |
endif |
|
194 | 208 |
|
195 |
op-arm.o: op-arm.c op-arm-template.h |
|
209 |
ifeq ($(TARGET_ARCH), sparc) |
|
210 |
op.o: op.c op_template.h |
|
211 |
endif |
|
196 | 212 |
|
197 | 213 |
%.o: %.c |
198 | 214 |
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
199 | 215 |
|
200 | 216 |
clean: |
201 |
rm -f *.o *.a *~ $(PROGS) \ |
|
202 |
gen-op-$(TARGET_ARCH).h opc-$(TARGET_ARCH).h op-$(TARGET_ARCH).h |
|
217 |
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h |
|
218 |
|
|
219 |
install: all |
|
220 |
install -m 755 -s $(PROGS) $(prefix)/bin |
|
203 | 221 |
|
204 | 222 |
ifneq ($(wildcard .depend),) |
205 | 223 |
include .depend |
Also available in: Unified diff