]> git.proxmox.com Git - qemu.git/blame - Makefile
make lsl, lar verr and verw exception safe
[qemu.git] / Makefile
CommitLineData
8d5f07fa 1-include config-host.mak
766a487a 2
d5249393 3CFLAGS=-Wall -O2 -g -fno-strict-aliasing
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
acd935ef 14DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
aa05ae6f 15
8d5f07fa 16all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
626df76a 17 for d in $(TARGET_DIRS); do \
7d3505c5 18 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 19 done
e3086fbf
FB
20ifdef CONFIG_KQEMU
21 $(MAKE) -C kqemu
22endif
33e3963e 23
585d0ed9 24qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c
b932caba 25 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
47cea614 26
11d9f695
FB
27dyngen$(EXESUF): dyngen.c
28 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
31e31b8a
FB
29
30clean:
2d80ae89
FB
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
acd935ef 33 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
7d3505c5 34 $(MAKE) -C tests clean
626df76a 35 for d in $(TARGET_DIRS); do \
7d3505c5 36 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 37 done
e3086fbf
FB
38ifdef CONFIG_KQEMU
39 $(MAKE) -C kqemu clean
40endif
31e31b8a 41
7d13299d 42distclean: clean
c72a345f 43 rm -f config-host.mak config-host.h
76bc6838 44 for d in $(TARGET_DIRS); do \
bc1b050d 45 rm -rf $$d || exit 1 ; \
76bc6838 46 done
7d13299d 47
fed4a9ad
FB
48KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
49ar de en-us fi fr-be hr it lv nl pl ru th \
50common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
51
626df76a 52install: all
11d9f695 53 mkdir -p "$(bindir)"
11d9f695 54 install -m 755 -s $(TOOLS) "$(bindir)"
7efa4387 55 mkdir -p "$(datadir)"
a735aa31 56 install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
de9258a8 57 pc-bios/vgabios-cirrus.bin \
637f6cd7 58 pc-bios/ppc_rom.bin \
e80cfcfc 59 pc-bios/proll.elf \
7efa4387 60 pc-bios/linux_boot.bin "$(datadir)"
1f50f8d1
FB
61 mkdir -p "$(docdir)"
62 install -m 644 qemu-doc.html qemu-tech.html "$(docdir)"
11d9f695
FB
63ifndef CONFIG_WIN32
64 mkdir -p "$(mandir)/man1"
acd935ef 65 install qemu.1 qemu-img.1 "$(mandir)/man1"
3d11d0eb 66 mkdir -p "$(datadir)/keymaps"
fed4a9ad 67 install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
11d9f695 68endif
626df76a 69 for d in $(TARGET_DIRS); do \
7d3505c5 70 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 71 done
e3086fbf
FB
72ifdef CONFIG_KQEMU
73 cd kqemu ; ./install.sh
74endif
612384d7 75
367e86e8 76# various test targets
82c7e2a4 77test speed test2: all
7d3505c5 78 $(MAKE) -C tests $@
31e31b8a 79
367e86e8 80TAGS:
b9adb4a6 81 etags *.[ch] tests/*.[ch]
31e31b8a 82
3ef693a0 83# documentation
1f673135 84%.html: %.texi
3ef693a0
FB
85 texi2html -monolithic -number $<
86
5a67135a
FB
87qemu.1: qemu-doc.texi
88 ./texi2pod.pl $< qemu.pod
89 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
90
acd935ef
FB
91qemu-img.1: qemu-img.texi
92 ./texi2pod.pl $< qemu-img.pod
93 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
94
1e43adfc 95FILE=qemu-$(shell cat VERSION)
586314f2 96
1e43adfc 97# tar release (use 'make -k tar' on a checkouted tree)
586314f2
FB
98tar:
99 rm -rf /tmp/$(FILE)
1e43adfc 100 cp -r . /tmp/$(FILE)
76b62fd0 101 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
586314f2
FB
102 rm -rf /tmp/$(FILE)
103
76b62fd0 104# generate a binary distribution
d691f669 105tarbin:
76b62fd0 106 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
7efa4387
FB
107 $(bindir)/qemu $(bindir)/qemu-fast \
108 $(bindir)/qemu-system-ppc \
acd935ef 109 $(bindir)/qemu-system-sparc \
7efa4387
FB
110 $(bindir)/qemu-i386 \
111 $(bindir)/qemu-arm \
112 $(bindir)/qemu-sparc \
113 $(bindir)/qemu-ppc \
b932caba 114 $(bindir)/qemu-img \
7efa4387
FB
115 $(datadir)/bios.bin \
116 $(datadir)/vgabios.bin \
de9258a8 117 $(datadir)/vgabios-cirrus.bin \
637f6cd7 118 $(datadir)/ppc_rom.bin \
e80cfcfc 119 $(datadir)/proll.elf \
7efa4387 120 $(datadir)/linux_boot.bin \
1f50f8d1
FB
121 $(docdir)/qemu-doc.html \
122 $(docdir)/qemu-tech.html \
acd935ef 123 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
d691f669 124
31e31b8a
FB
125ifneq ($(wildcard .depend),)
126include .depend
127endif