put compilers in a submodule (#360)

* add compiler submodule

* use compiler from git if not found on path

* add todo

* select darwin vs. linux properly

* update submodule for darwin compiler

* match formatting

* hide stray ramdisk images

* lfs: true

* lfs in the right spot?

* console doesn't need lfs

* all builds that touch self hosted server can use lfs

* don't ever bother trying to use the installed compiler

* simplify and print a little more info

* remove old submodule

* add build tools submodule

* fix path

* we don't need lfs

* no need to test compiler

* set a branch

* allow passing compiler, auto-submodule if missing

* missing endif
This commit is contained in:
Matthew Kennedy 2024-02-13 14:44:15 -08:00 committed by GitHub
parent 176d5af7c8
commit 1a0ef4fbff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 64 additions and 19 deletions

View File

@ -312,10 +312,6 @@ jobs:
# ./firmware/provide_gcc.sh
# echo "::add-path::`pwd`/gcc-arm-none-eabi/bin"
# Make sure the compiler we just downloaded works - just print out the version
- name: Test Compiler
run: arm-none-eabi-gcc -v
# - name: Configs Set SSH variables
# if: ${{ env.full == 'true' && env.upload == 'true' }}
# env:

View File

@ -43,10 +43,6 @@ jobs:
- name: Add compiler to PATH
run: echo "$HOME/.rusefi-tools/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_PATH
# Make sure the compiler works
- name: Test/Identify Compiler
run: arm-none-eabi-gcc -v
- name: Set EXTRA env
run: |
echo "EXTRA_2_PARAMS=-DHARDWARE_CI" >> $GITHUB_ENV

28
.gitignore vendored
View File

@ -31,3 +31,31 @@ gitversion.h.gen
# FOME simulator makes logs, ignore those
fome_simulator_log.mlg
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

4
.gitmodules vendored
View File

@ -39,3 +39,7 @@
[submodule "firmware/libfirmware"]
path = firmware/libfirmware
url = https://github.com/rusefi/libfirmware.git
[submodule "firmware/ext/build-tools"]
path = firmware/ext/build-tools
url = https://github.com/FOME-Tech/build-tools.git
branch = main

1
firmware/.gitignore vendored
View File

@ -4,6 +4,7 @@ gen_*.log
deliver/
rusefi_tool.log
build*
ramdisk.image
# precompiled headers
*.h.gch

View File

@ -292,11 +292,8 @@ INCDIR = \
# Compiler settings
#
ifeq ($(CROSS_COMPILE),)
TRGT = arm-none-eabi-
else
TRGT = $(CROSS_COMPILE)
endif
include $(PROJECT_DIR)/use_arm_gcc.mk
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.

View File

@ -281,12 +281,8 @@ BUILDDIR=blbuild
MCU = cortex-m4
ifeq ($(CROSS_COMPILE),)
#TRGT = arm-elf-
TRGT = arm-none-eabi-
else
TRGT = $(CROSS_COMPILE)
endif
include $(PROJECT_DIR)/use_arm_gcc.mk
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.

@ -0,0 +1 @@
Subproject commit f301fe169e44185753554fbf747ba21f1e6a3114

26
firmware/use_arm_gcc.mk Normal file
View File

@ -0,0 +1,26 @@
ifeq ($(TRGT),)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
COMPILER_PLATFORM = arm-gnu-toolchain-11.3.rel1-darwin-x86_64-arm-none-eabi
else
COMPILER_PLATFORM = arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi
endif
BUILD_TOOLS_DIR = $(PROJECT_DIR)/ext/build-tools/
TRGT = $(BUILD_TOOLS_DIR)$(COMPILER_PLATFORM)/bin/arm-none-eabi-
# If the compiler doesn't exist, try to update the build tools submodule
ifeq ("$(wildcard $(TRGT)g++)","")
$(info Compiler at $(TRGT)g++ not found, trying to update build-tools submodule...")
$(shell git submodule update --init --depth=1 $(BUILD_TOOLS_DIR))
$(error Please re-run make to execute build!)
endif
else
# If the compiler doesn't exist, fault now
ifeq ("$(wildcard $(TRGT)g++)","")
$(error Compiler not found at $(TRGT)g++!)
endif
endif
$(info COMPILER_PLATFORM: $(COMPILER_PLATFORM))
$(info TRGT: $(TRGT))