installheaders.sh 393 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # installheaders.sh - install header files
  3. # usage: installheaders.sh srcdir destdir
  4. # srcdir/*.h is copied to destdir, if different.
  5. #
  6. if [ $# != 2 ]; then
  7. echo "$0: Usage: $0 srcdir destdir" 1>&2
  8. exit 1
  9. fi
  10. for H in "$1"/*.h; do
  11. BH=`basename "$H"`
  12. if diff "$H" "$2/$BH" >/dev/null 2>&1; then
  13. :
  14. else
  15. echo cp "$H" "$2/$BH"
  16. cp "$H" "$2/$BH"
  17. fi
  18. done