Add toolchain rules
This commit is contained in:
12
bsp/board/rpi/main.mk
Normal file
12
bsp/board/rpi/main.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# Main rules for domo board targets.
|
||||
#
|
||||
#
|
||||
|
||||
.PHONY: all
|
||||
all: msg buildroot
|
||||
|
||||
include ../../bsp/include/rules.mk
|
||||
include ../../bsp/include/buildroot.mk
|
||||
include ../../bsp/include/toolchain.mk
|
||||
include ../../bsp/include/dtb.mk
|
||||
@@ -14,6 +14,12 @@ buildroot.menuconfig: buildroot.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||
@echo "Saving defconfig done."
|
||||
|
||||
toolchain.menuconfig: toolchain.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ menuconfig
|
||||
@echo "Saving defconfig (Waiting) ...."
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||
@echo "Saving defconfig done."
|
||||
|
||||
buildroot.nconfig: buildroot.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ nconfig
|
||||
@echo "Saving defconfig (Waiting) ...."
|
||||
@@ -30,6 +36,11 @@ buildroot.shell: buildroot.config
|
||||
|
||||
buildroot.config: $(BR_STAGING)/buildroot/.config
|
||||
|
||||
toolchain.config: $(BR_PROJECT)/configs/toolchain_defconfig
|
||||
@mkdir -p $(BR_STAGING)/buildroot/
|
||||
@cp $(BR_PROJECT)/configs/toolchain_defconfig $(BR_STAGING)/buildroot/.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ defconfig
|
||||
|
||||
$(BR_STAGING)/buildroot/.config: $(BR_PROJECT)/configs/buildroot_defconfig
|
||||
@mkdir -p $(BR_STAGING)/buildroot/
|
||||
@cp $(BR_PROJECT)/configs/buildroot_defconfig $(BR_STAGING)/buildroot/.config
|
||||
@@ -39,4 +50,4 @@ buildroot.check-package:
|
||||
find $(BR_PROJECT)/../../bsp/buildroot_external/package/ -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) -exec $(BR_PROJECT)/../../bsp/buildroot/utils/check-package -b {} \;
|
||||
|
||||
install.sd:
|
||||
sudo dd if=$(BR_STAGING)/buildroot/images/sdcard.img of=/dev/sdb && sync && sync
|
||||
sudo dd if=$(BR_STAGING)/buildroot/images/sdcard.img of=/dev/sdc && sync && sync
|
||||
|
||||
26
bsp/include/toolchain.mk
Normal file
26
bsp/include/toolchain.mk
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
#
|
||||
|
||||
BR2_EXTERNAL ?= $(BR_PROJECT)/../../bsp/buildroot_external/
|
||||
|
||||
BR_ENV = BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(BR_STAGING)/buildroot/ WORKSPACE_DIR=$(BR_STAGING)
|
||||
BR_ENV += BUILDS_ROOT=$(BR_LOCAL_BUILDS_ROOT) BOARD=$(BR_BOARD) PROJECT=$(BR_PROJECT)
|
||||
BR_ENV += BR2_DEFCONFIG=$(BR_PROJECT)/configs/toolchain_defconfig BR2_DEFCONFIG_FROM_ENV=1
|
||||
BR_ENV += LD_LIBRARY_PATH=$(BR_STAGING)/cross/opt/ext-toolchain/lib/
|
||||
|
||||
toolchain.menuconfig: toolchain.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ menuconfig
|
||||
@echo "Saving defconfig (Waiting) ...."
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ savedefconfig
|
||||
@echo "Saving defconfig done."
|
||||
|
||||
toolchain.config: $(BR_PROJECT)/configs/toolchain_defconfig
|
||||
@mkdir -p $(BR_STAGING)/buildroot/
|
||||
@cp $(BR_PROJECT)/configs/toolchain_defconfig $(BR_STAGING)/buildroot/.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ defconfig
|
||||
|
||||
toolchain: toolchain.config
|
||||
$(MAKE) $(BR_ENV) -C $(BR_PROJECT)/../../bsp/buildroot/ $(BR_TARGET)
|
||||
|
||||
toolchain.archive:
|
||||
$(BR_PROJECT)/../../bsp/scripts/toolchain_build.sh $(BR_STAGING)/cross $(BR_LOCAL_BUILDS_ROOT)/delivery/
|
||||
0
bsp/scripts/clean_external_packages.sh
Normal file → Executable file
0
bsp/scripts/clean_external_packages.sh
Normal file → Executable file
35
bsp/scripts/toolchain_build.sh
Executable file
35
bsp/scripts/toolchain_build.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Catch build Error
|
||||
function error {
|
||||
|
||||
echo "Docker build Failed."
|
||||
exit 1;
|
||||
}
|
||||
|
||||
cross_compiler_path=$1
|
||||
delivery_path=$2
|
||||
|
||||
echo "Cross Compiler Path: $cross_compiler_path"
|
||||
echo "Delivery Path: $delivery_path"
|
||||
|
||||
BASE=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 1 | cut -d '.' -f 1`
|
||||
GCC_VERSION=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 4`
|
||||
VERSION=`$cross_compiler_path/bin/*-*-gcc --version | head -n 1 | cut -d ' ' -f 3 | cut -d '-' -f 1`
|
||||
|
||||
LIBC=unknown
|
||||
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_GLIBC
|
||||
if test $? -eq 0; then LIBC=glibc; fi
|
||||
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_UCLIBC
|
||||
if test $? -eq 0; then LIBC=uclibc; fi
|
||||
cat configs/toolchain_defconfig | grep BR2_TOOLCHAIN_BUILDROOT_MUSL
|
||||
if test $? -eq 0; then LIBC=musl; fi
|
||||
|
||||
echo "BASE: $BASE"
|
||||
echo "GCC_VERSION: $GCC_VERSION"
|
||||
echo "VERSION: $VERSION"
|
||||
echo "LIBC: $LIBC"
|
||||
|
||||
mkdir -p $delivery_path
|
||||
cd $cross_compiler_path
|
||||
tar cvzf $delivery_path/toochain_${BASE}-${GCC_VERSION}-${LIBC}-${VERSION}.tgz .
|
||||
Reference in New Issue
Block a user