forked from xyb3rt/physlock
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (28 loc) · 894 Bytes
/
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
VERSION := 0.5
CC ?= gcc
PREFIX := /usr/local
CFLAGS += -Wall -pedantic
CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=500
LDFLAGS +=
LIBS := -lcrypt -lutil
.PHONY: clean install uninstall
SRC := auth.c main.c options.c util.c vt.c issue.c
DEP := $(SRC:.c=.d)
OBJ := $(SRC:.c=.o)
all: physlock
$(OBJ): Makefile
-include $(DEP)
physlock: $(OBJ)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -MMD -MP -c -o $@ $<
install: all
install -D -m 4755 -o root -g root physlock $(DESTDIR)$(PREFIX)/bin/physlock
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
sed "s/VERSION/$(VERSION)/g" physlock.1 > $(DESTDIR)$(PREFIX)/share/man/man1/physlock.1
chmod 644 $(DESTDIR)$(PREFIX)/share/man/man1/physlock.1
clean:
rm -f physlock $(DEP) $(OBJ)
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/physlock
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/physlock.1