]>
Commit | Line | Data |
---|---|---|
626df76a | 1 | include config-host.mak |
766a487a | 2 | |
7d13299d | 3 | CFLAGS=-Wall -O2 -g |
67b915a5 FB |
4 | ifdef CONFIG_WIN32 |
5 | CFLAGS+=-fpack-struct | |
6 | endif | |
31e31b8a | 7 | LDFLAGS=-g |
766a487a | 8 | LIBS= |
0ecfa993 | 9 | DEFINES+=-D_GNU_SOURCE |
67b915a5 | 10 | ifndef CONFIG_WIN32 |
47cea614 | 11 | TOOLS=qemu-mkcow vmdk2raw |
67b915a5 | 12 | endif |
1f50f8d1 FB |
13 | ifdef CONFIG_STATIC |
14 | LDFLAGS+=-static | |
15 | endif | |
aa05ae6f | 16 | |
1f673135 | 17 | all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1 |
626df76a | 18 | for d in $(TARGET_DIRS); do \ |
7d3505c5 | 19 | $(MAKE) -C $$d $@ || exit 1 ; \ |
626df76a | 20 | done |
33e3963e | 21 | |
11d9f695 | 22 | qemu-mkcow: qemu-mkcow.c |
1f50f8d1 | 23 | $(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS) |
de83cd02 | 24 | |
47cea614 FB |
25 | vmdk2raw: vmdk2raw.c |
26 | $(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS) | |
27 | ||
11d9f695 FB |
28 | dyngen$(EXESUF): dyngen.c |
29 | $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ | |
31e31b8a FB |
30 | |
31 | clean: | |
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 | |
67b915a5 | 34 | rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.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 | 40 | distclean: clean |
2d80ae89 | 41 | rm -f config-host.mak config-host.h |
76bc6838 | 42 | for d in $(TARGET_DIRS); do \ |
bc1b050d | 43 | rm -rf $$d || exit 1 ; \ |
76bc6838 | 44 | done |
7d13299d | 45 | |
626df76a | 46 | install: all |
11d9f695 FB |
47 | mkdir -p "$(bindir)" |
48 | ifndef CONFIG_WIN32 | |
49 | install -m 755 -s $(TOOLS) "$(bindir)" | |
50 | endif | |
7efa4387 | 51 | mkdir -p "$(datadir)" |
a735aa31 | 52 | install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \ |
de9258a8 | 53 | pc-bios/vgabios-cirrus.bin \ |
7efa4387 | 54 | pc-bios/linux_boot.bin "$(datadir)" |
1f50f8d1 FB |
55 | mkdir -p "$(docdir)" |
56 | install -m 644 qemu-doc.html qemu-tech.html "$(docdir)" | |
11d9f695 FB |
57 | ifndef CONFIG_WIN32 |
58 | mkdir -p "$(mandir)/man1" | |
59 | install qemu.1 qemu-mkcow.1 "$(mandir)/man1" | |
60 | endif | |
626df76a | 61 | for d in $(TARGET_DIRS); do \ |
7d3505c5 | 62 | $(MAKE) -C $$d $@ || exit 1 ; \ |
626df76a | 63 | done |
612384d7 | 64 | |
367e86e8 | 65 | # various test targets |
82c7e2a4 | 66 | test speed test2: all |
7d3505c5 | 67 | $(MAKE) -C tests $@ |
31e31b8a | 68 | |
367e86e8 | 69 | TAGS: |
b9adb4a6 | 70 | etags *.[ch] tests/*.[ch] |
31e31b8a | 71 | |
3ef693a0 | 72 | # documentation |
1f673135 | 73 | %.html: %.texi |
3ef693a0 FB |
74 | texi2html -monolithic -number $< |
75 | ||
5a67135a FB |
76 | qemu.1: qemu-doc.texi |
77 | ./texi2pod.pl $< qemu.pod | |
78 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@ | |
79 | ||
1e43adfc | 80 | FILE=qemu-$(shell cat VERSION) |
586314f2 | 81 | |
1e43adfc | 82 | # tar release (use 'make -k tar' on a checkouted tree) |
586314f2 FB |
83 | tar: |
84 | rm -rf /tmp/$(FILE) | |
1e43adfc | 85 | cp -r . /tmp/$(FILE) |
76b62fd0 | 86 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) |
586314f2 FB |
87 | rm -rf /tmp/$(FILE) |
88 | ||
76b62fd0 | 89 | # generate a binary distribution |
d691f669 | 90 | tarbin: |
76b62fd0 | 91 | ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ |
7efa4387 FB |
92 | $(bindir)/qemu $(bindir)/qemu-fast \ |
93 | $(bindir)/qemu-system-ppc \ | |
94 | $(bindir)/qemu-i386 \ | |
95 | $(bindir)/qemu-arm \ | |
96 | $(bindir)/qemu-sparc \ | |
97 | $(bindir)/qemu-ppc \ | |
47cea614 | 98 | $(bindir)/qemu-mkcow $(bindir)/vmdk2raw \ |
7efa4387 FB |
99 | $(datadir)/bios.bin \ |
100 | $(datadir)/vgabios.bin \ | |
de9258a8 | 101 | $(datadir)/vgabios-cirrus.bin \ |
7efa4387 | 102 | $(datadir)/linux_boot.bin \ |
1f50f8d1 FB |
103 | $(docdir)/qemu-doc.html \ |
104 | $(docdir)/qemu-tech.html \ | |
105 | $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 ) | |
d691f669 | 106 | |
31e31b8a FB |
107 | ifneq ($(wildcard .depend),) |
108 | include .depend | |
109 | endif |