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