Commit c86a191b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Change table.h generator to work in VPATH builds.

parent aa6c43c6
......@@ -3,8 +3,8 @@
# gen_tables create the headerfile table.h
# with all default tables from default_tables
#
DEFTABLES=default_tables
OFILE=table.h
DEFTABLES=@abs_top_srcdir@/tables/default_tables
OFILE=@abs_top_srcdir@/src/table.h
PTFILES=""
#
#########################################
......@@ -18,6 +18,7 @@ while true ; do
read -u3 PTFILE[item]
if [ -z ${PTFILE[item]} ] ; then break ; fi
#
PTFILE[item]="@abs_srcdir@/${PTFILE[item]}"
PTFILES="${PTFILES} ${PTFILE[item]}"
#
item=`expr $item + 1`
......@@ -39,7 +40,7 @@ EOF
for TFILE in $PTFILES; do
echo "process: $TFILE"
rm -f ptfile
../../cdi/app/createtable $TFILE ptfile
../app/createtable $TFILE ptfile
cat ptfile >> $OFILE
done
#
......@@ -60,6 +61,7 @@ settabvar() {
item=0
while [ $item -lt $NTABLES ] ; do
TFILE=${PTFILE[item]}
TFBASENAME="${TFILE##*/}"
echo "process: $TFILE"
#
TABLE_ID=`settabvar ${TFILE} "TABLE_ID"`
......@@ -70,18 +72,18 @@ TABLE_CE=`settabvar ${TFILE} "TABLE_CE"`
TABLE_SU=`settabvar ${TFILE} "TABLE_SU"`
#
if [ -z $TABLE_ID ] ; then TABLE_ID=0; fi
if [ -z $TABLE_NA ] ; then TABLE_NA=$TFILE; fi
if [ -z $TABLE_NA ] ; then TABLE_NA=$TFBASENAME; fi
#if [ -z $TABLE_MO ] ; then TABLE_MO=NULL; fi
if [ -z $TABLE_CE ] ; then TABLE_CE=0; fi
if [ -z $TABLE_SU ] ; then TABLE_SU=0; fi
#
echo "ID = $TABLE_ID name=$TABLE_NA model=$TABLE_MO inistitut=$TABLE_IN center=$TABLE_CE subcenter=$TABLE_SU"
TABLENAME=`echo ${TFILE} | sed -e "s/\./_/g" `
TABLENAME=`echo ${TFBASENAME} | sed -e "s/\./_/g" `
#
cat >> $OFILE <<EOF
/*
* define table : ${TFILE}
* define table : ${TFBASENAME}
*/
instID = institutInq(${TABLE_CE}, ${TABLE_SU}, "${TABLE_IN}", NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment