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