Skip to content

Instantly share code, notes, and snippets.

@fuzzamos
Forked from richinseattle/afl_build.sh
Created May 25, 2019 11:56
Show Gist options
  • Select an option

  • Save fuzzamos/aa6523058af6dec8a0125a5d8d660287 to your computer and use it in GitHub Desktop.

Select an option

Save fuzzamos/aa6523058af6dec8a0125a5d8d660287 to your computer and use it in GitHub Desktop.
#!/bin/bash
# installs dependenies and builds ubuntu package from source
# set CC / CXX environment variables as needed
USAGE="$0 <apt package> ..."
if [ $# -lt 1 ]; then
echo "$USAGE"
exit 1
fi
CPU_COUNT=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)
while (($#)); do
FUZZ_TARGET=$1
mkdir -p /tmp/$FUZZ_TARGET && \
cd /tmp/$FUZZ_TARGET && \
sudo apt-get build-dep -y $FUZZ_TARGET && \
apt-get source -y $FUZZ_TARGET && \
cd * && \
sudo dpkg-buildpackage -uc -us -j $(( $CPU_COUNT -1 ))
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment