Redhat 9 fixes
[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 # avoid old build problems by removing potentially incorrect old files
25         rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h 
26         rm -f *.o *.a $(TOOLS) dyngen TAGS
27         for d in $(TARGET_DIRS); do \
28         make -C $$d $@ || exit 1 ; \
29         done
30
31 distclean: clean
32         rm -f config-host.mak config-host.h
33         for d in $(TARGET_DIRS); do \
34         rm -f $$d/config.h $$d/config.mak || exit 1 ; \
35         done
36
37 install: all 
38         mkdir -p $(prefix)/bin
39         install -m 755 -s $(TOOLS) $(prefix)/bin
40         for d in $(TARGET_DIRS); do \
41         make -C $$d $@ || exit 1 ; \
42         done
43
44 # various test targets
45 test speed: all
46         make -C tests $@
47
48 TAGS: 
49         etags *.[ch] tests/*.[ch]
50
51 # documentation
52 qemu-doc.html: qemu-doc.texi
53         texi2html -monolithic -number $<
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)
83
84 tar:
85         rm -rf /tmp/$(FILE)
86         mkdir -p /tmp/$(FILE)
87         cp --parent $(FILES) /tmp/$(FILE)
88         ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
89         rm -rf /tmp/$(FILE)
90
91 # generate a binary distribution including the test binary environnment 
92 BINPATH=/usr/local/qemu-i386
93
94 tarbin:
95         tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \
96                  $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr
97         tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \
98                  $(BINPATH)/wine
99
100 ifneq ($(wildcard .depend),)
101 include .depend
102 endif