debuggers.hg

view tools/vtpm/Makefile @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 4e67ba3c321a
children
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
10 ORIG_DIR = orig
12 # Emulator tarball name
13 TPM_EMULATOR_NAME = tpm_emulator-0.5.1
14 TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
16 GMP_HEADER = /usr/include/gmp.h
18 .PHONY: all
19 all: build
21 .PHONY: build
22 build: build_sub
24 .PHONY: install
25 install: build
26 $(MAKE) -C $(VTPM_DIR) $@
28 .PHONY: clean
29 clean:
30 @if [ -d $(TPM_EMULATOR_DIR) ]; \
31 then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
32 fi
33 @if [ -d $(VTPM_DIR) ]; \
34 then $(MAKE) -C $(VTPM_DIR) clean; \
35 fi
37 .PHONY: mrproper
38 mrproper:
39 rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
40 rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
42 # Download Swiss emulator
43 $(TPM_EMULATOR_TARFILE):
44 wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
46 # Create vtpm dirs
47 $(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
48 rm -rf $(VTPM_DIR)
49 tar -xzf $(TPM_EMULATOR_TARFILE)
50 mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
52 set -e; cd $(VTPM_DIR); \
53 patch -p1 < ../vtpm-0.5.1.patch
55 orig: $(TPM_EMULATOR_TARFILE)
56 mkdir $(ORIG_DIR);
57 set -e; cd $(ORIG_DIR); \
58 tar -xzf ../$(TPM_EMULATOR_TARFILE);
60 updatepatches: clean orig
61 find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
62 mv vtpm.patch vtpm.patch.old;
63 diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
65 .PHONY: build_sub
66 build_sub: $(VTPM_DIR)/tpmd/tpmd
67 set -e; if [ -e $(GMP_HEADER) ]; then \
68 $(MAKE) -C $(VTPM_DIR); \
69 else \
70 echo "=== Unable to build VTPMs. libgmp could not be found."; \
71 fi