]>
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 |
1e43adfc | 11 | TOOLS=qemu-mkcow |
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 FB |
18 | for d in $(TARGET_DIRS); do \ |
19 | make -C $$d $@ || exit 1 ; \ | |
20 | done | |
33e3963e | 21 | |
11d9f695 | 22 | qemu-mkcow: qemu-mkcow.c |
1f50f8d1 | 23 | $(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS) |
de83cd02 | 24 | |
11d9f695 FB |
25 | dyngen$(EXESUF): dyngen.c |
26 | $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ | |
31e31b8a FB |
27 | |
28 | clean: | |
2d80ae89 FB |
29 | # avoid old build problems by removing potentially incorrect old files |
30 | 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 | 31 | rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod |
68e73e39 | 32 | make -C tests clean |
626df76a FB |
33 | for d in $(TARGET_DIRS); do \ |
34 | make -C $$d $@ || exit 1 ; \ | |
35 | done | |
31e31b8a | 36 | |
7d13299d | 37 | distclean: clean |
2d80ae89 | 38 | rm -f config-host.mak config-host.h |
76bc6838 | 39 | for d in $(TARGET_DIRS); do \ |
bc1b050d | 40 | rm -rf $$d || exit 1 ; \ |
76bc6838 | 41 | done |
7d13299d | 42 | |
626df76a | 43 | install: all |
11d9f695 FB |
44 | mkdir -p "$(bindir)" |
45 | ifndef CONFIG_WIN32 | |
46 | install -m 755 -s $(TOOLS) "$(bindir)" | |
47 | endif | |
48 | mkdir -p "$(sharedir)" | |
a735aa31 | 49 | install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \ |
11d9f695 | 50 | pc-bios/linux_boot.bin "$(sharedir)" |
1f50f8d1 FB |
51 | mkdir -p "$(docdir)" |
52 | install -m 644 qemu-doc.html qemu-tech.html "$(docdir)" | |
11d9f695 FB |
53 | ifndef CONFIG_WIN32 |
54 | mkdir -p "$(mandir)/man1" | |
55 | install qemu.1 qemu-mkcow.1 "$(mandir)/man1" | |
56 | endif | |
626df76a FB |
57 | for d in $(TARGET_DIRS); do \ |
58 | make -C $$d $@ || exit 1 ; \ | |
59 | done | |
612384d7 | 60 | |
367e86e8 | 61 | # various test targets |
82c7e2a4 | 62 | test speed test2: all |
367e86e8 | 63 | make -C tests $@ |
31e31b8a | 64 | |
367e86e8 | 65 | TAGS: |
b9adb4a6 | 66 | etags *.[ch] tests/*.[ch] |
31e31b8a | 67 | |
3ef693a0 | 68 | # documentation |
1f673135 | 69 | %.html: %.texi |
3ef693a0 FB |
70 | texi2html -monolithic -number $< |
71 | ||
5a67135a FB |
72 | qemu.1: qemu-doc.texi |
73 | ./texi2pod.pl $< qemu.pod | |
74 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@ | |
75 | ||
1e43adfc | 76 | FILE=qemu-$(shell cat VERSION) |
586314f2 | 77 | |
1e43adfc | 78 | # tar release (use 'make -k tar' on a checkouted tree) |
586314f2 FB |
79 | tar: |
80 | rm -rf /tmp/$(FILE) | |
1e43adfc | 81 | cp -r . /tmp/$(FILE) |
76b62fd0 | 82 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) |
586314f2 FB |
83 | rm -rf /tmp/$(FILE) |
84 | ||
76b62fd0 | 85 | # generate a binary distribution |
d691f669 | 86 | tarbin: |
76b62fd0 FB |
87 | ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ |
88 | $(prefix)/bin/qemu $(prefix)/bin/qemu-fast \ | |
bbc9d348 | 89 | $(prefix)/bin/qemu-system-ppc \ |
76b62fd0 FB |
90 | $(prefix)/bin/qemu-i386 \ |
91 | $(prefix)/bin/qemu-arm \ | |
92 | $(prefix)/bin/qemu-sparc \ | |
c0637b37 | 93 | $(prefix)/bin/qemu-ppc \ |
1f50f8d1 | 94 | $(prefix)/bin/qemu-mkcow \ |
76b62fd0 FB |
95 | $(sharedir)/bios.bin \ |
96 | $(sharedir)/vgabios.bin \ | |
1f50f8d1 FB |
97 | $(sharedir)/linux_boot.bin \ |
98 | $(docdir)/qemu-doc.html \ | |
99 | $(docdir)/qemu-tech.html \ | |
100 | $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 ) | |
d691f669 | 101 | |
31e31b8a FB |
102 | ifneq ($(wildcard .depend),) |
103 | include .depend | |
104 | endif |