new directory structure - changed naming of qemu and vl
[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=qemu-mkcow
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 qemu-mkcow: qemu-mkcow.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 FILE=qemu-$(shell cat VERSION)
56
57 # tar release (use 'make -k tar' on a checkouted tree)
58 tar:
59         rm -rf /tmp/$(FILE)
60         cp -r . /tmp/$(FILE)
61         ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
62         rm -rf /tmp/$(FILE)
63
64 # generate a binary distribution including the test binary environnment 
65 BINPATH=/usr/local/qemu-i386
66
67 tarbin:
68         tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \
69                  $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr
70         tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \
71                  $(BINPATH)/wine
72
73 ifneq ($(wildcard .depend),)
74 include .depend
75 endif