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