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

B
bellard 已提交
3
CFLAGS=-Wall -O2 -g
B
bellard 已提交
4 5 6
ifdef CONFIG_WIN32
CFLAGS+=-fpack-struct 
endif
7
LDFLAGS=-g
B
bellard 已提交
8
LIBS=
B
bellard 已提交
9
DEFINES+=-D_GNU_SOURCE
B
bellard 已提交
10
ifndef CONFIG_WIN32
11
TOOLS=qemu-mkcow
B
bellard 已提交
12
endif
B
bellard 已提交
13

B
bellard 已提交
14
all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu.1
B
bellard 已提交
15 16 17
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
18

B
bellard 已提交
19 20
qemu-mkcow: qemu-mkcow.c
	$(CC) $(CFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
B
bellard 已提交
21

B
bellard 已提交
22 23
dyngen$(EXESUF): dyngen.c
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
24 25

clean:
26 27
# 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 
B
bellard 已提交
28
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
B
bellard 已提交
29
	make -C tests clean
B
bellard 已提交
30 31 32
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
33

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

B
bellard 已提交
40
install: all 
B
bellard 已提交
41 42 43 44 45
	mkdir -p "$(bindir)"
ifndef CONFIG_WIN32
	install -m 755 -s $(TOOLS) "$(bindir)"
endif
	mkdir -p "$(sharedir)"
B
bellard 已提交
46
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
B
bellard 已提交
47 48 49 50 51
                       pc-bios/linux_boot.bin "$(sharedir)"
ifndef CONFIG_WIN32
	mkdir -p "$(mandir)/man1"
	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
endif
B
bellard 已提交
52 53 54
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
B
bellard 已提交
55

B
bellard 已提交
56
# various test targets
B
update  
bellard 已提交
57
test speed test2: all
B
bellard 已提交
58
	make -C tests $@
59

B
bellard 已提交
60
TAGS: 
B
bellard 已提交
61
	etags *.[ch] tests/*.[ch]
62

B
bellard 已提交
63 64 65 66
# documentation
qemu-doc.html: qemu-doc.texi
	texi2html -monolithic -number $<

67 68 69 70
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

71
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
72

73
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
74 75
tar:
	rm -rf /tmp/$(FILE)
76
	cp -r . /tmp/$(FILE)
B
bellard 已提交
77
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
78 79
	rm -rf /tmp/$(FILE)

B
bellard 已提交
80
# generate a binary distribution
81
tarbin:
B
bellard 已提交
82 83 84 85 86
	( 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 已提交
87
        $(prefix)/bin/qemu-ppc \
B
bellard 已提交
88 89 90
	$(sharedir)/bios.bin \
	$(sharedir)/vgabios.bin \
	$(mandir)/man1/qemu.1 )
91

92 93 94
ifneq ($(wildcard .depend),)
include .depend
endif