This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile.am
150 lines (130 loc) · 6.14 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
# Copyright (C) 2014-2015 Cryptotronix, LLC.
# This file is part of libcryptoauth.
# libcryptoauth is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# libcryptoauth is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License
# along with libcryptoauth. If not, see <http://www.gnu.org/licenses/>.
SUBDIRS = lib . test
## Place generated object files (.o) into the same directory as their source
## files, in order to avoid collisions when non-recursive make is used.
AUTOMAKE_OPTIONS = subdir-objects
## Define the Data dir so we know where our data files are
AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)\"
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
libcryptoauth_la_CPPFLAGS = $(XML_CFLAGS)
libcryptoauth_la_LIBADD = $(XML_LIBS) lib/libgnu.la
## Define a libtool archive target "libcryptoauth-@[email protected]", with
## @CRYPTOAUTH_API_VERSION@ substituted into the generated Makefile at configure
## time.
## The libtool archive file (.la) will be installed into the directory named
## by the predefined variable $(bindir), along with the actual shared library
## file (.so).
pkglib_LTLIBRARIES = libcryptoauth.la
## Define the source file list for the "libcryptoauth-@[email protected]"
## target. Note that @CRYPTOAUTH_API_VERSION@ is not interpreted by Automake and
## will therefore be treated as if it were literally part of the target name,
## and the variable name derived from that.
## The file extension .cc is recognized by Automake, and makes it produce
## rules which invoke the C++ compiler to produce a libtool object file (.lo)
## from each source file. Note that it is not necessary to list header files
## which are already listed elsewhere in a _HEADERS variable assignment.
libcryptoauth_la_SOURCES = src/util.c \
src/log.c \
src/crc.c \
src/command_adaptation.c \
src/i2c.c \
src/hash.c \
src/ecdsa.c \
src/command_util.c \
src/atsha204_command.c \
src/atecc108_command.c \
src/init.c \
src/configfile.c \
src/otp.c \
src/util.h \
src/crc.h \
src/command_adaptation.h \
src/hash.h \
src/command_util.h \
src/atsha204_command.h \
src/hkdf.c
## Instruct libtool to include ABI version information in the generated shared
## library file (.so). The library ABI version is defined in configure.ac, so
## that all version information is kept in one place.
libcryptoauth_la_LDFLAGS = -version-info $(CRYPTOAUTH_SO_VERSION) \
-release $(CRYPTOAUTH_API_VERSION)
## Define the list of public header files and their install location. The
## nobase_ prefix instructs Automake to not strip the directory part from each
## filename, in order to avoid the need to define separate file lists for each
## installation directory. This only works if the directory hierarchy in the
## source tree matches the hierarchy at the install location, however.
cryptoauth_includedir = $(includedir)/cryptoauth-$(CRYPTOAUTH_API_VERSION)
nobase_cryptoauth_include_HEADERS = libcryptoauth.h
## Data files
dist_pkgdata_DATA = data/atecc108_default.xml
## The generated configuration header is installed in its own subdirectory of
## $(libdir). The reason for this is that the configuration information put
## into this header file describes the target platform the installed library
## has been built for. Thus the file must not be installed into a location
## intended for architecture-independent files, as defined by the Filesystem
## Hierarchy Standard (FHS).
## The nodist_ prefix instructs Automake to not generate rules for including
## the listed files in the distribution on 'make dist'. Files that are listed
## in _HEADERS variables are normally included in the distribution, but the
## configuration header file is generated at configure time and should not be
## shipped with the source tarball.
cryptoauth_libincludedir = $(libdir)/cryptoauth-$(CRYPTOAUTH_API_VERSION)/include
## Install the generated pkg-config file (.pc) into the expected location for
## architecture-dependent package configuration information. Occasionally,
## pkg-config files are also used for architecture-independent data packages,
## in which case the correct install location would be $(datadir)/pkgconfig.
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = cryptoauth.pc
## Define an independent executable script for inclusion in the distribution
## archive. However, it will not be installed on an end user's system due to
## the noinst_ prefix.
dist_noinst_SCRIPTS = autogen.sh
if BUILDING_DEB
DEBSOURCEPKG=$(PACKAGE)_$(VERSION).orig.tar.gz
DEBSOURCEDIR=$(PACKAGE)-$(VERSION)
deb: dist
@echo "Building Debian package..."; \
if test ! -d debian; then \
echo "The files needed for building a Debian package are not" \
"included by default in the distribution. To build a package, check" \
"out the project from source control."; \
exit 1; \
fi; \
mv $(PACKAGE)-$(VERSION).tar.gz $(DEBSOURCEPKG) && \
tar --extract --gunzip --file $(DEBSOURCEPKG) && \
mkdir -p $(DEBSOURCEDIR)/debian && \
cp \
debian/changelog \
debian/compat \
debian/control \
debian/copyright \
debian/docs \
debian/rules \
$(DEBSOURCEDIR)/debian && \
cd $(DEBSOURCEDIR) && \
./configure && \
DEB_BUILD_MAINT_OPTIONS=hardening=-format \
$(DEBUILD) -rfakeroot -D -us -uc; \
cd $(srcdir); \
rm --force $(DEBSOURCEPKG); \
rm --recursive --force $(DEBSOURCEDIR)
else
deb:
@$(ECHO) \
"To build a Debian package, you must run configure with --enable-deb."; \
exit 1
endif