-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile.am
119 lines (101 loc) · 3.62 KB
/
Makefile.am
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright (C) 2014-2022 Yubico AB - See COPYING
SUBDIRS = . pamu2fcfg tests
if ENABLE_MAN
SUBDIRS += man
endif
if ENABLE_FUZZING
SUBDIRS += fuzz
endif
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(CWFLAGS) $(CSFLAGS)
AM_CPPFLAGS = $(LIBFIDO2_CFLAGS) $(LIBCRYPTO_CFLAGS)
if ENABLE_FUZZING
AM_CPPFLAGS += -fsanitize=fuzzer-no-link
endif
noinst_LTLIBRARIES = libmodule.la
libmodule_la_SOURCES = pam-u2f.c
libmodule_la_SOURCES += b64.c b64.h
libmodule_la_SOURCES += debug.c debug.h
libmodule_la_SOURCES += drop_privs.h
libmodule_la_SOURCES += expand.c
libmodule_la_SOURCES += explicit_bzero.c
libmodule_la_SOURCES += util.c util.h
libmodule_la_LIBADD = -lpam $(LIBFIDO2_LIBS) $(LIBCRYPTO_LIBS)
pampluginexecdir = $(PAMDIR)
pampluginexec_LTLIBRARIES = pam_u2f.la
pam_u2f_la_SOURCES =
pam_u2f_la_LIBADD = libmodule.la
pam_u2f_la_LDFLAGS = -module -avoid-version
if !ENABLE_FUZZING
pam_u2f_la_LDFLAGS += -export-symbols $(srcdir)/export.sym
else
pam_u2f_la_LDFLAGS += -export-symbols $(srcdir)/fuzz/export.sym
pam_u2f_la_SOURCES += fuzz/wrap.c
pam_u2f_la_LDFLAGS += -Wl,--wrap=asprintf
pam_u2f_la_LDFLAGS += -Wl,--wrap=strdup
pam_u2f_la_LDFLAGS += -Wl,--wrap=calloc
pam_u2f_la_LDFLAGS += -Wl,--wrap=malloc
pam_u2f_la_LDFLAGS += -Wl,--wrap=open
pam_u2f_la_LDFLAGS += -Wl,--wrap=close
pam_u2f_la_LDFLAGS += -Wl,--wrap=fdopen
pam_u2f_la_LDFLAGS += -Wl,--wrap=fstat
pam_u2f_la_LDFLAGS += -Wl,--wrap=read
pam_u2f_la_LDFLAGS += -Wl,--wrap=gethostname
pam_u2f_la_LDFLAGS += -Wl,--wrap=getline
pam_u2f_la_LDFLAGS += -Wl,--wrap=getpwnam_r
pam_u2f_la_LDFLAGS += -Wl,--wrap=getpwuid_r
pam_u2f_la_LDFLAGS += -Wl,--wrap=geteuid
pam_u2f_la_LDFLAGS += -Wl,--wrap=secure_getenv
pam_u2f_la_LDFLAGS += -Wl,--wrap=pam_get_user
pam_u2f_la_LDFLAGS += -Wl,--wrap=pam_get_item
pam_u2f_la_LDFLAGS += -Wl,--wrap=pam_modutil_drop_priv
pam_u2f_la_LDFLAGS += -Wl,--wrap=pam_modutil_regain_priv
pam_u2f_la_LDFLAGS += -Wl,--wrap=BIO_new
pam_u2f_la_LDFLAGS += -Wl,--wrap=BIO_write
pam_u2f_la_LDFLAGS += -Wl,--wrap=BIO_read
pam_u2f_la_LDFLAGS += -Wl,--wrap=BIO_ctrl
pam_u2f_la_LDFLAGS += -Wl,--wrap=BIO_new_mem_buf
pam_u2f_la_LDFLAGS += -Wl,--wrap=EC_KEY_new_by_curve_name
pam_u2f_la_LDFLAGS += -Wl,--wrap=EC_KEY_get0_group
pam_u2f_la_LDFLAGS += -Wl,--wrap=fido_dev_open
pam_u2f_la_LDFLAGS += -Wl,--wrap=fido_dev_info_manifest
endif
DEFS = -DDEBUG_PAM -DPAM_DEBUG @DEFS@
EXTRA_DIST = export.sym
# Release
# XXX: make distcheck happy with install location of pam_u2f.so
AM_DISTCHECK_CONFIGURE_FLAGS = --with-pam-dir='/$$(prefix)/$(PAMDIR)'
install-exec-hook:
rm -f $(DESTDIR)$(pampluginexecdir)/pam_u2f.la
chmod -f 644 $(DESTDIR)$(pampluginexecdir)/pam_u2f.so || true
uninstall-hook:
rm -f $(DESTDIR)$(pampluginexecdir)/pam_u2f.so
indent:
clang-format -i *.c *.h pamu2fcfg/*.c pamu2fcfg/*.h
ChangeLog:
cd $(srcdir) && git2cl > ChangeLog
PROJECT = pam-u2f
release:
@if test ! -d "$(YUBICO_WWW_REPO)"; then \
echo "WWW repo not found!"; \
echo "Make sure that YUBICO_WWW_REPO is set"; \
exit 1; \
fi
@if test -z "$(KEYID)"; then \
echo "Try this instead:"; \
echo " make release KEYID=[PGPKEYID]"; \
echo "For example:"; \
echo " make release KEYID=2117364A"; \
exit 1; \
fi
@head -5 $(srcdir)/NEWS | \
grep -q "Version $(VERSION) .released `date -I`" || \
(echo 'error: Update date/version in $(srcdir)/NEWS.'; exit 1)
rm -f $(srcdir)/ChangeLog
make ChangeLog distcheck
gpg --detach-sign --default-key $(KEYID) $(PACKAGE)-$(VERSION).tar.gz
gpg --verify $(PACKAGE)-$(VERSION).tar.gz.sig
cd $(srcdir) && git push
cd $(srcdir) && git tag -u $(KEYID) -m $(VERSION) $(PACKAGE)-$(VERSION)
cd $(srcdir) && git push --tags
$(YUBICO_WWW_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tar.gz*