1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/aix/adlc_updater Fri Sep 06 20:08:29 2013 +0200 1.3 @@ -0,0 +1,20 @@ 1.4 +#! /bin/sh 1.5 +# 1.6 +# This file is used by adlc.make to selectively update generated 1.7 +# adlc files. Because source and target diretories are relative 1.8 +# paths, this file is copied to the target build directory before 1.9 +# use. 1.10 +# 1.11 +# adlc-updater <file> <source-dir> <target-dir> 1.12 +# 1.13 +fix_lines() { 1.14 + # repair bare #line directives in $1 to refer to $2 1.15 + awk < $1 > $1+ ' 1.16 + /^#line 999999$/ {print "#line " (NR+1) " \"" F2 "\""; next} 1.17 + {print} 1.18 + ' F2=$2 1.19 + mv $1+ $1 1.20 +} 1.21 +fix_lines $2/$1 $3/$1 1.22 +[ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \ 1.23 +( [ -f $3/$1 ] && echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 )