regenmakefiles.sh 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. #
  3. # Check directory
  4. #
  5. if [ -z "$1" ]; then
  6. PACKAGEDIR=$(pwd)
  7. else
  8. PACKAGEDIR=$1
  9. if [ ! -d $PACKAGEDIR ]; then
  10. echo "The directory $PACKAGEDIR does not exist"
  11. exit 1
  12. fi
  13. fi
  14. #
  15. # Check package dir ?
  16. #
  17. if [ ! -f $PACKAGEDIR/build/Makefile.pkg ]; then
  18. echo "This script must be executed in the rtl directory or have an argument to specify the package directory"
  19. exit 1
  20. fi
  21. #
  22. # fpcmake to use
  23. #
  24. if [ -e $PACKAGEDIR/../utils/fpcm/fpcmake ]; then
  25. FPCMAKE=$PACKAGEDIR/../utils/fpcm/fpcmake
  26. else
  27. FPCMAKE=fpcmake
  28. fi
  29. #
  30. # Go
  31. #
  32. echo "Using fpcmake: $FPCMAKE"
  33. #
  34. # Main
  35. #
  36. cd $PACKAGEDIR
  37. echo "Doing package toplevel dir: $PACKAGEDIR"
  38. $FPCMAKE -q -Tall
  39. cd $PACKAGEDIR
  40. echo "Recreating Makefile in directory $PACKAGEDIR/build"
  41. $FPCMAKE -Tall -q -o Makefile.pkg $PACKAGEDIR/build/Makefile.fpc
  42. sed -i '/PACKAGE_NAME=fcl/ d' $PACKAGEDIR/build/Makefile.pkg
  43. echo "Recreating Makefile in directory $PACKAGEDIR/fpmkunit"
  44. $FPCMAKE -Tall -q $PACKAGEDIR/fpmkunit/Makefile.fpc