build.sh 1.5 KB

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