mkwindeps.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/env bash
  2. # tools/mkwindeps.sh
  3. #
  4. # Licensed to the Apache Software Foundation (ASF) under one or more
  5. # contributor license agreements. See the NOTICE file distributed with
  6. # this work for additional information regarding copyright ownership. The
  7. # ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance with the
  9. # License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. # License for the specific language governing permissions and limitations
  17. # under the License.
  18. #
  19. # Uncomment to enable debug options
  20. # set -x
  21. # DEBUG=--dep-debug
  22. # Make sure that we know where we are
  23. TOOLDIR=$(dirname $0)
  24. if [ ! -x ${TOOLDIR}/mkwindeps.sh ]; then
  25. echo "# ERROR: tools/ directory not found"
  26. exit 1
  27. fi
  28. # Make sure that executables are ready
  29. MKDEPS=${TOOLDIR}/mkdeps.exe
  30. CNVWINDEPS=${TOOLDIR}/cnvwindeps.exe
  31. if [ ! -x ${MKDEPS} ]; then
  32. echo "# ERROR: tools/mkdeps.exe does not exist"
  33. exit 1
  34. fi
  35. if [ ! -x ${CNVWINDEPS} ]; then
  36. echo "# ERROR: tools/cnvwindeps.exe does not exist"
  37. exit 1
  38. fi
  39. # Run the mkdeps.exe program to generate a Windows dependency file
  40. TMPFILE=$(mktemp)
  41. ${MKDEPS} ${DEBUG} --winpath $* > ${TMPFILE} || { echo "# ERROR: mkdeps.exe failed"; exit 1; }
  42. # Then convert this to a POSIX dependency file (on stdout)
  43. ${CNVWINDEPS} ${TMPFILE}
  44. rm -f ${TMPFILE}