fixed invalid code gen
[qemu] / Makefile
1 include config-host.mak
2
3 CFLAGS=-Wall -O2 -g
4 LDFLAGS=-g
5 LIBS=
6 DEFINES+=-D_GNU_SOURCE
7 TOOLS=vlmkcow
8
9 all: dyngen $(TOOLS) qemu-doc.html
10         for d in $(TARGET_DIRS); do \
11         make -C $$d $@ || exit 1 ; \
12         done
13
14 vlmkcow: vlmkcow.o
15         $(HOST_CC) -o $@ $^  $(LIBS)
16
17 dyngen: dyngen.o
18         $(HOST_CC) -o $@ $^  $(LIBS)
19
20 %.o: %.c
21         $(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
22
23 clean:
24         rm -f *.o *.a $(TOOLS) dyngen TAGS
25         for d in $(TARGET_DIRS); do \
26         make -C $$d $@ || exit 1 ; \
27         done
28
29 distclean: clean
30         rm -f config.mak config.h
31
32 install: all 
33         mkdir -p $(prefix)/bin
34         install -m 755 -s $(TOOLS) $(prefix)/bin
35         for d in $(TARGET_DIRS); do \
36         make -C $$d $@ || exit 1 ; \
37         done
38
39 # various test targets
40 test speed: all
41         make -C tests $@
42
43 TAGS: 
44         etags *.[ch] tests/*.[ch]
45
46 # documentation
47 qemu-doc.html: qemu-doc.texi
48         texi2html -monolithic -number $<
49
50 FILES= \
51 README README.distrib COPYING COPYING.LIB TODO Changelog VERSION \
52 configure \
53 dyngen.c dyngen.h dyngen-exec.h ioctls.h syscall_types.h \
54 Makefile elf.h elfload.c main.c signal.c qemu.h \
55 syscall.c syscall_defs.h vm86.c path.c mmap.c \
56 i386.ld ppc.ld alpha.ld s390.ld sparc.ld arm.ld\
57 vl.c i386-vl.ld vl.h block.c vlmkcow.c\
58 thunk.c cpu-exec.c translate.c cpu-all.h thunk.h exec.h\
59 exec.c cpu-exec.c gdbstub.c\
60 cpu-i386.h op-i386.c helper-i386.c syscall-i386.h translate-i386.c \
61 exec-i386.h ops_template.h ops_template_mem.h op_string.h opreg_template.h \
62 cpu-arm.h syscall-arm.h exec-arm.h op-arm.c translate-arm.c op-arm-template.h \
63 dis-asm.h disas.c disas.h alpha-dis.c ppc-dis.c i386-dis.c sparc-dis.c \
64 arm-dis.c \
65 tests/Makefile \
66 tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h \
67 tests/test-i386-muldiv.h tests/test-i386-code16.S tests/test-i386-vm86.S \
68 tests/hello-i386.c tests/hello-i386 \
69 tests/hello-arm.c tests/hello-arm \
70 tests/sha1.c \
71 tests/testsig.c tests/testclone.c tests/testthread.c \
72 tests/runcom.c tests/pi_10.com \
73 tests/test_path.c \
74 qemu-doc.texi qemu-doc.html
75
76 FILE=qemu-$(VERSION)
77
78 tar:
79         rm -rf /tmp/$(FILE)
80         mkdir -p /tmp/$(FILE)
81         cp -P $(FILES) /tmp/$(FILE)
82         ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
83         rm -rf /tmp/$(FILE)
84
85 # generate a binary distribution including the test binary environnment 
86 BINPATH=/usr/local/qemu-i386
87
88 tarbin:
89         tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \
90                  $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr
91         tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \
92                  $(BINPATH)/wine
93
94 ifneq ($(wildcard .depend),)
95 include .depend
96 endif