Makefile 2.0 KB
Newer Older
B
bellard 已提交
1
include config-host.mak
B
bellard 已提交
2

B
bellard 已提交
3
CFLAGS=-Wall -O2 -g
4
LDFLAGS=-g
B
bellard 已提交
5
LIBS=
B
bellard 已提交
6
DEFINES+=-D_GNU_SOURCE
7
TOOLS=qemu-mkcow
B
bellard 已提交
8

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

14
qemu-mkcow: qemu-mkcow.o
B
bellard 已提交
15
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
16

B
bellard 已提交
17 18
dyngen: dyngen.o
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
19

20
%.o: %.c
B
bellard 已提交
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
B
bellard 已提交
27 28 29
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
30

B
bellard 已提交
31
distclean: clean
32
	rm -f config-host.mak config-host.h
B
updated  
bellard 已提交
33
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
34
	rm -rf $$d || exit 1 ; \
B
updated  
bellard 已提交
35
        done
B
bellard 已提交
36

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

B
bellard 已提交
48
# various test targets
B
update  
bellard 已提交
49
test speed test2: all
B
bellard 已提交
50
	make -C tests $@
51

B
bellard 已提交
52
TAGS: 
B
bellard 已提交
53
	etags *.[ch] tests/*.[ch]
54

B
bellard 已提交
55 56 57 58
# documentation
qemu-doc.html: qemu-doc.texi
	texi2html -monolithic -number $<

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

63
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
64

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

B
bellard 已提交
72
# generate a binary distribution
73
tarbin:
B
bellard 已提交
74 75 76 77 78
	( 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 \
B
update  
bellard 已提交
79
        $(prefix)/bin/qemu-ppc \
B
bellard 已提交
80 81 82
	$(sharedir)/bios.bin \
	$(sharedir)/vgabios.bin \
	$(mandir)/man1/qemu.1 )
83

84 85 86
ifneq ($(wildcard .depend),)
include .depend
endif