ia64/xen-unstable

view tools/ioemu/Makefile @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents d44caae57112
children e5aba4f62131
line source
1 -include config-host.mak
3 CFLAGS=-Wall -O2 -g -fno-strict-aliasing
4 ifdef CONFIG_DARWIN
5 CFLAGS+= -mdynamic-no-pic
6 endif
7 ifdef CONFIG_WIN32
8 CFLAGS+=-fpack-struct
9 endif
10 LDFLAGS=-g
11 LIBS=
12 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
13 TOOLS=qemu-img
14 ifdef CONFIG_STATIC
15 LDFLAGS+=-static
16 endif
17 #DOCS=qemu-doc.html qemu-tech.html qemu.1
19 all: $(DOCS) HEADERS
20 for d in $(TARGET_DIRS); do \
21 $(MAKE) -C $$d $@ || exit 1 ; \
22 done
24 qemu-img: qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c
25 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
27 dyngen$(EXESUF): dyngen.c
28 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
30 clean:
31 # avoid old build problems by removing potentially incorrect old files
32 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
33 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod *~ */*~
34 #$(MAKE) -C tests clean
35 for d in $(TARGET_DIRS); do \
36 $(MAKE) -C $$d $@ || exit 1 ; \
37 done
38 rm -f config-host.mak config-host.h
39 rm -f keysym_adapter_sdl.h keysym_adapter_vnc.h
41 distclean: clean
42 rm -f config-host.mak config-host.h
43 rm -f keysym_adapter_sdl.h keysym_adapter_vnc.h
44 for d in $(TARGET_DIRS); do \
45 $(MAKE) -C $$d $@ || exit 1 ; \
46 done
48 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
49 ar de en-us fi fr-be hr it lv nl pl ru th \
50 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
52 install: all
53 mkdir -p "$(bindir)"
54 mkdir -p "$(DESTDIR)/$(datadir)"
55 mkdir -p "$(DESTDIR)/$(datadir)/keymaps"
56 install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(DESTDIR)/$(datadir)/keymaps"
57 for d in $(TARGET_DIRS); do \
58 $(MAKE) -C $$d $@ || exit 1 ; \
59 done
61 # various test targets
62 test speed test2: all
63 $(MAKE) -C tests $@
65 TAGS:
66 etags *.[ch] tests/*.[ch]
68 # documentation
69 %.html: %.texi
70 texi2html -monolithic -number $<
72 qemu.1: qemu-doc.texi
73 ./texi2pod.pl $< qemu.pod
74 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
76 FILE=qemu-$(shell cat VERSION)
78 # tar release (use 'make -k tar' on a checkouted tree)
79 tar:
80 rm -rf /tmp/$(FILE)
81 cp -r . /tmp/$(FILE)
82 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
83 rm -rf /tmp/$(FILE)
85 # generate a binary distribution
86 tarbin:
87 ( cd $(DESTDIR) ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
88 $(DESTDIR)/$(bindir)/qemu $(DESTDIR)/$(bindir)/qemu-fast \
89 $(DESTDIR)/$(bindir)/qemu-system-ppc \
90 $(DESTDIR)/$(bindir)/qemu-i386 \
91 $(DESTDIR)/$(bindir)/qemu-arm \
92 $(DESTDIR)/$(bindir)/qemu-sparc \
93 $(DESTDIR)/$(bindir)/qemu-ppc \
94 $(DESTDIR)/$(mandir)/man1/qemu.1 $(DESTDIR)/$(mandir)/man1/qemu-mkcow.1 )
96 ifneq ($(wildcard .depend),)
97 include .depend
98 endif
100 HEADERS:
102 ifdef CONFIG_SDL
103 HEADERS: keysym_adapter_sdl.h
104 endif
106 ifdef CONFIG_VNC
107 HEADERS: keysym_adapter_vnc.h
108 endif
110 keysym_adapter_sdl.h: Makefile create_keysym_header.sh
111 sh create_keysym_header.sh sdl "$(SDL_CFLAGS)"
113 keysym_adapter_vnc.h: Makefile create_keysym_header.sh
114 sh create_keysym_header.sh vnc "$(VNC_CFLAGS)"