ia64/xen-unstable

view tools/vtpm/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 b21261034a25
line source
1 XEN_ROOT = ../..
3 # Base definitions and rules
4 include $(XEN_ROOT)/tools/vtpm/Rules.mk
6 # Dir name for emulator (as dom0 tpm driver)
7 TPM_EMULATOR_DIR = tpm_emulator
8 # Dir name for vtpm instance
9 VTPM_DIR = vtpm
11 # Emulator tarball name
12 TPM_EMULATOR_TARFILE = tpm_emulator-0.2b.tar.gz
14 all: build
16 build: $(TPM_EMULATOR_DIR) $(VTPM_DIR) build_sub
18 install: build
19 $(MAKE) -C $(TPM_EMULATOR_DIR) $@
20 $(MAKE) -C $(VTPM_DIR) $@
22 clean:
23 if [ -d $(TPM_EMULATOR_DIR) ]; \
24 then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
25 fi
26 if [ -d $(VTPM_DIR) ]; \
27 then $(MAKE) -C $(VTPM_DIR) clean; \
28 fi
30 mrproper:
31 rm -f $(TPM_EMULATOR_TARFILE)
32 rm -rf $(TPM_EMULATOR_DIR)
33 rm -rf $(VTPM_DIR)
35 # Download Swiss emulator
36 $(TPM_EMULATOR_TARFILE):
37 wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
39 # Create vtpm and TPM emulator dirs
40 # apply patches for 1) used as dom0 tpm driver 2) used as vtpm device instance
41 $(TPM_EMULATOR_DIR): $(TPM_EMULATOR_TARFILE)
42 tar -xzf $(TPM_EMULATOR_TARFILE);
43 mv tpm_emulator-0.2 $(TPM_EMULATOR_DIR);
45 -cd $(TPM_EMULATOR_DIR); \
46 patch -p1 < ../tpm_emulator-0.2b-x86_64.patch; \
47 patch -p1 <../tpm_emulator.patch
49 $(VTPM_DIR): $(TPM_EMULATOR_TARFILE)
50 tar -xzf $(TPM_EMULATOR_TARFILE);
51 mv tpm_emulator-0.2 $(VTPM_DIR);
53 -cd $(VTPM_DIR); \
54 patch -p1 < ../tpm_emulator-0.2b-x86_64.patch; \
55 patch -p1 <../vtpm.patch
57 build_sub:
58 $(MAKE) -C $(TPM_EMULATOR_DIR)
59 $(MAKE) -C $(VTPM_DIR)