Commit 1e43adfc89d2730ab5b24b7a6b5c8ed373b6e284
1 parent
7a3f1944
new directory structure - changed naming of qemu and vl
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@387 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
58 additions
and
59 deletions
Makefile
@@ -4,14 +4,14 @@ CFLAGS=-Wall -O2 -g | @@ -4,14 +4,14 @@ CFLAGS=-Wall -O2 -g | ||
4 | LDFLAGS=-g | 4 | LDFLAGS=-g |
5 | LIBS= | 5 | LIBS= |
6 | DEFINES+=-D_GNU_SOURCE | 6 | DEFINES+=-D_GNU_SOURCE |
7 | -TOOLS=vlmkcow | 7 | +TOOLS=qemu-mkcow |
8 | 8 | ||
9 | all: dyngen $(TOOLS) qemu-doc.html | 9 | all: dyngen $(TOOLS) qemu-doc.html |
10 | for d in $(TARGET_DIRS); do \ | 10 | for d in $(TARGET_DIRS); do \ |
11 | make -C $$d $@ || exit 1 ; \ | 11 | make -C $$d $@ || exit 1 ; \ |
12 | done | 12 | done |
13 | 13 | ||
14 | -vlmkcow: vlmkcow.o | 14 | +qemu-mkcow: qemu-mkcow.o |
15 | $(HOST_CC) -o $@ $^ $(LIBS) | 15 | $(HOST_CC) -o $@ $^ $(LIBS) |
16 | 16 | ||
17 | dyngen: dyngen.o | 17 | dyngen: dyngen.o |
@@ -52,39 +52,12 @@ TAGS: | @@ -52,39 +52,12 @@ TAGS: | ||
52 | qemu-doc.html: qemu-doc.texi | 52 | qemu-doc.html: qemu-doc.texi |
53 | texi2html -monolithic -number $< | 53 | texi2html -monolithic -number $< |
54 | 54 | ||
55 | -FILES= \ | ||
56 | -README README.distrib COPYING COPYING.LIB TODO Changelog VERSION \ | ||
57 | -configure Makefile Makefile.target \ | ||
58 | -dyngen.c dyngen.h dyngen-exec.h ioctls.h syscall_types.h \ | ||
59 | -elf.h elfload.c main.c signal.c qemu.h \ | ||
60 | -syscall.c syscall_defs.h vm86.c path.c mmap.c \ | ||
61 | -i386.ld ppc.ld alpha.ld s390.ld sparc.ld arm.ld m68k.ld \ | ||
62 | -vl.c i386-vl.ld vl.h block.c vlmkcow.c vga.c vga_template.h sdl.c \ | ||
63 | -thunk.c cpu-exec.c translate.c cpu-all.h cpu-defs.h thunk.h exec.h\ | ||
64 | -exec.c cpu-exec.c gdbstub.c bswap.h \ | ||
65 | -cpu-i386.h op-i386.c helper-i386.c helper2-i386.c syscall-i386.h translate-i386.c \ | ||
66 | -exec-i386.h ops_template.h ops_template_mem.h opreg_template.h \ | ||
67 | -ops_mem.h softmmu_template.h softmmu_header.h \ | ||
68 | -cpu-arm.h syscall-arm.h exec-arm.h op-arm.c translate-arm.c op-arm-template.h \ | ||
69 | -dis-asm.h disas.c disas.h alpha-dis.c ppc-dis.c i386-dis.c sparc-dis.c \ | ||
70 | -arm-dis.c \ | ||
71 | -tests/Makefile \ | ||
72 | -tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h \ | ||
73 | -tests/test-i386-muldiv.h tests/test-i386-code16.S tests/test-i386-vm86.S \ | ||
74 | -tests/hello-i386.c tests/hello-i386 \ | ||
75 | -tests/hello-arm.c tests/hello-arm \ | ||
76 | -tests/sha1.c \ | ||
77 | -tests/testsig.c tests/testclone.c tests/testthread.c \ | ||
78 | -tests/runcom.c tests/pi_10.com \ | ||
79 | -tests/test_path.c \ | ||
80 | -qemu-doc.texi qemu-doc.html | ||
81 | - | ||
82 | -FILE=qemu-$(VERSION) | 55 | +FILE=qemu-$(shell cat VERSION) |
83 | 56 | ||
57 | +# tar release (use 'make -k tar' on a checkouted tree) | ||
84 | tar: | 58 | tar: |
85 | rm -rf /tmp/$(FILE) | 59 | rm -rf /tmp/$(FILE) |
86 | - mkdir -p /tmp/$(FILE) | ||
87 | - cp --parent $(FILES) /tmp/$(FILE) | 60 | + cp -r . /tmp/$(FILE) |
88 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) ) | 61 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) ) |
89 | rm -rf /tmp/$(FILE) | 62 | rm -rf /tmp/$(FILE) |
90 | 63 |
Makefile.target
1 | include config.mak | 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 | CFLAGS=-Wall -O2 -g | 5 | CFLAGS=-Wall -O2 -g |
5 | LDFLAGS=-g | 6 | LDFLAGS=-g |
6 | LIBS= | 7 | LIBS= |
7 | -DEFINES=-I. | 8 | +DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) |
8 | HELPER_CFLAGS=$(CFLAGS) | 9 | HELPER_CFLAGS=$(CFLAGS) |
9 | DYNGEN=../dyngen | 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 | ifndef CONFIG_SOFTMMU | 20 | ifndef CONFIG_SOFTMMU |
11 | -PROGS=qemu | 21 | +PROGS=$(QEMU_USER) |
12 | endif | 22 | endif |
13 | 23 | ||
14 | ifdef CONFIG_STATIC | 24 | ifdef CONFIG_STATIC |
@@ -32,7 +42,7 @@ else | @@ -32,7 +42,7 @@ else | ||
32 | LDFLAGS+=-Wl,-shared | 42 | LDFLAGS+=-Wl,-shared |
33 | endif | 43 | endif |
34 | ifeq ($(TARGET_ARCH), i386) | 44 | ifeq ($(TARGET_ARCH), i386) |
35 | -PROGS+=vl | 45 | +PROGS+=$(QEMU_SYSTEM) |
36 | endif | 46 | endif |
37 | endif | 47 | endif |
38 | 48 | ||
@@ -108,13 +118,11 @@ SRCS:= $(OBJS:.o=.c) | @@ -108,13 +118,11 @@ SRCS:= $(OBJS:.o=.c) | ||
108 | OBJS+= libqemu.a | 118 | OBJS+= libqemu.a |
109 | 119 | ||
110 | # cpu emulator library | 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 | ifeq ($(TARGET_ARCH), i386) | 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 | endif | 126 | endif |
119 | 127 | ||
120 | # NOTE: the disassembler code is only needed for debugging | 128 | # NOTE: the disassembler code is only needed for debugging |
@@ -139,9 +147,9 @@ ifeq ($(ARCH),ia64) | @@ -139,9 +147,9 @@ ifeq ($(ARCH),ia64) | ||
139 | OBJS += ia64-syscall.o | 147 | OBJS += ia64-syscall.o |
140 | endif | 148 | endif |
141 | 149 | ||
142 | -all: $(PROGS) qemu-doc.html | 150 | +all: $(PROGS) |
143 | 151 | ||
144 | -qemu: $(OBJS) | 152 | +$(QEMU_USER): $(OBJS) |
145 | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) | 153 | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
146 | ifeq ($(ARCH),alpha) | 154 | ifeq ($(ARCH),alpha) |
147 | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of | 155 | # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
@@ -156,7 +164,7 @@ VL_OBJS+=sdl.o | @@ -156,7 +164,7 @@ VL_OBJS+=sdl.o | ||
156 | SDL_LIBS+=-L/usr/X11R6/lib -lX11 -lXext -lXv -ldl -lm | 164 | SDL_LIBS+=-L/usr/X11R6/lib -lX11 -lXext -lXv -ldl -lm |
157 | endif | 165 | endif |
158 | 166 | ||
159 | -vl: $(VL_OBJS) libqemu.a | 167 | +$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
160 | $(CC) -static -Wl,-T,$(SRC_PATH)/i386-vl.ld -o $@ $^ $(LIBS) $(SDL_LIBS) | 168 | $(CC) -static -Wl,-T,$(SRC_PATH)/i386-vl.ld -o $@ $^ $(LIBS) $(SDL_LIBS) |
161 | 169 | ||
162 | sdl.o: sdl.c | 170 | sdl.o: sdl.c |
@@ -171,35 +179,45 @@ libqemu.a: $(LIBOBJS) | @@ -171,35 +179,45 @@ libqemu.a: $(LIBOBJS) | ||
171 | rm -f $@ | 179 | rm -f $@ |
172 | $(AR) rcs $@ $(LIBOBJS) | 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 | $(DYNGEN) -o $@ $< | 187 | $(DYNGEN) -o $@ $< |
180 | 188 | ||
181 | -opc-$(TARGET_ARCH).h: op-$(TARGET_ARCH).o $(DYNGEN) | 189 | +opc.h: op.o $(DYNGEN) |
182 | $(DYNGEN) -c -o $@ $< | 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 | $(DYNGEN) -g -o $@ $< | 193 | $(DYNGEN) -g -o $@ $< |
186 | 194 | ||
187 | -op-$(TARGET_ARCH).o: op-$(TARGET_ARCH).c | 195 | +op.o: op.c |
188 | $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< | 196 | $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
189 | 197 | ||
190 | -helper-$(TARGET_ARCH).o: helper-$(TARGET_ARCH).c | 198 | +helper.o: helper.c |
191 | $(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $< | 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 | %.o: %.c | 213 | %.o: %.c |
198 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< | 214 | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
199 | 215 | ||
200 | clean: | 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 | ifneq ($(wildcard .depend),) | 222 | ifneq ($(wildcard .depend),) |
205 | include .depend | 223 | include .depend |
configure
@@ -18,7 +18,7 @@ TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" | @@ -18,7 +18,7 @@ TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" | ||
18 | 18 | ||
19 | # default parameters | 19 | # default parameters |
20 | prefix="/usr/local" | 20 | prefix="/usr/local" |
21 | -interp_prefix="/usr/gnemul/qemu-i386" | 21 | +interp_prefix="/usr/gnemul/qemu-%M" |
22 | static="no" | 22 | static="no" |
23 | cross_prefix="" | 23 | cross_prefix="" |
24 | cc="gcc" | 24 | cc="gcc" |
@@ -27,7 +27,7 @@ ar="ar" | @@ -27,7 +27,7 @@ ar="ar" | ||
27 | make="make" | 27 | make="make" |
28 | strip="strip" | 28 | strip="strip" |
29 | cpu=`uname -m` | 29 | cpu=`uname -m` |
30 | -target_list="i386 i386-softmmu arm" | 30 | +target_list="i386 i386-softmmu arm sparc" |
31 | case "$cpu" in | 31 | case "$cpu" in |
32 | i386|i486|i586|i686|i86pc|BePC) | 32 | i386|i486|i586|i686|i86pc|BePC) |
33 | cpu="i386" | 33 | cpu="i386" |
@@ -193,7 +193,8 @@ EOF | @@ -193,7 +193,8 @@ EOF | ||
193 | echo "Standard options:" | 193 | echo "Standard options:" |
194 | echo " --help print this message" | 194 | echo " --help print this message" |
195 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | 195 | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
196 | -echo " --interp-prefix=PREFIX where to find shared libraries, etc. [$interp_prefix]" | 196 | +echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
197 | +echo " use %M for cpu name [$interp_prefix]" | ||
197 | echo " --target-list=LIST set target list [$target_list]" | 198 | echo " --target-list=LIST set target list [$target_list]" |
198 | echo "" | 199 | echo "" |
199 | echo "Advanced options (experts only):" | 200 | echo "Advanced options (experts only):" |
@@ -310,6 +311,7 @@ config_mak=$target_dir/config.mak | @@ -310,6 +311,7 @@ config_mak=$target_dir/config.mak | ||
310 | config_h=$target_dir/config.h | 311 | config_h=$target_dir/config.h |
311 | target_cpu=`echo $target | cut -d '-' -f 1` | 312 | target_cpu=`echo $target | cut -d '-' -f 1` |
312 | target_bigendian="no" | 313 | target_bigendian="no" |
314 | +[ "$target_cpu" = "sparc" ] && target_bigendian=yes | ||
313 | target_softmmu="no" | 315 | target_softmmu="no" |
314 | if expr $target : '.*-softmmu' > /dev/null ; then | 316 | if expr $target : '.*-softmmu' > /dev/null ; then |
315 | target_softmmu="yes" | 317 | target_softmmu="yes" |
@@ -326,7 +328,9 @@ echo "/* Automatically generated by configure - do not modify */" > $config_h | @@ -326,7 +328,9 @@ echo "/* Automatically generated by configure - do not modify */" > $config_h | ||
326 | 328 | ||
327 | echo "include ../config-host.mak" >> $config_mak | 329 | echo "include ../config-host.mak" >> $config_mak |
328 | echo "#include \"../config-host.h\"" >> $config_h | 330 | echo "#include \"../config-host.h\"" >> $config_h |
329 | -echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix\"" >> $config_h | 331 | + |
332 | +interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` | ||
333 | +echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h | ||
330 | 334 | ||
331 | if test "$target_cpu" = "i386" ; then | 335 | if test "$target_cpu" = "i386" ; then |
332 | echo "TARGET_ARCH=i386" >> $config_mak | 336 | echo "TARGET_ARCH=i386" >> $config_mak |
@@ -336,6 +340,10 @@ elif test "$target_cpu" = "arm" ; then | @@ -336,6 +340,10 @@ elif test "$target_cpu" = "arm" ; then | ||
336 | echo "TARGET_ARCH=arm" >> $config_mak | 340 | echo "TARGET_ARCH=arm" >> $config_mak |
337 | echo "#define TARGET_ARCH \"arm\"" >> $config_h | 341 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
338 | echo "#define TARGET_ARM 1" >> $config_h | 342 | echo "#define TARGET_ARM 1" >> $config_h |
343 | +elif test "$target_cpu" = "sparc" ; then | ||
344 | + echo "TARGET_ARCH=sparc" >> $config_mak | ||
345 | + echo "#define TARGET_ARCH \"sparc\"" >> $config_h | ||
346 | + echo "#define TARGET_SPARC 1" >> $config_h | ||
339 | else | 347 | else |
340 | echo "Unsupported target CPU" | 348 | echo "Unsupported target CPU" |
341 | exit 1 | 349 | exit 1 |