build.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. set -e
  3. cd $(dirname $0)
  4. usage()
  5. {
  6. echo "$0 [-c | --codecov] [-f | --force-config]"
  7. exit 1
  8. }
  9. use_lcov=0
  10. force_config=0
  11. while [ "$1" != "" ]; do
  12. case $1 in
  13. -c | --codecov ) shift
  14. echo "$0: use code coverage specified"
  15. use_lcov=1
  16. ;;
  17. -f | --force-config ) shift
  18. force_config=1
  19. echo "$0: force copy config specified"
  20. ;;
  21. * ) usage
  22. esac
  23. done
  24. echo "Building wpa_supplicant"
  25. cd ../../wpa_supplicant
  26. if [ ! -e .config -o $force_config -eq 1 ]; then
  27. cp ../tests/hwsim/example-wpa_supplicant.config .config
  28. else
  29. echo "wpa_supplicant config file exists"
  30. fi
  31. if [ $use_lcov -eq 1 ]; then
  32. if ! grep -q CONFIG_CODE_COVERAGE .config; then
  33. echo CONFIG_CODE_COVERAGE=y >> .config
  34. else
  35. echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore"
  36. fi
  37. fi
  38. make clean > /dev/null
  39. make QUIET=1 -j8
  40. echo "Building hostapd"
  41. cd ../hostapd
  42. if [ ! -e .config -o $force_config -eq 1 ]; then
  43. cp ../tests/hwsim/example-hostapd.config .config
  44. else
  45. echo "hostapd config file exists"
  46. fi
  47. if [ $use_lcov -eq 1 ]; then
  48. if ! grep -q CONFIG_CODE_COVERAGE .config; then
  49. echo CONFIG_CODE_COVERAGE=y >> .config
  50. else
  51. echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore"
  52. fi
  53. fi
  54. make clean > /dev/null
  55. make QUIET=1 -j8 hostapd hostapd_cli hlr_auc_gw
  56. echo "Building wlantest"
  57. cd ../wlantest
  58. make clean > /dev/null
  59. make QUIET=1 -j8 > /dev/null
  60. echo "Building TNC testing tools"
  61. cd ../tests/hwsim/tnc
  62. make clean > /dev/null
  63. make QUIET=1 -j8
  64. cd ..