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
	make -C tests clean
B
bellard 已提交
28 29 30
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
31

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

B
bellard 已提交
38
install: all 
B
update  
bellard 已提交
39
	mkdir -p $(prefix)/bin
B
bellard 已提交
40
	install -m 755 -s $(TOOLS) $(prefix)/bin
41 42 43 44
	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 已提交
45 46 47
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
B
bellard 已提交
48

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

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

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

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

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

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

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

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