-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
38 lines (25 loc) · 1.09 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
CFLAGS = -ggdb -w -Ilibtpm -std=c99 -Wall -Wextra -Werror -DTPM_POSIX=1 -DTPM_NV_DISK=1 -DTPM_AES=1 -DTPM_V12=1 -DTPM_USE_TAG_IN_STRUCTURE=1 -DTPM_USE_CHARDEV=1
PLYMOUTH_CFLAGS = `pkg-config --cflags ply-boot-client`
LDLIBS=-Llibtpm -ltpm -lcrypto -loath
PLYMOUTH_LDLIBS = `pkg-config --libs ply-boot-client`
APPS=sealtotp unsealtotp plymouth-unsealtotp
all: libtpm/libtpm.a $(APPS)
libtpm/libtpm.a:
$(MAKE) -C libtpm
unsealtotp: unsealtotp.o
plymouth-unsealtotp: plymouth-unsealtotp.c
$(CC) $(CFLAGS) $(PLYMOUTH_CFLAGS) -o $@ $< $(PLYMOUTH_LDLIBS) $(LDLIBS)
sealtotp: sealtotp.c base32.c
$(CC) $(CFLAGS) -ltspi -lqrencode -o $@ $^ $(LDLIBS)
clean:
rm -f *.o $(APPS)
$(MAKE) -C libtpm clean
install:
install sealtotp unsealtotp plymouth-unsealtotp /usr/bin/
install -D dracut/module-setup.sh /usr/lib/dracut/modules.d/60tpmtotp/module-setup.sh
install -m 0644 tpmtotp.service /lib/systemd/system
systemctl enable tpmtotp.service
uninstall:
rm /usr/bin/sealtotp /usr/bin/unsealtotp /usr/bin/plymouth-unsealtotp
rm -rf /usr/lib/dracut/modules.d/60tpmtotp/
rm /lib/systemd/system/tpmtotp.service