Philip Tricca | 8777b5e | 2015-09-16 13:14:46 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | set -e |
Philip Tricca | d1952b4 | 2015-08-05 15:52:10 -0700 | [diff] [blame] | 3 | |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 4 | # generate list of source files for use in Makefile.am |
| 5 | # if you add new source files, you must run ./bootstrap again |
Philip Tricca | 8777b5e | 2015-09-16 13:14:46 -0700 | [diff] [blame] | 6 | src_listvar () { |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 7 | basedir=$1 |
| 8 | suffix=$2 |
| 9 | var=$3 |
| 10 | |
David R. Bild | 8b3c6d9 | 2017-11-28 10:34:23 -0600 | [diff] [blame] | 11 | find "${basedir}" -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (printf "${var} = " && cat) |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 12 | echo "" |
| 13 | } |
| 14 | |
| 15 | VARS_FILE=src_vars.mk |
Daniel Mueller | 30794af | 2017-01-25 14:46:54 -0800 | [diff] [blame] | 16 | AUTORECONF=${AUTORECONF:-autoreconf} |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 17 | |
| 18 | echo "Generating file lists: ${VARS_FILE}" |
Philip Tricca | 8777b5e | 2015-09-16 13:14:46 -0700 | [diff] [blame] | 19 | ( |
Philip Tricca | 57360da | 2018-03-15 17:22:10 -0700 | [diff] [blame] | 20 | 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 Tricca | d5a6ff4 | 2018-03-13 18:19:42 -0700 | [diff] [blame] | 24 | 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 Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 27 | |
Philip Tricca | 0013d84 | 2018-03-13 18:33:00 -0700 | [diff] [blame] | 28 | 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 Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 31 | |
Philip Tricca | ee73062 | 2018-03-10 16:40:41 -0800 | [diff] [blame] | 32 | 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 Tricca | 8777b5e | 2015-09-16 13:14:46 -0700 | [diff] [blame] | 35 | ) > ${VARS_FILE} |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 36 | |
Daniel Mueller | 30794af | 2017-01-25 14:46:54 -0800 | [diff] [blame] | 37 | ${AUTORECONF} --install --sym |