build_all.sh 840 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/sh
  2. # build development version of the compiler; can be rerun safely
  3. set -u # error on undefined variables
  4. set -e # exit on first error
  5. echo_run(){
  6. printf "\n$*\n"
  7. "$@"
  8. }
  9. [ -d csources ] || echo_run git clone --depth 1 https://github.com/nim-lang/csources.git
  10. nim_csources=bin/nim_csources
  11. build_nim_csources(){
  12. ## avoid changing dir in case of failure
  13. (
  14. echo_run cd csources
  15. echo_run sh build.sh $@
  16. )
  17. # keep $nim_csources in case needed to investigate bootstrap issues
  18. # without having to rebuild from csources
  19. echo_run cp bin/nim $nim_csources
  20. }
  21. [ -f $nim_csources ] || echo_run build_nim_csources $@
  22. # Note: if fails, may need to `cd csources && git pull`
  23. echo_run bin/nim c --skipUserCfg --skipParentCfg koch
  24. echo_run ./koch boot -d:release
  25. echo_run ./koch tools # Compile Nimble and other tools.