blob: 7c627f4af45b10c34be62dd98e759a23da9fc5cc [file] [log] [blame]
Philip Tricca8777b5e2015-09-16 13:14:46 -07001#!/bin/sh
2set -e
Philip Triccad1952b42015-08-05 15:52:10 -07003
Philip Triccae690e082015-09-07 18:17:35 -07004# generate list of source files for use in Makefile.am
5# if you add new source files, you must run ./bootstrap again
Philip Tricca8777b5e2015-09-16 13:14:46 -07006src_listvar () {
Philip Triccae690e082015-09-07 18:17:35 -07007 basedir=$1
8 suffix=$2
9 var=$3
10
David R. Bild8b3c6d92017-11-28 10:34:23 -060011 find "${basedir}" -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (printf "${var} = " && cat)
Philip Triccae690e082015-09-07 18:17:35 -070012 echo ""
13}
14
15VARS_FILE=src_vars.mk
Daniel Mueller30794af2017-01-25 14:46:54 -080016AUTORECONF=${AUTORECONF:-autoreconf}
Philip Triccae690e082015-09-07 18:17:35 -070017
18echo "Generating file lists: ${VARS_FILE}"
Philip Tricca8777b5e2015-09-16 13:14:46 -070019(
Philip Tricca57360da2018-03-15 17:22:10 -070020 src_listvar "src/util" "*.c" "UTIL_C"
21 src_listvar "src/util" "*.h" "UTIL_H"
22 printf "UTIL_SRC = \$(UTIL_C) \$(UTIL_H)\n"
23
Philip Triccad5a6ff42018-03-13 18:19:42 -070024 src_listvar "src/tss2-sys/" "*.c" "TSS2_SYS_C"
25 src_listvar "src/tss2-sys/" "*.h" "TSS2_SYS_H"
26 printf "TSS2_SYS_SRC = \$(TSS2_SYS_H) \$(TSS2_SYS_C)\n"
Philip Triccae690e082015-09-07 18:17:35 -070027
Philip Tricca0013d842018-03-13 18:33:00 -070028 src_listvar "src/tss2-esys/" "*.h" "TSS2_ESYS_H"
29 src_listvar "src/tss2-esys/" "*.c" "TSS2_ESYS_C"
30 printf "TSS2_ESYS_SRC = \$(TSS2_ESYS_H) \$(TSS2_ESYS_C)\n"
Juergen Reppff821bd2017-12-11 15:21:42 +010031
Philip Triccaee730622018-03-10 16:40:41 -080032 src_listvar "src/tss2-mu" "*.c" "TSS2_MU_C"
33 src_listvar "src/tss2-mu" "*.h" "TSS2_MU_H"
34 printf "TSS2_MU_SRC = \$(TSS2_MU_C) \$(TSS2_MU_H)"
Philip Tricca8777b5e2015-09-16 13:14:46 -070035) > ${VARS_FILE}
Philip Triccae690e082015-09-07 18:17:35 -070036
Daniel Mueller30794af2017-01-25 14:46:54 -080037${AUTORECONF} --install --sym