7038N/A#! /bin/sh
7038N/A#
7038N/A# This file is used by adlc.make to selectively update generated
7038N/A# adlc files. Because source and target diretories are relative
7038N/A# paths, this file is copied to the target build directory before
7038N/A# use.
7038N/A#
7038N/A# adlc-updater <file> <source-dir> <target-dir>
7038N/A#
7038N/Afix_lines() {
7038N/A # repair bare #line directives in $1 to refer to $2
7038N/A awk < $1 > $1+ '
7038N/A /^#line 999999$/ {print "#line " (NR+1) " \"" F2 "\""; next}
7038N/A {print}
7038N/A ' F2=$2
7038N/A mv $1+ $1
7038N/A}
7038N/Afix_lines $2/$1 $3/$1
7038N/A[ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \
7038N/A( [ -f $3/$1 ] && echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 )
7038N/A