-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (43 loc) · 1.03 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
#####################################################
# Makefile for tlock, the simple terminal locker
# using pam or shadow.
#
# If using shadow, requires sudo, as tlock must be
# suid root in order to auth.
#####################################################
include ./Makefile.conf
CC=gcc
CFLAGS=-lcurses
OBJS=tlock.o
NAME=tlock
ifneq ($(strip ${COLORVALS}),)
CFLAGS+= '-DCOLORVALS=${COLORVALS}'
endif
ifeq (${USE_PAM},true)
CFLAGS+= -lpam -DUSE_PAM
else
CFLAGS+= -lcrypt
endif
all: ${OBJS}
@${CC} -o ${NAME} ${CFLAGS} ${OBJS}
@echo "cc tlock"
ifeq (${USE_PAM},false)
@echo -e "\n\n***\nTlock must be suid root if not using pam."
@sudo echo -e "***\n"
sudo chown root:root ./${NAME}
sudo chmod 4755 ./${NAME}
endif
%.o: %.c
@${CC} -c ${CFLAGS} $<
@echo "cc $@"
install: all
@echo "install /usr/bin/tlock"
@cp tlock /usr/bin
ifeq (${USE_PAM},true)
@echo "install /etc/pam.d/tlock"
@echo -e "auth\trequired\tpam_unix.so nodelay" > /etc/pam.d/tlock
endif
uninstall:
rm -f /usr/bin/tlock /etc/pam.d/tlock
clean:
rm -f ${OBJS} ${NAME}