Statistics
| Branch: | Revision:

root / Makefile @ a735aa31

History | View | Annotate | Download (2 kB)

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 qemu.1
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 qemu.pod
27
	make -C tests clean
28
	for d in $(TARGET_DIRS); do \
29
	make -C $$d $@ || exit 1 ; \
30
        done
31

    
32
distclean: clean
33
	rm -f config-host.mak config-host.h
34
	for d in $(TARGET_DIRS); do \
35
	rm -rf $$d || exit 1 ; \
36
        done
37

    
38
install: all 
39
	mkdir -p $(prefix)/bin
40
	install -m 755 -s $(TOOLS) $(prefix)/bin
41
	mkdir -p $(sharedir)
42
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
43
                       pc-bios/linux_boot.bin $(sharedir)
44
	mkdir -p $(mandir)/man1
45
	install qemu.1 $(mandir)/man1
46
	for d in $(TARGET_DIRS); do \
47
	make -C $$d $@ || exit 1 ; \
48
        done
49

    
50
# various test targets
51
test speed test2: all
52
	make -C tests $@
53

    
54
TAGS: 
55
	etags *.[ch] tests/*.[ch]
56

    
57
# documentation
58
qemu-doc.html: qemu-doc.texi
59
	texi2html -monolithic -number $<
60

    
61
qemu.1: qemu-doc.texi
62
	./texi2pod.pl $< qemu.pod
63
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
64

    
65
FILE=qemu-$(shell cat VERSION)
66

    
67
# tar release (use 'make -k tar' on a checkouted tree)
68
tar:
69
	rm -rf /tmp/$(FILE)
70
	cp -r . /tmp/$(FILE)
71
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
72
	rm -rf /tmp/$(FILE)
73

    
74
# generate a binary distribution
75
tarbin:
76
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
77
	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
78
	$(prefix)/bin/qemu-i386 \
79
        $(prefix)/bin/qemu-arm \
80
        $(prefix)/bin/qemu-sparc \
81
        $(prefix)/bin/qemu-ppc \
82
	$(sharedir)/bios.bin \
83
	$(sharedir)/vgabios.bin \
84
	$(mandir)/man1/qemu.1 )
85

    
86
ifneq ($(wildcard .depend),)
87
include .depend
88
endif