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