Statistics
| Branch: | Revision:

root / Makefile @ 0986ac3b

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