Makefile 2.02 KB
Newer Older
bellard's avatar
bellard committed
1
include config-host.mak
bellard's avatar
bellard committed
2

bellard's avatar
bellard committed
3
CFLAGS=-Wall -O2 -g
4
LDFLAGS=-g
bellard's avatar
bellard committed
5
LIBS=
bellard's avatar
bellard committed
6
DEFINES+=-D_GNU_SOURCE
7
TOOLS=qemu-mkcow
bellard's avatar
bellard committed
8

9
all: dyngen $(TOOLS) qemu-doc.html qemu.1
bellard's avatar
bellard committed
10
11
12
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
13

14
qemu-mkcow: qemu-mkcow.o
bellard's avatar
bellard committed
15
	$(HOST_CC) -o $@ $^  $(LIBS)
bellard's avatar
bellard committed
16

bellard's avatar
bellard committed
17
18
dyngen: dyngen.o
	$(HOST_CC) -o $@ $^  $(LIBS)
bellard's avatar
bellard committed
19

20
%.o: %.c
bellard's avatar
bellard committed
21
	$(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
22
23

clean:
24
25
# avoid old build problems by removing potentially incorrect old files
	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
bellard's avatar
bellard committed
27
	make -C tests clean
bellard's avatar
bellard committed
28
29
30
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
31

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

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

bellard's avatar
bellard committed
50
# various test targets
bellard's avatar
update    
bellard committed
51
test speed test2: all
bellard's avatar
bellard committed
52
	make -C tests $@
53

bellard's avatar
bellard committed
54
TAGS: 
bellard's avatar
bellard committed
55
	etags *.[ch] tests/*.[ch]
56

bellard's avatar
bellard committed
57
58
59
60
# documentation
qemu-doc.html: qemu-doc.texi
	texi2html -monolithic -number $<

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

65
FILE=qemu-$(shell cat VERSION)
bellard's avatar
bellard committed
66

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

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

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