forked from tpm2-software/tpm2-pkcs11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·31 lines (25 loc) · 894 Bytes
/
bootstrap
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
#!/bin/sh
# SPDX-License-Identifier: BSD-2-Clause
set -e
# generate list of source files for use in Makefile.am
# if you add new source files, you must run ./bootstrap again
src_listvar () {
basedir=$1
suffix=$2
var=$3
find "${basedir}" -maxdepth 1 -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (printf "${var} = " && cat)
echo ""
}
VARS_FILE=src_vars.mk
AUTORECONF=${AUTORECONF:-autoreconf}
echo "Generating file lists: ${VARS_FILE}"
(
src_listvar "src" "*.c" "LIB_PKCS11_C"
src_listvar "src" "*.h" "LIB_PKCS11_H"
printf "LIB_PKCS11_SRC = \$(LIB_PKCS11_C) \$(LIB_PKCS11_H)\n"
src_listvar "src/lib" "*.c" "LIB_PKCS11_INTERNAL_LIB_C"
src_listvar "src/lib" "*.h" "LIB_PKCS11_INTERNAL_LIB_H"
printf "LIB_PKCS11_INTERNAL_LIB_SRC = \$(LIB_PKCS11_INTERNAL_LIB_C) \$(LIB_PKCS11_INTERNAL_LIB_H)\n"
) > ${VARS_FILE}
mkdir -p m4
${AUTORECONF} --install --sym $@