Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

buildall.bash 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. ###| Builder Script |###
  3. #
  4. # Builds all permutations of modules
  5. # This script is an attempt to maintain module sanity as new ones are added
  6. #
  7. # Fortunately, sweeping API changes don't happen much anymore...but just in case...
  8. #
  9. # Written by Jacob Alexander 2013 for the Kiibohd Controller
  10. # Released into the Public Domain
  11. #
  12. ###
  13. ## TODO List ##
  14. # - Complete non-Scan module permutations (will take extra work)
  15. # - Add command line arguments
  16. # - Add help flag for usage
  17. # - Make sure the script is being run from the correct directory
  18. main() {
  19. ERROR="\e[5;1;31mERROR\e[0m:"
  20. failCount=0
  21. # Scan for list of Scan Modules
  22. scanModules=$(ls Scan)
  23. # Prune out "invalid" modules (parent modules)
  24. scanModules=${scanModules[@]//matrix/}
  25. # Create permutation directories
  26. # Then run cmake, and run each build permutation
  27. # Keeping track of how many builds failed/passed
  28. for module in $scanModules; do
  29. # Create directory, but do not error if it exists already
  30. mkdir -p build/$module
  31. cd build/$module
  32. # Make sure CMake has been run, and attempt to build
  33. cmake -DScanModuleOverride=$module ../.. && make || let failCount++
  34. # Cleanup, for the next build
  35. cd - > /dev/null
  36. done
  37. totalModules=$(echo $scanModules | wc -w)
  38. if (( failCount > 0 )); then
  39. echo -e "$ERROR $failCount/$totalModules failed"
  40. else
  41. echo -e "Build Success!"
  42. fi
  43. }
  44. #| Main Script Entry
  45. main "$@"
  46. exit 0