-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile.am
188 lines (151 loc) · 5.97 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
# Written by Richard Levitte <[email protected]> et al.
# Copyright (c) 2008-2014 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Subdirectories
SUBDIRS= ykcore . tests
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(srcdir)/ykcore
AM_CFLAGS = $(WARN_CFLAGS)
AM_CFLAGS += $(libjson_CFLAGS)
# The library.
ykpers_includedir=$(includedir)/ykpers-1
ykpers_include_HEADERS = ykpers.h ykpers-version.h
ykpers_include_HEADERS += ykcore/ykstatus.h ykcore/ykcore.h ykcore/ykdef.h
ykpers_include_HEADERS += ykpbkdf2.h
noinst_LTLIBRARIES = libhmac.la
libhmac_la_SOURCES = hmac.c usha.c sha.h sha1.c sha224-256.c
libhmac_la_SOURCES += sha384-512.c sha-private.h
libhmac_la_CFLAGS =
lib_LTLIBRARIES = libykpers-1.la
libykpers_1_la_SOURCES = ykpers.c ykpers-version.c ykpbkdf2.c
if JSON
libykpers_1_la_SOURCES += ykpers-json.c
else
libykpers_1_la_SOURCES += ykpers-nojson.c
endif
libykpers_1_la_SOURCES += ykpers_lcl.h ykpers-json.h ykpers_lcl.c
libykpers_1_la_SOURCES += ykpers-1.pc.in libykpers-1.map
libykpers_1_la_LIBADD = $(LTLIBYUBIKEY) ./ykcore/libykcore.la ./libhmac.la $(libjson_LIBS)
libykpers_1_la_LDFLAGS = -no-undefined \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
EXTRA_libykpers_1_la_DEPENDENCIES = libykpers-1.map
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ykpers-1.pc
if HAVE_LD_VERSION_SCRIPT
libykpers_1_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libykpers-1.map
else
libykpers_1_la_LDFLAGS += -export-symbols-regex '^(ykp|yk|ykds|ykpers)_.*|_yk.*_errno_location'
endif
# The command line tools.
bin_PROGRAMS = ykpersonalize ykchalresp ykinfo
ykpersonalize_SOURCES = ykpersonalize.c
ykpersonalize_LDADD = ./libykpers-1.la
ykpersonalize_LDADD += ./libykpers_args.la
noinst_LTLIBRARIES += libykpers_args.la
libykpers_args_la_SOURCES = ykpers-args.c ykpers-args.h
libykpers_args_la_LIBADD = libykpers-1.la $(LTLIBYUBIKEY)
ykchalresp_SOURCES = ykchalresp.c
ykchalresp_LDADD = ./libykpers-1.la $(LTLIBYUBIKEY)
ykinfo_SOURCES = ykinfo.c
ykinfo_LDADD = ./libykpers-1.la $(LTLIBYUBIKEY)
EXTRA_DIST =
if ENABLE_DOC
dist_man1_MANS = ykpersonalize.1 ykchalresp.1 ykinfo.1
DISTCLEANFILES = $(dist_man1_MANS)
MANSOURCES = ykpersonalize.1.adoc ykchalresp.1.adoc ykinfo.1.adoc
SUFFIXES = .1.adoc .1
.1.adoc.1:
$(A2X) -L --format=manpage -a revdate="Version $(VERSION)" --xsltproc-opts="--nonet" $<
# Dist docs
EXTRA_DIST += doc/Compatibility.asciidoc doc/USB-Hid-Issue.asciidoc
# Dist contrib stuff.
EXTRA_DIST += contrib/README contrib/programming.sh contrib/oath-unlock-reprogram.sh contrib/draft-josefsson-yubikey-config.xml
# Dist dev tools as well, to have the tarball complete.
EXTRA_DIST += build-and-test.sh .travis.yml .gitignore
# dist the man sources
EXTRA_DIST += $(MANSOURCES)
endif
# Windows rules.
EXTRA_DIST += ykpers4win.mk ykpers4mac.mk
# udev rule files
EXTRA_DIST += 69-yubikey.rules 70-yubikey.rules
udevrulesdir=@udevrulesdir@
dist_udevrules_DATA = \
@udevrulesfile@
if ENABLE_COV
AM_CFLAGS += --coverage
AM_LDFLAGS = --coverage
cov-reset:
rm -fr coverage
find . -name "*.gcda" -exec rm {} \;
lcov --directory . --zerocounters
cov-report:
mkdir -p coverage
lcov --compat-libtool --directory . --capture --output-file coverage/app.info
lcov --extract coverage/app.info '*.c' --output-file coverage/app2.info
genhtml -o coverage/ coverage/app2.info
cov:
make cov-report
clean-local:
make cov-reset
check:
make cov
endif
# Release
PROJECT = yubikey-personalization
ChangeLog:
cd $(srcdir) && git2cl > ChangeLog
check-doc-dist:
perl -pe "s,^EXTRA_DIST = .*,EXTRA_DIST = `cd $(srcdir) && ls doc/*.asciidoc | xargs echo`," \
< $(srcdir)/Makefile.am > check-doc-dist.tmp
diff -ur $(srcdir)/Makefile.am check-doc-dist.tmp || \
(rm -f check-doc-dist.tmp; echo 'error: please update $(srcdir)/Makefile.am to include all docs'; exit 1)
rm -f check-doc-dist.tmp
! man --warnings ./*.1 2>&1 | grep ': warning'
release:
@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 -3 $(srcdir)/NEWS | grep -q "Version $(VERSION) .released `date -I`" || \
(echo 'error: You need to update date/version in $(srcdir)/NEWS, see doc/MakeRelease.wiki.'; exit 1)
@if test ! -d "$(YUBICO_WWW_REPO)"; then \
echo "yubico www repo not found!"; \
echo "Make sure that YUBICO_WWW_REPO is set"; \
exit 1; \
fi
rm -f $(srcdir)/ChangeLog
make check-doc-dist 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) v$(VERSION)
cd $(srcdir) && git push --tags
$(YUBICO_WWW_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tar.gz*