ia64/xen-unstable

view tools/xcutils/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 06d84bf87159
children 903d88857972
line source
1 #
2 # tools/xcutils/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General
5 # Public License. See the file "COPYING" in the main directory of
6 # this archive for more details.
7 #
8 # Copyright (C) 2005 by Christian Limpach
9 #
11 INSTALL = install
12 INSTALL_PROG = $(INSTALL) -m0755
13 INSTALL_DIR = $(INSTALL) -d -m0755
15 XEN_ROOT = ../..
16 include $(XEN_ROOT)/tools/Rules.mk
18 PROGRAMS_INSTALL_DIR = /usr/libexec/xen
20 INCLUDES += -I $(XEN_LIBXC)
22 CFLAGS += -Wall -Werror -O3 -fno-strict-aliasing
23 CFLAGS += $(INCLUDES)
25 # Make gcc generate dependencies.
26 CFLAGS += -Wp,-MD,.$(@F).d
27 PROG_DEP = .*.d
29 PROGRAMS = xc_restore xc_save
31 LDLIBS = -L$(XEN_LIBXC) -lxenguest -lxenctrl
33 .PHONY: all
34 all: build
35 build: $(PROGRAMS)
37 $(PROGRAMS): %: %.o
38 $(LINK.o) $^ $(LDLIBS) -o $@
40 .PHONY: install
41 install: build
42 [ -d $(DESTDIR)$(PROGRAMS_INSTALL_DIR) ] || \
43 $(INSTALL_DIR) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)
44 $(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(PROGRAMS_INSTALL_DIR)
47 clean:
48 $(RM) *.o $(PROGRAMS)
49 $(RM) $(PROG_DEP)
51 -include $(PROG_DEP)