build.sh 885 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Create the Makefile using cmake, from a clean build directory
  3. cd code_boost/src/build/
  4. if [ ${PWD##*/} = 'build' ]; then
  5. # Only delete everything if we are in a folder called 'build'.
  6. rm -rf ./*
  7. else
  8. echo "Error: The 'build' directory was not found."
  9. exit
  10. fi
  11. cmake ..
  12. if [ -f Makefile ]; then
  13. make
  14. else
  15. echo "Error: 'cmake' did not finish successfully."
  16. exit
  17. fi
  18. if [ $? -eq 0 ]; then
  19. cp libpcapreader.so ../../../code/ID2TLib/
  20. else
  21. echo "Error: 'make' did not finish successfully."
  22. exit
  23. fi
  24. cd ../../../
  25. # Create the ID2T script
  26. cat >./id2t <<EOF
  27. #!/bin/sh
  28. # Find the executable
  29. ID2T_DIR=\$(readlink -f \$0)
  30. SCRIPT_PATH=\${ID2T_DIR%/*}
  31. cd \$SCRIPT_PATH
  32. # Execute ID2T
  33. exec ./code/CLI.py "\$@"
  34. EOF
  35. chmod +x ./code/CLI.py
  36. chmod +x ./id2t
  37. echo -e "\n\nAll is set. ID2T is ready."
  38. echo -e "\nRun ID2T with the command './id2t'"