]> Git Repo - qemu.git/blame_incremental - Makefile
qcow2 is now used for '-snapshot' - keep BlockDriverState.total_sectors
[qemu.git] / Makefile
... / ...
CommitLineData
1# Makefile for QEMU.
2
3include config-host.mak
4
5.PHONY: all clean distclean dvi info install install-doc tar tarbin \
6 speed test test2 html dvi info
7
8CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
9ifdef CONFIG_DARWIN
10CFLAGS+= -mdynamic-no-pic
11endif
12ifeq ($(ARCH),sparc)
13CFLAGS+=-mcpu=ultrasparc
14endif
15LDFLAGS=-g
16LIBS=
17DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
18TOOLS=qemu-img$(EXESUF)
19ifdef CONFIG_STATIC
20LDFLAGS+=-static
21endif
22ifdef BUILD_DOCS
23DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
24else
25DOCS=
26endif
27
28ifndef CONFIG_DARWIN
29ifndef CONFIG_WIN32
30ifndef CONFIG_SOLARIS
31LIBS+=-lrt
32endif
33endif
34endif
35
36all: $(TOOLS) $(DOCS) recurse-all
37
38subdir-%: dyngen$(EXESUF)
39 $(MAKE) -C $(subst subdir-,,$@) all
40
41recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
42
43qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c
44 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
45
46dyngen$(EXESUF): dyngen.c
47 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
48
49clean:
50# avoid old build problems by removing potentially incorrect old files
51 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
52 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
53 $(MAKE) -C tests clean
54 for d in $(TARGET_DIRS); do \
55 $(MAKE) -C $$d $@ || exit 1 ; \
56 done
57
58distclean: clean
59 rm -f config-host.mak config-host.h $(DOCS)
60 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
61 for d in $(TARGET_DIRS); do \
62 rm -rf $$d || exit 1 ; \
63 done
64
65KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
66ar de en-us fi fr-be hr it lv nl pl ru th \
67common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
68
69install-doc: $(DOCS)
70 mkdir -p "$(DESTDIR)$(docdir)"
71 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
72ifndef CONFIG_WIN32
73 mkdir -p "$(DESTDIR)$(mandir)/man1"
74 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
75endif
76
77install: all $(if $(BUILD_DOCS),install-doc)
78 mkdir -p "$(DESTDIR)$(bindir)"
79 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
80 mkdir -p "$(DESTDIR)$(datadir)"
81 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
82 video.x openbios-sparc32 linux_boot.bin; do \
83 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
84 done
85ifndef CONFIG_WIN32
86 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
87 for x in $(KEYMAPS); do \
88 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
89 done
90endif
91 for d in $(TARGET_DIRS); do \
92 $(MAKE) -C $$d $@ || exit 1 ; \
93 done
94
95# various test targets
96test speed test2: all
97 $(MAKE) -C tests $@
98
99TAGS:
100 etags *.[ch] tests/*.[ch]
101
102cscope:
103 rm -f ./cscope.*
104 find . -name "*.[ch]" -print > ./cscope.files
105 cscope -b
106
107# documentation
108%.html: %.texi
109 texi2html -monolithic -number $<
110
111%.info: %.texi
112 makeinfo $< -o $@
113
114%.dvi: %.texi
115 texi2dvi $<
116
117qemu.1: qemu-doc.texi
118 $(SRC_PATH)/texi2pod.pl $< qemu.pod
119 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
120
121qemu-img.1: qemu-img.texi
122 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
123 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
124
125info: qemu-doc.info qemu-tech.info
126
127dvi: qemu-doc.dvi qemu-tech.dvi
128
129html: qemu-doc.html qemu-tech.html
130
131FILE=qemu-$(shell cat VERSION)
132
133# tar release (use 'make -k tar' on a checkouted tree)
134tar:
135 rm -rf /tmp/$(FILE)
136 cp -r . /tmp/$(FILE)
137 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
138 rm -rf /tmp/$(FILE)
139
140# generate a binary distribution
141tarbin:
142 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
143 $(bindir)/qemu \
144 $(bindir)/qemu-system-ppc \
145 $(bindir)/qemu-system-sparc \
146 $(bindir)/qemu-system-x86_64 \
147 $(bindir)/qemu-system-mips \
148 $(bindir)/qemu-system-mipsel \
149 $(bindir)/qemu-system-arm \
150 $(bindir)/qemu-i386 \
151 $(bindir)/qemu-arm \
152 $(bindir)/qemu-armeb \
153 $(bindir)/qemu-sparc \
154 $(bindir)/qemu-ppc \
155 $(bindir)/qemu-mips \
156 $(bindir)/qemu-mipsel \
157 $(bindir)/qemu-img \
158 $(datadir)/bios.bin \
159 $(datadir)/vgabios.bin \
160 $(datadir)/vgabios-cirrus.bin \
161 $(datadir)/ppc_rom.bin \
162 $(datadir)/video.x \
163 $(datadir)/openbios-sparc32 \
164 $(datadir)/linux_boot.bin \
165 $(docdir)/qemu-doc.html \
166 $(docdir)/qemu-tech.html \
167 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
168
169ifneq ($(wildcard .depend),)
170include .depend
171endif
This page took 0.021496 seconds and 4 git commands to generate.