build-codecov.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. LOGDIR=$1
  3. DIR=$PWD
  4. TMPDIR=/tmp/logs
  5. if [ -e $TMPDIR ]; then
  6. echo "$TMPDIR exists - cannot prepare build trees"
  7. exit 1
  8. fi
  9. mkdir $TMPDIR
  10. echo "Preparing separate build trees for hostapd/wpa_supplicant"
  11. cd ../../..
  12. git archive --format=tar --prefix=hostap/ HEAD > $TMPDIR/hostap.tar
  13. cd $DIR
  14. cat ../../../wpa_supplicant/.config > $TMPDIR/wpa_supplicant.config
  15. echo "CONFIG_CODE_COVERAGE=y" >> $TMPDIR/wpa_supplicant.config
  16. cat ../../../hostapd/.config > $TMPDIR/hostapd.config
  17. echo "CONFIG_CODE_COVERAGE=y" >> $TMPDIR/hostapd.config
  18. cd $TMPDIR
  19. tar xf hostap.tar
  20. mv hostap alt-wpa_supplicant
  21. mv wpa_supplicant.config alt-wpa_supplicant/wpa_supplicant/.config
  22. tar xf hostap.tar
  23. mv hostap alt-hostapd
  24. cp hostapd.config alt-hostapd/hostapd/.config
  25. tar xf hostap.tar
  26. mv hostap alt-hostapd-as
  27. cp hostapd.config alt-hostapd-as/hostapd/.config
  28. tar xf hostap.tar
  29. mv hostap alt-hlr_auc_gw
  30. mv hostapd.config alt-hlr_auc_gw/hostapd/.config
  31. rm hostap.tar
  32. cd $TMPDIR/alt-wpa_supplicant/wpa_supplicant
  33. echo "Building wpa_supplicant"
  34. make -j8 > /dev/null
  35. cd $TMPDIR/alt-hostapd/hostapd
  36. echo "Building hostapd"
  37. make -j8 hostapd hostapd_cli > /dev/null
  38. cd $TMPDIR/alt-hostapd-as/hostapd
  39. echo "Building hostapd (AS)"
  40. make -j8 hostapd hostapd_cli > /dev/null
  41. cd $TMPDIR/alt-hlr_auc_gw/hostapd
  42. echo "Building hlr_auc_gw"
  43. make -j8 hlr_auc_gw > /dev/null
  44. cd $DIR
  45. mv $TMPDIR/alt-wpa_supplicant $LOGDIR
  46. mv $TMPDIR/alt-hostapd $LOGDIR
  47. mv $TMPDIR/alt-hostapd-as $LOGDIR
  48. mv $TMPDIR/alt-hlr_auc_gw $LOGDIR