b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | cd $(dirname $0) |
| 6 | |
| 7 | usage() |
| 8 | { |
| 9 | echo "$0 [-c | --codecov] [-f | --force-config]" |
| 10 | exit 1 |
| 11 | } |
| 12 | |
| 13 | use_lcov=0 |
| 14 | force_config=0 |
| 15 | while [ "$1" != "" ]; do |
| 16 | case $1 in |
| 17 | -c | --codecov ) shift |
| 18 | echo "$0: use code coverage specified" |
| 19 | use_lcov=1 |
| 20 | ;; |
| 21 | -f | --force-config ) shift |
| 22 | force_config=1 |
| 23 | echo "$0: force copy config specified" |
| 24 | ;; |
| 25 | * ) usage |
| 26 | esac |
| 27 | done |
| 28 | |
| 29 | JOBS=`nproc` |
| 30 | if [ -z "$ABC" ]; then |
| 31 | JOBS=8 |
| 32 | fi |
| 33 | |
| 34 | echo "Building TNC testing tools" |
| 35 | cd tnc |
| 36 | make QUIET=1 -j$JOBS |
| 37 | |
| 38 | echo "Building wlantest" |
| 39 | cd ../../../wlantest |
| 40 | make QUIET=1 -j$JOBS > /dev/null |
| 41 | |
| 42 | echo "Building hs20-osu-client" |
| 43 | cd ../hs20/client/ |
| 44 | make QUIET=1 CONFIG_NO_BROWSER=1 |
| 45 | |
| 46 | echo "Building hostapd" |
| 47 | cd ../../hostapd |
| 48 | if [ ! -e .config -o $force_config -eq 1 ]; then |
| 49 | if ! cmp ../tests/hwsim/example-hostapd.config .config >/dev/null 2>&1 ; then |
| 50 | cp ../tests/hwsim/example-hostapd.config .config |
| 51 | fi |
| 52 | fi |
| 53 | |
| 54 | if [ $use_lcov -eq 1 ]; then |
| 55 | if ! grep -q CONFIG_CODE_COVERAGE .config; then |
| 56 | echo CONFIG_CODE_COVERAGE=y >> .config |
| 57 | else |
| 58 | echo "CONFIG_CODE_COVERAGE already exists in hostapd/.config. Ignore" |
| 59 | fi |
| 60 | fi |
| 61 | |
| 62 | make QUIET=1 -j$JOBS hostapd hostapd_cli hlr_auc_gw |
| 63 | |
| 64 | echo "Building wpa_supplicant" |
| 65 | cd ../wpa_supplicant |
| 66 | if [ ! -e .config -o $force_config -eq 1 ]; then |
| 67 | if ! cmp ../tests/hwsim/example-wpa_supplicant.config .config >/dev/null 2>&1 ; then |
| 68 | cp ../tests/hwsim/example-wpa_supplicant.config .config |
| 69 | fi |
| 70 | fi |
| 71 | |
| 72 | if [ $use_lcov -eq 1 ]; then |
| 73 | if ! grep -q CONFIG_CODE_COVERAGE .config; then |
| 74 | echo CONFIG_CODE_COVERAGE=y >> .config |
| 75 | else |
| 76 | echo "CONFIG_CODE_COVERAGE already exists in wpa_supplicant/.config. Ignore" |
| 77 | fi |
| 78 | fi |
| 79 | |
| 80 | if [ -z $FIPSLD_CC ]; then |
| 81 | export FIPSLD_CC=gcc |
| 82 | fi |
| 83 | make QUIET=1 -j$JOBS |