You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

  1. #!/bin/sh
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements. See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. #
  19. # pretty-make
  20. #
  21. # This script helps in pretty-printing of build commands.
  22. # We invoke it via overridden rules in Makefile.am
  23. #
  24. # $Id: pretty-make 904065 2010-01-28 12:31:53Z borisk $
  25. #
  26. # Grab the action (what we're doing)
  27. action=$1
  28. shift
  29. # Grab the original command
  30. cmd=$@
  31. # Try to find the name of the file we're building. This is fraught with
  32. # problems, and may not be reliable across all compilers. Given the
  33. # dependencies, this is usually the last argument, but sometimes libtool
  34. # adds additional flags, which throws this off. So we look
  35. # for the last arg that doesn't start with - or + (HP aCC style).
  36. while [ $# -gt 0 ]; do
  37. case ${1} in
  38. -*)
  39. ;;
  40. +*)
  41. ;;
  42. *)
  43. target=$1
  44. ;;
  45. esac
  46. shift
  47. done
  48. # Notify user of the action, and what it's operating on
  49. echo $action $target
  50. # Be verbose if requested
  51. [ ${VERBOSE} ] && echo $cmd
  52. # Execute the original command
  53. $cmd