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