1#!/bin/sh 2# 3# Generate credits_*.h headers from the ext/*/CREDITS and sapi/*/CREDITS files. 4 5# Go to project root directory 6cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" || exit 7 8awkprog=' 9BEGIN { FS = "\n|\r\n|\r"; RS = "" } 10{ print "CREDIT_LINE(\""$1"\", \""$2"\");" }' 11 12for what in ext sapi 13do 14 file=ext/standard/credits_$what.h 15 cat >$file <<END 16/* 17 DO NOT EDIT THIS FILE! 18 19 it has been automatically created by scripts/dev/credits from 20 the information found in the various ext/.../CREDITS and 21 sapi/.../CREDITS files 22 23 if you want to change an entry you have to edit the appropriate 24 CREDITS file instead 25 26*/ 27 28END 29 # Do not process skeleton 30 files=`find "$what" -name CREDITS | grep -v "$what"/skeleton/CREDITS` 31 awk "$awkprog" $files | LC_ALL=C sort -f | uniq >> $file 32 echo "Updated $file" 33done 34