Statistics
| Branch: | Revision:

root / Makefile @ 57be54bb

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