From 2338b9b791fbe13e3af95dde3238df80ac99efbb Mon Sep 17 00:00:00 2001 From: akuker Date: Thu, 27 Aug 2020 23:16:23 -0500 Subject: [PATCH] Updated makefile to cross-compile and updated github workflow to install tools --- .github/workflows/c-cpp.yml | 8 ++------ src/raspberrypi/Makefile | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 10ed4522..91788633 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -12,16 +12,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install cross compile toolchain + run: sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf - uses: actions/checkout@v2 -# - name: configure -# run: ./configure - name: make run: make all DEBUG=1 working-directory: ./src/raspberrypi -# - name: make check -# run: make check -# - name: make distcheck -# run: make distcheck # buildroot-image: # runs-on: ubuntu-latest diff --git a/src/raspberrypi/Makefile b/src/raspberrypi/Makefile index 71c0f07c..0ea3860b 100644 --- a/src/raspberrypi/Makefile +++ b/src/raspberrypi/Makefile @@ -1,7 +1,10 @@ .DEFAULT_GOAL: all -CC = gcc -CXX = g++ +ARCH ?= arm +CROSS_COMPILE ?= arm-linux-gnueabihf- + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ DEBUG ?= 0 ifeq ($(DEBUG), 1)