-
Notifications
You must be signed in to change notification settings - Fork 57
/
GNUmakefile
49 lines (40 loc) · 1.33 KB
/
GNUmakefile
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
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 Keylime Authors
RELEASE ?= 0
TARGETDIR ?= target
CONFFILE ?= ./keylime-agent.conf
ifeq ($(RELEASE),1)
PROFILE ?= release
CARGO_ARGS = --release
else
PROFILE ?= debug
CARGO_ARGS =
endif
systemdsystemunitdir := $(shell pkg-config systemd --variable=systemdsystemunitdir)
programs = \
${TARGETDIR}/${PROFILE}/keylime_agent \
${TARGETDIR}/${PROFILE}/keylime_ima_emulator
.PHONY: all
all: $(programs)
$(programs):
cargo build --target-dir="${TARGETDIR}" ${CARGO_ARGS}
.PHONY: clean
clean::
${RM} -rf target
.PHONY: install
install: all
mkdir -p ${DESTDIR}/etc/keylime/
mkdir -p ${DESTDIR}/etc/keylime/agent.conf.d
cp ${CONFFILE} ${DESTDIR}/etc/keylime/agent.conf
for f in $(programs); do \
install -D -t ${DESTDIR}/usr/bin "$$f"; \
done
install -D -m 644 -t ${DESTDIR}$(systemdsystemunitdir) dist/systemd/system/keylime_agent.service
install -D -m 644 -t ${DESTDIR}$(systemdsystemunitdir) dist/systemd/system/var-lib-keylime-secure.mount
# Remove when https://github.com/keylime/rust-keylime/issues/325 is fixed
install -D -t ${DESTDIR}/usr/libexec/keylime keylime-agent/tests/actions/shim.py
# This only runs tests without TPM access. See tests/run.sh for
# running full testsuite with swtpm.
.PHONY: check
check: all
cargo test --target-dir="${TARGETDIR}"