source: trunk/packages/xen-3.1/xen-3.1/tools/ioemu/Makefile @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

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