-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
use_arm_gcc.mk
30 lines (26 loc) · 1.04 KB
/
use_arm_gcc.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ifeq ($(TRGT),)
UNAME_SM := $(shell uname -sm)
$(info UNAME_SM: $(UNAME_SM))
ifeq ($(firstword $(UNAME_SM)),Darwin)
COMPILER_PLATFORM = arm-gnu-toolchain-11.3.rel1-darwin-x86_64-arm-none-eabi
else ifeq ($(UNAME_SM),Linux x86_64)
COMPILER_PLATFORM = arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi
else
$(error Looks like your platform, $(UNAME_SM), doesn't have a supported compiler!)
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))