3 include config-host.mak
5 .PHONY
: all clean distclean dvi info install install-doc
tar tarbin \
6 speed
test test2 html
dvi info
8 CFLAGS
=-Wall
-O2
-g
-fno-strict-aliasing
-I.
10 CFLAGS
+= -mdynamic-no-pic
14 DEFINES
+=-D_GNU_SOURCE
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
15 TOOLS
=qemu-img
$(EXESUF
)
20 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1
25 all: $(TOOLS
) $(DOCS
) recurse-all
27 subdir-
%: dyngen
$(EXESUF
)
28 $(MAKE
) -C
$(subst subdir-
,,$@
) all
30 recurse-all
: $(patsubst %,subdir-
%, $(TARGET_DIRS
))
32 qemu-img
$(EXESUF
): qemu-img.c block.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
33 $(CC
) -DQEMU_TOOL
$(CFLAGS
) $(LDFLAGS
) $(DEFINES
) -o
$@
$^
-lz
$(LIBS
)
35 dyngen
$(EXESUF
): dyngen.c
36 $(HOST_CC
) $(CFLAGS
) $(DEFINES
) -o
$@
$^
39 # avoid old build problems by removing potentially incorrect old files
40 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
41 rm -f
*.o
*.a
$(TOOLS
) dyngen
$(EXESUF
) TAGS
*.pod
*~
*/*~
42 $(MAKE
) -C tests
clean
43 for d in
$(TARGET_DIRS
); do \
44 $(MAKE
) -C
$$d $@ || exit
1 ; \
48 rm -f config-host.mak config-host.h
$(DOCS
)
49 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
50 for d in
$(TARGET_DIRS
); do \
51 rm -rf
$$d || exit
1 ; \
54 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
55 ar de en-us fi fr-be hr it lv nl pl ru th \
56 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
59 mkdir
-p
"$(DESTDIR)$(docdir)"
60 $(INSTALL
) -m
644 qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
62 mkdir
-p
"$(DESTDIR)$(mandir)/man1"
63 $(INSTALL
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
66 install: all $(if
$(BUILD_DOCS
),install-doc
)
67 mkdir
-p
"$(DESTDIR)$(bindir)"
68 $(INSTALL
) -m
755 -s
$(TOOLS
) "$(DESTDIR)$(bindir)"
69 mkdir
-p
"$(DESTDIR)$(datadir)"
70 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
71 video.x proll.elf linux_boot.bin
; do \
72 $(INSTALL
) -m
644 $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
75 mkdir
-p
"$(DESTDIR)$(datadir)/keymaps"
76 for x in
$(KEYMAPS
); do \
77 $(INSTALL
) -m
644 $(SRC_PATH
)/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
80 for d in
$(TARGET_DIRS
); do \
81 $(MAKE
) -C
$$d $@ || exit
1 ; \
84 # various test targets
89 etags
*.
[ch
] tests
/*.
[ch
]
93 find .
-name
"*.[ch]" -print > .
/cscope.files
98 texi2html
-monolithic
-number
$<
106 qemu
.1: qemu-doc.texi
107 $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
108 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
110 qemu-img
.1: qemu-img.texi
111 $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
112 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
114 info: qemu-doc.
info qemu-tech.
info
116 dvi: qemu-doc.
dvi qemu-tech.
dvi
118 html
: qemu-doc.html qemu-tech.html
120 FILE
=qemu-
$(shell cat VERSION
)
122 # tar release (use 'make -k tar' on a checkouted tree)
126 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
)
129 # generate a binary distribution
131 ( cd
/ ; tar zcvf ~
/qemu-
$(VERSION
)-i386.
tar.gz \
133 $(bindir)/qemu-system-ppc \
134 $(bindir)/qemu-system-sparc \
135 $(bindir)/qemu-system-x86_64 \
136 $(bindir)/qemu-system-mips \
137 $(bindir)/qemu-system-mipsel \
138 $(bindir)/qemu-system-arm \
139 $(bindir)/qemu-i386 \
141 $(bindir)/qemu-armeb \
142 $(bindir)/qemu-sparc \
144 $(bindir)/qemu-mips \
145 $(bindir)/qemu-mipsel \
147 $(datadir)/bios.bin \
148 $(datadir)/vgabios.bin \
149 $(datadir)/vgabios-cirrus.bin \
150 $(datadir)/ppc_rom.bin \
152 $(datadir)/proll.elf \
153 $(datadir)/linux_boot.bin \
154 $(docdir
)/qemu-doc.html \
155 $(docdir
)/qemu-tech.html \
156 $(mandir)/man1
/qemu
.1 $(mandir)/man1
/qemu-img
.1 )
158 ifneq ($(wildcard .depend
),)