]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile
win32 socket fixes
[mirror_qemu.git] / Makefile
CommitLineData
ad064840 1include config-host.mak
766a487a 2
ad064840 3CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
83fb7adf
FB
4ifdef CONFIG_DARWIN
5CFLAGS+= -mdynamic-no-pic
6endif
31e31b8a 7LDFLAGS=-g
766a487a 8LIBS=
d5249393 9DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
e35c55fe 10TOOLS=qemu-img$(EXESUF)
1f50f8d1
FB
11ifdef CONFIG_STATIC
12LDFLAGS+=-static
13endif
cc8ae6de 14ifdef BUILD_DOCS
acd935ef 15DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
cc8ae6de
PB
16else
17DOCS=
18endif
aa05ae6f 19
8d5f07fa 20all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
626df76a 21 for d in $(TARGET_DIRS); do \
7d3505c5 22 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 23 done
33e3963e 24
de167e41 25qemu-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
b932caba 26 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
47cea614 27
11d9f695
FB
28dyngen$(EXESUF): dyngen.c
29 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
31e31b8a
FB
30
31clean:
2d80ae89
FB
32# avoid old build problems by removing potentially incorrect old files
33 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
acd935ef 34 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
7d3505c5 35 $(MAKE) -C tests clean
626df76a 36 for d in $(TARGET_DIRS); do \
7d3505c5 37 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 38 done
31e31b8a 39
7d13299d 40distclean: clean
cc8ae6de 41 rm -f config-host.mak config-host.h $(DOCS)
76bc6838 42 for d in $(TARGET_DIRS); do \
bc1b050d 43 rm -rf $$d || exit 1 ; \
76bc6838 44 done
7d13299d 45
fed4a9ad
FB
46KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
47ar de en-us fi fr-be hr it lv nl pl ru th \
48common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
49
626df76a 50install: all
1236cab7 51 mkdir -p "$(DESTDIR)$(bindir)"
6a882643 52 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
1236cab7 53 mkdir -p "$(DESTDIR)$(datadir)"
ad064840
PB
54 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
55 video.x proll.elf linux_boot.bin; do \
6a882643 56 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
ad064840 57 done
1236cab7 58 mkdir -p "$(DESTDIR)$(docdir)"
6a882643 59 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
11d9f695 60ifndef CONFIG_WIN32
1236cab7 61 mkdir -p "$(DESTDIR)$(mandir)/man1"
6a882643 62 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
1236cab7 63 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
ad064840 64 for x in $(KEYMAPS); do \
6a882643 65 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
ad064840 66 done
11d9f695 67endif
626df76a 68 for d in $(TARGET_DIRS); do \
7d3505c5 69 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 70 done
612384d7 71
367e86e8 72# various test targets
82c7e2a4 73test speed test2: all
7d3505c5 74 $(MAKE) -C tests $@
31e31b8a 75
367e86e8 76TAGS:
b9adb4a6 77 etags *.[ch] tests/*.[ch]
31e31b8a 78
6688bc6d
FB
79cscope:
80 rm -f ./cscope.*
81 find . -name "*.[ch]" -print > ./cscope.files
82 cscope -b
83
3ef693a0 84# documentation
1f673135 85%.html: %.texi
3ef693a0
FB
86 texi2html -monolithic -number $<
87
f3548328
FB
88%.info: %.texi
89 makeinfo $< -o $@
90
91%.dvi: %.texi
92 texi2dvi $<
93
5a67135a 94qemu.1: qemu-doc.texi
ad064840 95 $(SRC_PATH)/texi2pod.pl $< qemu.pod
5a67135a
FB
96 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
97
acd935ef 98qemu-img.1: qemu-img.texi
ad064840 99 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
acd935ef
FB
100 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
101
1e43adfc 102FILE=qemu-$(shell cat VERSION)
586314f2 103
1e43adfc 104# tar release (use 'make -k tar' on a checkouted tree)
586314f2
FB
105tar:
106 rm -rf /tmp/$(FILE)
1e43adfc 107 cp -r . /tmp/$(FILE)
76b62fd0 108 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
586314f2
FB
109 rm -rf /tmp/$(FILE)
110
76b62fd0 111# generate a binary distribution
d691f669 112tarbin:
76b62fd0 113 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
43095f31 114 $(bindir)/qemu \
7efa4387 115 $(bindir)/qemu-system-ppc \
acd935ef 116 $(bindir)/qemu-system-sparc \
43095f31 117 $(bindir)/qemu-system-x86_64 \
93856aac 118 $(bindir)/qemu-system-mips \
38260998 119 $(bindir)/qemu-system-mipsel \
ea31eb5b 120 $(bindir)/qemu-system-arm \
7efa4387
FB
121 $(bindir)/qemu-i386 \
122 $(bindir)/qemu-arm \
ea31eb5b 123 $(bindir)/qemu-armeb \
7efa4387
FB
124 $(bindir)/qemu-sparc \
125 $(bindir)/qemu-ppc \
ea31eb5b
FB
126 $(bindir)/qemu-mips \
127 $(bindir)/qemu-mipsel \
b932caba 128 $(bindir)/qemu-img \
7efa4387
FB
129 $(datadir)/bios.bin \
130 $(datadir)/vgabios.bin \
de9258a8 131 $(datadir)/vgabios-cirrus.bin \
637f6cd7 132 $(datadir)/ppc_rom.bin \
d5295253 133 $(datadir)/video.x \
e80cfcfc 134 $(datadir)/proll.elf \
7efa4387 135 $(datadir)/linux_boot.bin \
1f50f8d1
FB
136 $(docdir)/qemu-doc.html \
137 $(docdir)/qemu-tech.html \
acd935ef 138 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
d691f669 139
31e31b8a
FB
140ifneq ($(wildcard .depend),)
141include .depend
142endif