home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / automake-1.1e-bin.lha / share / automake / ylwrap < prev   
Encoding:
Text File  |  1996-10-12  |  1.1 KB  |  41 lines

  1. #! /bin/sh
  2. # ylwrap - wrapper for lex/yacc invocations.
  3. # Written by Tom Tromey <tromey@cygnus.com>, Aug 11 1996
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  
  19. # The program to run.
  20. prog="$1"
  21.  
  22. # The output file the program generates, eg `y.tab.c'.
  23. progoutput="$2"
  24.  
  25. # The output file we actually want.
  26. realoutput="$3"
  27.  
  28. # Strip arguments we've used; remaining arguments go to PROG.
  29. shift
  30. shift
  31. shift
  32.  
  33. $prog ${1+"$@"} || exit $?
  34.  
  35. if test -f "$progoutput"; then
  36.    mv "$progoutput" "$realoutput" || exit $?
  37. else
  38.    exit 1
  39. fi
  40. exit 0
  41.