-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 1.67 KB
/
Copy pathMakefile
File metadata and controls
51 lines (37 loc) · 1.67 KB
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
DESTDIR =
PREFIX = /usr
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
DATADIR = $(PREFIX)/share
PAMDIR = $(LIBDIR)/security
BUILD_DIR = ./build
#----------------------------------------------------------------------------------------
# BUILD
#----------------------------------------------------------------------------------------
GOFILES = $(wildcard **/*.go) $(wildcard *.go) go.mod go.sum
build: pam daemon
daemon: $(BUILD_DIR)/redfaced
pam: $(BUILD_DIR)/pam_redface.so
$(BUILD_DIR)/pam_redface.so: $(GOFILES)
go build -v -buildmode=c-shared -o $@ ./pam_redface/main.go
$(BUILD_DIR)/redfaced: $(GOFILES)
go build -v -o $@ ./cmd/redfaced/main.go
#----------------------------------------------------------------------------------------
# INSTALL
#----------------------------------------------------------------------------------------
install: install-pam install-daemon install-data
install-pam: pam
install $(BUILD_DIR)/pam_redface.so $(DESTDIR)$(PAMDIR)/pam_redface.so
install-daemon: daemon
install $(BUILD_DIR)/redfaced $(DESTDIR)$(BINDIR)/redfaced
install data/redfaced.service $(DESTDIR)$(LIBDIR)/systemd/system/redfaced.service
install-data:
install -d -m 755 $(DESTDIR)$(DATADIR)/redface
install data/dlib_face_recognition_resnet_model_v1.dat $(DESTDIR)$(DATADIR)/redface/dlib_face_recognition_resnet_model_v1.dat
install data/shape_predictor_5_face_landmarks.dat $(DESTDIR)$(DATADIR)/redface/shape_predictor_5_face_landmarks.dat
#----------------------------------------------------------------------------------------
# CLEAN
#----------------------------------------------------------------------------------------
clean:
rm -f build/pam_redface.so
rm -f build/redfaced