-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
138 lines (109 loc) · 2.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright (c) 2006-2010, Intel Corporation
# All rights reserved.
# -*- mode: Makefile; -*-
#
# Grand Unified Makefile for tboot
#
# define ROOTDIR
export ROOTDIR=$(CURDIR)
# import global build config
include Config.mk
# (txt-test is not included because it requires pathing to Linux src)
SUBDIRS := tboot safestringlib lcptools lcptools-v2 tb_polgen utils docs
#
# build rules
#
#
# manifest
#
.PHONY: manifest
manifest : build
lcptools/lcp_mlehash tboot/tboot.gz > mle_file
lcptools/lcp_crtpol -t 0 -m mle_file -o policy_file
#
# install
#
install :
@set -e; for i in $(SUBDIRS); do \
$(MAKE) install-$$i; \
done
install-% :
$(MAKE) -C $* install
#
# build
#
build :
@set -e; for i in $(SUBDIRS); do \
$(MAKE) build-$$i; \
done
build-% :
$(MAKE) -C $* build
#
# dist
#
dist : $(patsubst %,dist-%,$(SUBDIRS))
[ -d $(DISTDIR) ] || $(INSTALL_DIR) $(DISTDIR)
$(INSTALL_DATA) COPYING $(DISTDIR)
$(INSTALL_DATA) README $(DISTDIR)
dist-% :
$(MAKE) -C $* dist
#
# world
#
# build tboot and tools, and place them in the install directory.
# 'make install' should then copy them to the normal system directories
.PHONY: world
world :
$(MAKE) clean
$(MAKE) dist
#
# clean
#
clean :
rm -f *~ include/*~ docs/*~
@set -e; for i in $(SUBDIRS); do \
$(MAKE) clean-$$i; \
done
clean-% :
$(MAKE) -C $* clean
#
# distclean
#
distclean :
@set -e; for i in $(SUBDIRS); do \
$(MAKE) distclean-$$i; \
done
distclean-% :
$(MAKE) -C $* distclean
#
# mrproper
#
# Linux name for GNU distclean
mrproper : distclean
#
# help
#
.PHONY: help
help :
@echo 'Installation targets:'
@echo ' install - build and install everything'
@echo ' install-* - build and install the * module'
@echo ''
@echo 'Building targets:'
@echo ' dist - build and install everything into local dist directory'
@echo ' world - clean everything'
@echo ''
@echo 'Cleaning targets:'
@echo ' clean - clean tboot and tools'
@echo ' distclean - clean and local downloaded files'
@echo ''
@echo ' uninstall - attempt to remove installed tools'
@echo ' (use with extreme care!)'
#
# uninstall
#
# Use this target with extreme care!
.PHONY: uninstall
uninstall : D=$(DESTDIR)
uninstall :
rm -rf $(D)/boot/tboot*