build.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. cd ../../wpa_supplicant
  25. if [ ! -e .config -o $force_config -eq 1 ]; then
  26. cp ../tests/hwsim/example-wpa_supplicant.config .config
  27. else
  28. echo "wpa_supplicant config file exists"
  29. fi
  30. if [ $use_lcov -eq 1 ]; then
  31. if ! grep -q CONFIG_CODE_COVERAGE .config; then
  32. echo CONFIG_CODE_COVERAGE=y >> .config
  33. else
  34. echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore"
  35. fi
  36. fi
  37. make clean
  38. make -j8
  39. cd ../hostapd
  40. if [ ! -e .config -o $force_config -eq 1 ]; then
  41. cp ../tests/hwsim/example-hostapd.config .config
  42. else
  43. echo "hostapd config file exists"
  44. fi
  45. if [ $use_lcov -eq 1 ]; then
  46. if ! grep -q CONFIG_CODE_COVERAGE .config; then
  47. echo CONFIG_CODE_COVERAGE=y >> .config
  48. else
  49. echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore"
  50. fi
  51. fi
  52. make clean
  53. make -j8 hostapd hlr_auc_gw
  54. cd ../wlantest
  55. make clean
  56. make -j8
  57. cd ../tests/hwsim/tnc
  58. make clean
  59. make -j8
  60. cd ..