Last active
November 11, 2016 17:55
-
-
Save mkresin/a263c2de94285898aecb281a3773ceee to your computer and use it in GitHub Desktop.
compile all LEDE boards of a given target: ~/compile_all_boards lantiq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
CPUS=9 | |
PLATFORM="$1" | |
PLATFORMDIR="target/linux/$PLATFORM" | |
function build { | |
cat << EOF > .config | |
CONFIG_TARGET_${PLATFORM}=y | |
CONFIG_TARGET_MULTI_PROFILE=y | |
CONFIG_TARGET_ALL_PROFILES=y | |
CONFIG_TARGET_PER_DEVICE_ROOTFS=y | |
EOF | |
[ -n "${SUBTARGET}" ] && { | |
echo "CONFIG_TARGET_${PLATFORM}_${SUBTARGET}=y" >> .config | |
echo "${SUBTARGET}" | |
} | |
make defconfig && make clean && make -j$CPUS BUILD_LOG=1 | |
} | |
if [ -z "$PLATFORM" ] || [ ! -d "$PLATFORMDIR" ]; then | |
echo "Missing parameter or unknown platform supplied" | |
exit | |
fi | |
SUBTARGETS=$(grep 'SUBTARGETS:=' "$PLATFORMDIR/Makefile") | |
# enable logging | |
rm build.log | |
exec > >(tee -a build.log) | |
exec 2> >(tee -a build.log >&2) | |
if [ -z "${SUBTARGETS}" ]; then | |
build | |
else | |
for SUBTARGET in ${SUBTARGETS#SUBTARGETS:=}; do | |
build | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment