-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
204 lines (159 loc) · 6.88 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
AUTOMAKE_OPTIONS = foreign subdir-objects
ACLOCAL_AMFLAGS = -I build
# Support systemd with make distcheck
# See man 7 daemon ("Installing Systemd Service Files" section) for details
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
pamdir = $(libdir)/security
bin_PROGRAMS = pico-pair pico-continuous pico-test
pam_LTLIBRARIES = pam_pico.la
noinst_LTLIBRARIES = lib_pam_test.la lib_service_test.la lib_mockpam.la lib_mockbt.la lib_mockdbus.la
dist_doc_DATA = AUTHORS ChangeLog INSTALL NEWS README.md
MODULES_LDFLAGS = -avoid-version -module -shared -export-dynamic
CORE_SRC =
CORE_SRC += src/pam_pico.h
# Generate gdbus code
gdbus_generated = src/gdbus-generated.c src/gdbus-generated.h
$(gdbus_generated): src/pico-cont-auth-gdbus.xml
$(AM_V_GEN) \
$(GDBUS_CODEGEN) --interface-prefix uk.ac.cam.cl.pico.. --generate-c-code src/gdbus-generated --c-namespace Pico --c-generate-object-manager --generate-docbook doc/generated-docs $<
# Pairing executable
pico_pair_SOURCES = \
src/pico-pair.c \
$(CORE_SRC)
pico_pair_CFLAGS = -DPICOPAIRDIR=\"$(datadir)/@PACKAGE@\" -DPICOKEYDIR=\"/etc/pam-pico\" $(AM_CFLAGS) @PICO_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ @QRENCODE_CFLAGS@ @URLDISPATCHER_CFLAGS@
pico_pair_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) @PICO_LIBS@ @PICOBT_LIBS@ @GLIB_LIBS@ @GTK_LIBS@ @QRENCODE_LIBS@ @URLDISPATCHER_LIBS@ -lpam
# Service testing executable
pico_test_SOURCES = \
src/pico-test.c \
$(CORE_SRC)
pico_test_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
pico_test_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) @PICO_LIBS@ @PICOBT_LIBS@ @DBUSGLIB_LIBS@ @GLIB_LIBS@ -lpam
# Continuous authenticaton service
pico_continuous_SOURCES = \
src/pico-continuous.c \
src/processstore.c \
src/auththread.c \
src/beaconthread.c \
src/beaconsend.c \
src/authconfig.c \
src/service.c \
src/servicebtc.c \
src/servicervp.c \
src/gdbus-generated.c \
src/processstore.h \
src/auththread.h \
src/beaconthread.h \
src/beaconsend.h \
src/authconfig.h \
src/service.h \
src/service_private.h \
src/servicebtc.h \
src/servicervp.h \
src/gdbus-generated.h \
$(CORE_SRC)
pico_continuous_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@
pico_continuous_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) @PICO_LIBS@ @PICOBT_LIBS@ @GLIB_LIBS@
# PAM module
pam_pico_la_SOURCES = \
$(gdbus_generated) \
src/pam_pico.c \
$(CORE_SRC)
pam_pico_la_LIBADD = -lpam @PICO_LIBS@ @PICOBT_LIBS@ @DBUSGLIB_LIBS@ @GLIB_LIBS@
pam_pico_la_CFLAGS = -fPIC $(AM_CFLAGS) @PICO_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
pam_pico_la_LDFLAGS = -avoid-version -module -Wl,-z,nodelete $(AM_LDFLAGS) $(MODULES_LDFLAGS) -export-symbols-regex "pam_sm_(setcred|open_session|authenticate)"
# Tests
lib_pam_test_la_SOURCES = \
src/pam_pico.c \
$(CORE_SRC)
lib_pam_test_la_LIBADD = @PICO_LIBS@
lib_pam_test_la_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
lib_pam_test_la_LDFLAGS = $(AM_LDFLAGS)
lib_service_test_la_SOURCES = \
$(gdbus_generated) \
src/pico-continuous.c \
src/processstore.c \
src/auththread.c \
src/beaconthread.c \
src/beaconsend.c \
src/authconfig.c \
src/service.c \
src/servicebtc.c \
src/servicervp.c \
src/processstore.h \
src/auththread.h \
src/beaconthread.h \
src/beaconsend.h \
src/authconfig.h \
src/service.h \
src/service_private.h \
src/servicebtc.h \
src/servicervp.h \
$(CORE_SRC)
lib_service_test_la_LIBADD = @PICO_LIBS@ @GLIB_LIBS@
lib_service_test_la_CFLAGS = -DBASE_DIR=\"./tests/keydir/\" $(AM_CFLAGS) @PICO_CFLAGS@ @GLIB_CFLAGS@
lib_service_test_la_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS)
lib_mockpam_la_SOURCES = \
tests/mockpam/mockpam.c
lib_mockbt_la_SOURCES = \
tests/mockbt/mockbt.c
lib_mockbt_la_CFLAGS = $(AM_CFLAGS) @PICOBT_CFLAGS@
lib_mockdbus_la_SOURCES = \
tests/mockdbus/mockdbus.c
lib_mockdbus_la_CFLAGS = $(AM_CFLAGS) @DBUSGLIB_CFLAGS@
# Tests
TESTS = tests/test_pam tests/test_auth tests/test_beacons #tests/test_service
check_PROGRAMS = $(TESTS)
tests_test_pam_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @CHECK_CFLAGS@ @PICOBT_CFLAGS@ @GLIB_CFLAGS@ @DBUSGLIB_CFLAGS@
tests_test_pam_LDADD = .libs/lib_pam_test.la .libs/lib_mockpam.la .libs/lib_mockbt.la .libs/lib_mockdbus.la @CHECK_LIBS@ @PICO_LIBS@
tests_test_auth_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @CHECK_CFLAGS@ @PICOBT_CFLAGS@ @DBUSGLIB_CFLAGS@ @GLIB_CFLAGS@
tests_test_auth_LDADD = .libs/lib_pam_test.la .libs/lib_mockpam.la .libs/lib_mockbt.la .libs/lib_mockdbus.la @CHECK_LIBS@ @PICO_LIBS@
tests_test_beacons_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @CHECK_CFLAGS@ @PICOBT_CFLAGS@ @DBUSGLIB_CFLAGS@ @GLIB_CFLAGS@
tests_test_beacons_LDADD = .libs/lib_service_test.la .libs/lib_mockpam.la .libs/lib_mockbt.la .libs/lib_mockdbus.la @CHECK_LIBS@ @PICO_LIBS@
#tests_test_service_CFLAGS = $(AM_CFLAGS) @PICO_CFLAGS@ @CHECK_CFLAGS@ @GLIB_CFLAGS@
#tests_test_service_LDADD = .libs/lib_service_test.la .libs/lib_mockbt.la @CHECK_LIBS@ @PICO_LIBS@ @GLIB_LIBS@
.PHONY: check-valgrind ;
check-valgrind: $(TESTS)
@cd tests
@for test in $$(echo $(TESTS) | sed 's/tests\/\([^ ]\)/tests\/.libs\/lt-\1/g') ; do \
CK_FORK=no $(VALGRIND) --error-exitcode=1 --leak-resolution=low --quiet \
--leak-check=full --show-possibly-lost=no --suppressions=valgrind.suppressions $${test} ; \
done
#check_PROGRAMS = examples/demo tests/pam_google_authenticator_unittest
#check_LTLIBRARIES = libpam_google_authenticator_testing.la
#TESTS = tests/pam_google_authenticator_unittest
#libpam_google_authenticator_testing_la_SOURCES = \
# src/pam_google_authenticator.c \
# $(CORE_SRC)
#libpam_google_authenticator_testing_la_CFLAGS = $(AM_CFLAGS) -DTESTING=1
#libpam_google_authenticator_testing_la_LDFLAGS = $(AM_LDFLAGS) $(MODULES_LDFLAGS) -rpath $(abs_top_builddir)
#tests_pam_google_authenticator_unittest_SOURCES = \
# tests/pam_google_authenticator_unittest.c \
# $(CORE_SRC)
#tests_pam_google_authenticator_unittest_LDFLAGS = $(AM_LDFLAGS) -export-dynamic
#test: check
#examples_demo_SOURCES = \
# src/pam_google_authenticator.c \
# $(CORE_SRC) \
# examples/demo.c
#examples_demo_CFLAGS = $(AM_CFLAGS) -DDEMO=1
SUBDIRS = doc service assets
# /etc/pam.d/pico-pair config file added to debian/libpam-pico.install
# so it won't get installed with make install, unfortunately (but will be
# installed by the deb package).
#install-data-local: etc/pam.d/pico-pair
# $(INSTALL_DATA) etc/pam.d/pico-pair /etc/pam.d/pico-pair
super-clean: maintainer-clean
rm -fr aclocal autom4te.cache/ m4 missing libtool config.guess
rm -fr config.lt config.status config.sub configure depcomp
rm -fr libtool install-sh *~ Makefile aclocal.m4 config.h.in ltmain.sh
rm -fr Makefile.in test-driver compile
export VERSION
.PHONY: doxygen
doxygen:
$(DOXYGEN) doxyfile
# @if test "$DOXYGEN" = doxygen; then \
# $(DOXYGEN) doxyfile; \
# else \
# echo "Please install doxygen to generate the documentation."; \
# fi