build-linux.sh 955 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. dir=$PWD
  3. arch=$1
  4. if [ -z "$arch" ]; then
  5. echo "Specify if 32 or 64 arch sync"
  6. exit 1
  7. fi
  8. shift 1
  9. echo "Syncing code in 2 seconds"
  10. sleep 2
  11. ./mock-sync.sh $arch
  12. if [ "$arch" = "32" ]; then
  13. suffix="x86"
  14. else
  15. suffix="x86_64"
  16. fi
  17. if [ -r ./mock-config.txt ]; then
  18. . ./mock-config.txt
  19. else
  20. echo "Missing mock-config.txt"
  21. exit 1
  22. fi
  23. if [ $arch -eq 32 ]; then
  24. ROOT=$ROOT32
  25. elif [ $arch -eq 64 ]; then
  26. ROOT=$ROOT64
  27. else
  28. echo "Pick a correct sync arch (32 or 64)"
  29. exit 1
  30. fi
  31. root=`mock -r $ROOT --print-root-path`/builddir
  32. cat > $root/$dst_root/build.sh <<EOSCRIPT
  33. cd /builddir/$dst_root
  34. mkdir -p build
  35. cd build
  36. cmake28 $cmake_path -DCMAKE_BUILD_TYPE=Release $cmake_options
  37. make -j4
  38. make -j4 AmnesiaSteam
  39. cd ..
  40. EOSCRIPT
  41. echo "Starting build in 2 seconds"
  42. sleep 2
  43. ./mock-shell.sh $arch -- "cd builddir/$dst_root; bash ./build.sh;"
  44. mkdir -p ./Release/
  45. cp $root/$dst_root/build/*.bin.$suffix ./Release/