]> git.proxmox.com Git - qemu.git/blob - Makefile
c431acd18fe1fc4fa7af257c1b7eba6240195d2a
[qemu.git] / Makefile
1 -include config-host.mak
2
3 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
4 ifdef CONFIG_DARWIN
5 CFLAGS+= -mdynamic-no-pic
6 endif
7 ifdef CONFIG_WIN32
8 CFLAGS+=-fpack-struct
9 endif
10 LDFLAGS=-g
11 LIBS=
12 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
13 TOOLS=qemu-img$(EXESUF)
14 ifdef CONFIG_STATIC
15 LDFLAGS+=-static
16 endif
17 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
18
19 all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
20 for d in $(TARGET_DIRS); do \
21 $(MAKE) -C $$d $@ || exit 1 ; \
22 done
23
24 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
25 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
26
27 dyngen$(EXESUF): dyngen.c
28 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
29
30 clean:
31 # avoid old build problems by removing potentially incorrect old files
32 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
33 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
34 $(MAKE) -C tests clean
35 for d in $(TARGET_DIRS); do \
36 $(MAKE) -C $$d $@ || exit 1 ; \
37 done
38
39 distclean: clean
40 rm -f config-host.mak config-host.h
41 for d in $(TARGET_DIRS); do \
42 rm -rf $$d || exit 1 ; \
43 done
44
45 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
46 ar de en-us fi fr-be hr it lv nl pl ru th \
47 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
48
49 install: all
50 mkdir -p "$(bindir)"
51 install -m 755 -s $(TOOLS) "$(bindir)"
52 mkdir -p "$(datadir)"
53 install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
54 pc-bios/vgabios-cirrus.bin \
55 pc-bios/ppc_rom.bin \
56 pc-bios/proll.bin \
57 pc-bios/linux_boot.bin "$(datadir)"
58 mkdir -p "$(docdir)"
59 install -m 644 qemu-doc.html qemu-tech.html "$(docdir)"
60 ifndef CONFIG_WIN32
61 mkdir -p "$(mandir)/man1"
62 install qemu.1 qemu-img.1 "$(mandir)/man1"
63 mkdir -p "$(datadir)/keymaps"
64 install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
65 endif
66 for d in $(TARGET_DIRS); do \
67 $(MAKE) -C $$d $@ || exit 1 ; \
68 done
69
70 # various test targets
71 test speed test2: all
72 $(MAKE) -C tests $@
73
74 TAGS:
75 etags *.[ch] tests/*.[ch]
76
77 # documentation
78 %.html: %.texi
79 texi2html -monolithic -number $<
80
81 qemu.1: qemu-doc.texi
82 ./texi2pod.pl $< qemu.pod
83 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
84
85 qemu-img.1: qemu-img.texi
86 ./texi2pod.pl $< qemu-img.pod
87 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
88
89 FILE=qemu-$(shell cat VERSION)
90
91 # tar release (use 'make -k tar' on a checkouted tree)
92 tar:
93 rm -rf /tmp/$(FILE)
94 cp -r . /tmp/$(FILE)
95 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
96 rm -rf /tmp/$(FILE)
97
98 # generate a binary distribution
99 tarbin:
100 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
101 $(bindir)/qemu $(bindir)/qemu-fast \
102 $(bindir)/qemu-system-ppc \
103 $(bindir)/qemu-system-sparc \
104 $(bindir)/qemu-i386 \
105 $(bindir)/qemu-arm \
106 $(bindir)/qemu-sparc \
107 $(bindir)/qemu-ppc \
108 $(bindir)/qemu-img \
109 $(datadir)/bios.bin \
110 $(datadir)/vgabios.bin \
111 $(datadir)/vgabios-cirrus.bin \
112 $(datadir)/ppc_rom.bin \
113 $(datadir)/proll.bin \
114 $(datadir)/linux_boot.bin \
115 $(docdir)/qemu-doc.html \
116 $(docdir)/qemu-tech.html \
117 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
118
119 ifneq ($(wildcard .depend),)
120 include .depend
121 endif