forked from vodik/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (59 loc) · 2.38 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
VERSION=v11.1
GIT_DESC=$(shell test -d .git && git describe 2>/dev/null)
ifneq "$(GIT_DESC)" ""
VERSION=$(GIT_DESC)
endif
base_CFLAGS = -std=c11 \
-Wall -Wextra -pedantic \
-Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \
-D_GNU_SOURCE \
-DENVOY_VERSION=\"${VERSION}\"
libsystemd_CFLAGS = $(shell pkg-config --cflags libsystemd-daemon)
libsystemd_LDLIBS = $(shell pkg-config --libs libsystemd-daemon)
dbus_CFLAGS = $(shell pkg-config --cflags dbus-1)
dbus_LDLIBS = $(shell pkg-config --libs dbus-1)
CFLAGS := \
${base_CFLAGS} \
${libsystemd_CFLAGS} \
${dbus_CFLAGS} \
${CFLAGS}
LDLIBS := \
${libsystemd_LDLIBS} \
${dbus_LDLIBS} \
${LDLIBS}
VPATH = src
LIBDIR = $(shell pkg-config --variable=libdir libsystemd)
all: envoyd envoy envoy-exec pam_envoy.so
gpg-protocol.c: gpg-protocol.rl
ragel -F0 -C $< -o ${VPATH}/$@
gpg-protocol.o: gpg-protocol.c
${CC} ${CFLAGS} -fPIC -o $@ -c ${VPATH}/$<
agents.o: agents.c
${CC} ${CFLAGS} -fPIC -o $@ -c $<
socket.o: socket.c
${CC} ${CFLAGS} -fPIC -o $@ -c $<
util.o: util.c
${CC} ${CFLAGS} -fPIC -o $@ -c $<
pam_envoy.o: pam_envoy.c
${CC} ${CFLAGS} -fPIC -o $@ -c $<
envoyd: envoyd.o agents.o socket.o dbus.o util.o
envoy: envoy.o agents.o socket.o gpg-protocol.o util.o
envoy-exec: envoy-exec.o agents.o socket.o gpg-protocol.o util.o
pam_envoy.so: pam_envoy.o agents.o socket.o gpg-protocol.o util.o
${CC} ${LDFLAGS} -shared -DPIC -o $@ $?
install: envoyd envoy pam_envoy.so
install -Dm755 envoyd ${DESTDIR}/usr/bin/envoyd
install -Dm755 envoy ${DESTDIR}/usr/bin/envoy
install -Dm755 envoy-exec ${DESTDIR}/usr/bin/envoy-exec
install -Dm755 pam_envoy.so ${DESTDIR}/${LIBDIR}/security/pam_envoy.so
install -Dm644 man/envoyd.1 ${DESTDIR}/usr/share/man/man1/envoyd.1
install -Dm644 man/envoy.1 ${DESTDIR}/usr/share/man/man1/envoy.1
install -Dm644 man/envoy-exec.1 ${DESTDIR}/usr/share/man/man1/envoy-exec.1
install -Dm644 units/[email protected] ${DESTDIR}/usr/lib/systemd/system/[email protected]
install -Dm644 units/[email protected] ${DESTDIR}/usr/lib/systemd/system/[email protected]
install -Dm644 units/[email protected] ${DESTDIR}/usr/lib/systemd/user/[email protected]
install -Dm644 units/[email protected] ${DESTDIR}/usr/lib/systemd/user/[email protected]
install -Dm644 zsh-completion ${DESTDIR}/usr/share/zsh/site-functions/_envoy
clean:
${RM} envoyd envoy envoy-exec pam_envoy.so *.o src/gpg-protocol.c
.PHONY: all clean install uninstall