|
|
1.1.1.4 root 1: # Makefile for QEMU.
2:
1.1.1.3 root 3: include config-host.mak
1.1 root 4:
1.1.1.4 root 5: .PHONY: all clean distclean dvi info install install-doc tar tarbin \
6: speed test test2 html dvi info
7:
1.1.1.5 ! root 8: BASE_CFLAGS=
! 9: BASE_LDFLAGS=
! 10:
! 11: BASE_CFLAGS += $(OS_CFLAGS)
1.1.1.4 root 12: ifeq ($(ARCH),sparc)
1.1.1.5 ! root 13: BASE_CFLAGS += -mcpu=ultrasparc
1.1.1.4 root 14: endif
1.1.1.5 ! root 15: CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
1.1 root 16: LIBS=
17: TOOLS=qemu-img$(EXESUF)
18: ifdef CONFIG_STATIC
1.1.1.5 ! root 19: BASE_LDFLAGS += -static
1.1 root 20: endif
1.1.1.3 root 21: ifdef BUILD_DOCS
1.1 root 22: DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
1.1.1.3 root 23: else
24: DOCS=
25: endif
1.1 root 26:
1.1.1.5 ! root 27: ifndef CONFIG_DARWIN
! 28: ifndef CONFIG_WIN32
! 29: ifndef CONFIG_SOLARIS
! 30: LIBS+=-lrt
! 31: endif
! 32: endif
! 33: endif
! 34:
1.1.1.4 root 35: all: $(TOOLS) $(DOCS) recurse-all
36:
37: subdir-%: dyngen$(EXESUF)
38: $(MAKE) -C $(subst subdir-,,$@) all
1.1 root 39:
1.1.1.4 root 40: recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
1.1.1.5 ! root 41:
! 42: 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: $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
1.1 root 44:
45: dyngen$(EXESUF): dyngen.c
1.1.1.5 ! root 46: $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
1.1 root 47:
48: clean:
49: # avoid old build problems by removing potentially incorrect old files
50: 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: rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
52: $(MAKE) -C tests clean
53: for d in $(TARGET_DIRS); do \
54: $(MAKE) -C $$d $@ || exit 1 ; \
55: done
56:
57: distclean: clean
1.1.1.3 root 58: rm -f config-host.mak config-host.h $(DOCS)
1.1.1.4 root 59: rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
1.1 root 60: for d in $(TARGET_DIRS); do \
61: rm -rf $$d || exit 1 ; \
62: done
63:
64: KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
65: ar de en-us fi fr-be hr it lv nl pl ru th \
66: common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
67:
1.1.1.3 root 68: install-doc: $(DOCS)
69: mkdir -p "$(DESTDIR)$(docdir)"
70: $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
1.1 root 71: ifndef CONFIG_WIN32
1.1.1.3 root 72: mkdir -p "$(DESTDIR)$(mandir)/man1"
73: $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
74: endif
75:
76: install: all $(if $(BUILD_DOCS),install-doc)
77: mkdir -p "$(DESTDIR)$(bindir)"
78: $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
79: mkdir -p "$(DESTDIR)$(datadir)"
80: for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
1.1.1.5 ! root 81: video.x openbios-sparc32 linux_boot.bin pxe-ne2k_pci.bin \
! 82: pxe-rtl8139.bin pxe-pcnet.bin; do \
1.1.1.3 root 83: $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
84: done
85: ifndef CONFIG_WIN32
86: mkdir -p "$(DESTDIR)$(datadir)/keymaps"
87: for x in $(KEYMAPS); do \
88: $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
89: done
1.1 root 90: endif
91: for d in $(TARGET_DIRS); do \
92: $(MAKE) -C $$d $@ || exit 1 ; \
93: done
94:
95: # various test targets
96: test speed test2: all
97: $(MAKE) -C tests $@
98:
99: TAGS:
100: etags *.[ch] tests/*.[ch]
101:
102: cscope:
103: rm -f ./cscope.*
104: find . -name "*.[ch]" -print > ./cscope.files
105: cscope -b
106:
107: # documentation
108: %.html: %.texi
109: texi2html -monolithic -number $<
110:
1.1.1.3 root 111: %.info: %.texi
112: makeinfo $< -o $@
113:
114: %.dvi: %.texi
115: texi2dvi $<
116:
1.1 root 117: qemu.1: qemu-doc.texi
1.1.1.3 root 118: $(SRC_PATH)/texi2pod.pl $< qemu.pod
1.1 root 119: pod2man --section=1 --center=" " --release=" " qemu.pod > $@
120:
121: qemu-img.1: qemu-img.texi
1.1.1.3 root 122: $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
1.1 root 123: pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
124:
1.1.1.4 root 125: info: qemu-doc.info qemu-tech.info
126:
127: dvi: qemu-doc.dvi qemu-tech.dvi
128:
129: html: qemu-doc.html qemu-tech.html
130:
1.1.1.5 ! root 131: VERSION ?= $(shell cat VERSION)
! 132: FILE = qemu-$(VERSION)
1.1 root 133:
134: # tar release (use 'make -k tar' on a checkouted tree)
135: tar:
136: rm -rf /tmp/$(FILE)
137: cp -r . /tmp/$(FILE)
138: ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
139: rm -rf /tmp/$(FILE)
140:
141: # generate a binary distribution
142: tarbin:
143: ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
144: $(bindir)/qemu \
145: $(bindir)/qemu-system-ppc \
146: $(bindir)/qemu-system-sparc \
147: $(bindir)/qemu-system-x86_64 \
148: $(bindir)/qemu-system-mips \
1.1.1.3 root 149: $(bindir)/qemu-system-mipsel \
1.1.1.2 root 150: $(bindir)/qemu-system-arm \
1.1 root 151: $(bindir)/qemu-i386 \
152: $(bindir)/qemu-arm \
1.1.1.2 root 153: $(bindir)/qemu-armeb \
1.1 root 154: $(bindir)/qemu-sparc \
155: $(bindir)/qemu-ppc \
1.1.1.2 root 156: $(bindir)/qemu-mips \
157: $(bindir)/qemu-mipsel \
1.1 root 158: $(bindir)/qemu-img \
159: $(datadir)/bios.bin \
160: $(datadir)/vgabios.bin \
161: $(datadir)/vgabios-cirrus.bin \
162: $(datadir)/ppc_rom.bin \
163: $(datadir)/video.x \
1.1.1.4 root 164: $(datadir)/openbios-sparc32 \
1.1 root 165: $(datadir)/linux_boot.bin \
1.1.1.5 ! root 166: $(datadir)/pxe-ne2k_pci.bin \
! 167: $(datadir)/pxe-rtl8139.bin \
! 168: $(datadir)/pxe-pcnet.bin \
1.1 root 169: $(docdir)/qemu-doc.html \
170: $(docdir)/qemu-tech.html \
171: $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
172:
173: ifneq ($(wildcard .depend),)
174: include .depend
175: endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.