Makefile 2.5 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 vmdk2raw
B
bellard 已提交
12
endif
B
bellard 已提交
13 14 15
ifdef CONFIG_STATIC
LDFLAGS+=-static
endif
B
bellard 已提交
16

B
bellard 已提交
17
all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
B
bellard 已提交
18
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
19
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
20
        done
21

B
bellard 已提交
22
qemu-mkcow: qemu-mkcow.c
B
bellard 已提交
23
	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
B
bellard 已提交
24

25 26 27
vmdk2raw: vmdk2raw.c
	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)

B
bellard 已提交
28 29
dyngen$(EXESUF): dyngen.c
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
30 31

clean:
32 33
# 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 已提交
34
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
B
bellard 已提交
35
	$(MAKE) -C tests clean
B
bellard 已提交
36
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
37
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
38
        done
39

B
bellard 已提交
40
distclean: clean
41
	rm -f config-host.mak config-host.h
B
updated  
bellard 已提交
42
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
43
	rm -rf $$d || exit 1 ; \
B
updated  
bellard 已提交
44
        done
B
bellard 已提交
45

B
bellard 已提交
46
install: all 
B
bellard 已提交
47 48 49 50
	mkdir -p "$(bindir)"
ifndef CONFIG_WIN32
	install -m 755 -s $(TOOLS) "$(bindir)"
endif
B
bellard 已提交
51
	mkdir -p "$(datadir)"
B
bellard 已提交
52
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
B
bellard 已提交
53
                       pc-bios/linux_boot.bin "$(datadir)"
B
bellard 已提交
54 55
	mkdir -p "$(docdir)"
	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
B
bellard 已提交
56 57 58 59
ifndef CONFIG_WIN32
	mkdir -p "$(mandir)/man1"
	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
endif
B
bellard 已提交
60
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
61
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
62
        done
B
bellard 已提交
63

B
bellard 已提交
64
# various test targets
B
update  
bellard 已提交
65
test speed test2: all
B
bellard 已提交
66
	$(MAKE) -C tests $@
67

B
bellard 已提交
68
TAGS: 
B
bellard 已提交
69
	etags *.[ch] tests/*.[ch]
70

B
bellard 已提交
71
# documentation
B
bellard 已提交
72
%.html: %.texi
B
bellard 已提交
73 74
	texi2html -monolithic -number $<

75 76 77 78
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

79
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
80

81
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
82 83
tar:
	rm -rf /tmp/$(FILE)
84
	cp -r . /tmp/$(FILE)
B
bellard 已提交
85
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
86 87
	rm -rf /tmp/$(FILE)

B
bellard 已提交
88
# generate a binary distribution
89
tarbin:
B
bellard 已提交
90
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
B
bellard 已提交
91 92 93 94 95 96
	$(bindir)/qemu $(bindir)/qemu-fast \
	$(bindir)/qemu-system-ppc \
	$(bindir)/qemu-i386 \
        $(bindir)/qemu-arm \
        $(bindir)/qemu-sparc \
        $(bindir)/qemu-ppc \
97
        $(bindir)/qemu-mkcow $(bindir)/vmdk2raw \
B
bellard 已提交
98 99 100
	$(datadir)/bios.bin \
	$(datadir)/vgabios.bin \
	$(datadir)/linux_boot.bin \
B
bellard 已提交
101 102 103
	$(docdir)/qemu-doc.html \
	$(docdir)/qemu-tech.html \
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 )
104

105 106 107
ifneq ($(wildcard .depend),)
include .depend
endif