-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile.am
225 lines (190 loc) · 6.65 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2018 Fraunhofer SIT
# All rights reserved.
-include $(top_srcdir)/git.mk
### Initialize global variables used throughout the file ###
INCLUDE_DIRS = -I$(srcdir)/include -I$(srcdir)/src
ACLOCAL_AMFLAGS = -I m4 --install
AM_CFLAGS = $(INCLUDE_DIRS) $(EXTRA_CFLAGS) $(TSS2_ESYS_CFLAGS) \
$(TSS2_MU_CFLAGS) $(CODE_COVERAGE_CFLAGS)
AM_LDFLAGS = $(EXTRA_LDFLAGS) $(CODE_COVERAGE_LIBS)
AM_LDADD = $(TSS2_ESYS_LIBS) $(TSS2_MU_LIBS)
AM_DISTCHECK_CONFIGURE_FLAGS = --with-dracutmodulesdir='$$(libdir)/dracut/modules.d' \
--with-systemdsystemunitdir='$$(libdir)/systemd/system'
# Initialize empty variables to be extended throughout
bin_PROGRAMS =
libexec_PROGRAMS =
helpers_PROGRAMS =
noinst_PROGRAMS =
check_PROGRAMS =
include_HEADERS =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
EXTRA_DIST =
DISTCLEANFILES =
CLEANFILES =
MOSTLYCLEANFILES =
MAINTAINERCLEANFILES = \
$(DIST_ARCHIVES) \
AUTHORS
GITIGNOREFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
aminclude_static.am \
m4/ax_ac_append_to_file.m4 \
m4/ax_ac_print_to_file.m4 \
m4/ax_add_am_macro_static.m4 \
m4/ax_add_fortify_source.m4 \
m4/ax_am_macros_static.m4 \
m4/ax_check_compile_flag.m4 \
m4/ax_check_enable_debug.m4 \
m4/ax_check_gnu_make.m4 \
m4/ax_check_link_flag.m4 \
m4/ax_code_coverage.m4 \
m4/ax_file_escapes.m4 \
m4/ax_is_release.m4 \
m4/ax_prog_doxygen.m4 \
m4/ax_recursive_eval.m4 \
m4/pkg.m4
### Add ax_* rules ###
# ax_code_coverage
if AUTOCONF_CODE_COVERAGE_2019_01_06
include $(top_srcdir)/aminclude_static.am
clean-local: code-coverage-clean
distclean-local: code-coverage-dist-clean
else
@CODE_COVERAGE_RULES@
endif
# ax_prog_doxygen
@DX_RULES@
MOSTLYCLEANFILES += $(DX_CLEANFILES)
### Library ###
lib_LTLIBRARIES += libtpm2-totp.la
include_HEADERS += include/tpm2-totp.h
libtpm2_totp_la_SOURCES = src/libtpm2-totp.c
libtpm2_totp_la_LIBADD = $(AM_LDADD)
libtpm2_totp_la_LDFLAGS = $(AM_LDFLAGS)
pkgconfig_DATA = dist/tpm2-totp.pc
### Executable ###
bin_PROGRAMS += tpm2-totp
tpm2_totp_SOURCES = src/tpm2-totp.c
tpm2_totp_CFLAGS = $(AM_CFLAGS) $(TSS2_TCTILDR_CFLAGS) $(TSS2_RC_CFLAGS) $(QRENCODE_CFLAGS)
tpm2_totp_LDADD = $(AM_LDADD) $(TSS2_TCTILDR_LIBS) $(TSS2_RC_LIBS) $(QRENCODE_LIBS) libtpm2-totp.la
tpm2_totp_LDFLAGS = $(AM_LDFLAGS)
if HAVE_PLYMOUTH
helpers_PROGRAMS += plymouth-tpm2-totp
plymouth_tpm2_totp_SOURCES = src/plymouth-tpm2-totp.c
plymouth_tpm2_totp_CFLAGS = $(AM_CFLAGS) $(TSS2_TCTILDR_CFLAGS) $(PLY_BOOT_CLIENT_CFLAGS)
plymouth_tpm2_totp_LDADD = $(AM_LDADD) $(TSS2_TCTILDR_LIBS) $(PLY_BOOT_CLIENT_LIBS) libtpm2-totp.la
plymouth_tpm2_totp_LDFLAGS = $(AM_LDFLAGS)
endif # HAVE_PLYMOUTH
### Tests ###
TESTS =
if INTEGRATION
TESTS += $(TESTS_SHELL)
if HAVE_PLYMOUTH
TESTS += $(TESTS_PLYMOUTH)
endif # HAVE_PLYMOUTH
endif #INTEGRATION
TESTS_SHELL = test/libtpm2-totp.sh \
test/tpm2-totp.sh
TESTS_PLYMOUTH = test/plymouth-tpm2-totp.sh
EXTRA_DIST += $(TESTS_SHELL) $(TESTS_PLYMOUTH)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(srcdir)/test/sh_log_compiler.sh
EXTRA_DIST += $(SH_LOG_COMPILER)
if INTEGRATION
check_PROGRAMS += libtpm2-totp
libtpm2_totp_SOURCES = test/libtpm2-totp.c
libtpm2_totp_CFLAGS = $(AM_CFLAGS) $(TSS2_TCTILDR_CFLAGS) $(OATH_CFLAGS)
libtpm2_totp_LDADD = $(AM_LDADD) $(TSS2_TCTILDR_LIBS) $(OATH_LIBS) libtpm2-totp.la
libtpm2_totp_LDFLAGS = $(AM_LDFLAGS) $(OATH_LDFLAGS)
endif #INTEGRATION
# Adding user and developer information
EXTRA_DIST += \
CHANGELOG.md \
CONTRIBUTING.md \
INSTALL.md \
LICENSE \
README.md \
VERSION
# Generate the AUTHORS file from git log
AUTHORS:
$(AM_V_GEN)git log --format='%aN <%aE>' | \
grep -v 'users.noreply.github.com' | sort -u > $@
EXTRA_DIST += AUTHORS
CLEANFILES += AUTHORS
if HAVE_PANDOC_MAN_PAGES
### Man Pages
man1_MANS = \
man/man1/tpm2-totp.1
endif
if HAVE_PANDOC
# If pandoc is enabled, we want to generate the manpages for the dist tarball
EXTRA_DIST += \
$(man1_MANS)
else
# If pandoc is not enabled, we want to complain that you need pandoc for make dist,
# so hook the target and complain.
dist-hook:
@(>&2 echo "You do not have pandoc, a requirement for the distribution of manpages")
@exit 1
endif
man/man1/%.1: man/%.1.md
$(AM_V_GEN)mkdir -p man/man1 && cat $< | $(PANDOC) -s -t man >$@
EXTRA_DIST += \
man/tpm2-totp.1.md
CLEANFILES += \
$(man1_MANS)
if HAVE_DOXYGEN_MAN_PAGES
man3_MANS = doxygen-doc/man/man3/tpm2-totp.3
endif # HAVE_DOXYGEN_MAN_PAGES
if HAVE_DOXYGEN
$(man3_MANS): doxygen-doc
EXTRA_DIST += $(man3_MANS)
else # HAVE_DOXYGEN
dist-hook:
@(>&2 echo "You do not have doxygen, a requirement for the distribution of manpages")
@exit 1
endif # HAVE_DOXYGEN
### initramfs hooks ###
EXTRA_DIST += dist/show-tpm2-totp
if HAVE_DRACUT
helpers_SCRIPTS = dist/show-tpm2-totp
dracut_SCRIPTS = dist/dracut/module-setup.sh dist/dracut/show-tpm2-totp.sh \
dist/dracut/cleanup-tpm2-totp.sh
dracut_DATA = dist/dracut/README
endif # HAVE_DRACUT
EXTRA_DIST += dist/dracut/show-tpm2-totp.sh dist/dracut/cleanup-tpm2-totp.sh dist/dracut/README
if HAVE_INITRAMFSTOOLS
if HAVE_PLYMOUTH
initramfstools_hooks_SCRIPTS = dist/initramfs-tools/hooks/tpm2-totp
initramfstools_scripts_SCRIPTS = dist/initramfs-tools/scripts/init-premount/tpm2-totp
endif # HAVE_PLYMOUTH
endif # HAVE_INITRAMFSTOOLS
EXTRA_DIST += dist/initramfs-tools/scripts/init-premount/tpm2-totp
if HAVE_MKINITCPIO
helpers_SCRIPTS = dist/show-tpm2-totp
initcpio_install_DATA = dist/initcpio/install/tpm2-totp dist/initcpio/install/sd-tpm2-totp
initcpio_hooks_DATA = dist/initcpio/hooks/tpm2-totp
systemdsystemunit_DATA = dist/tpm2-totp.service dist/tpm2-totp.timer
install-systemd-service-hook:
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants && \
cd $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants && \
$(LN_S) ../tpm2-totp.service && \
$(LN_S) ../tpm2-totp.timer
if HAVE_PLYMOUTH
initcpio_install_DATA += dist/initcpio/install/plymouth-tpm2-totp dist/initcpio/install/sd-plymouth-tpm2-totp
initcpio_hooks_DATA += dist/initcpio/hooks/plymouth-tpm2-totp
systemdsystemunit_DATA += dist/plymouth-tpm2-totp.service
install-plymouth-service-hook:
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants && \
cd $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants && \
$(LN_S) ../plymouth-tpm2-totp.service
else
install-plymouth-service-hook:
endif # HAVE_PLYMOUTH
install-data-hook: install-systemd-service-hook install-plymouth-service-hook
endif # HAVE_MKINITCPIO
EXTRA_DIST += dist/initcpio/hooks/tpm2-totp dist/initcpio/hooks/plymouth-tpm2-totp