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