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