• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Common Makefile Rules
3#
4
5# Environment Checks ###########################################################
6
7ifeq ($(OPT_LEVEL),)
8$(warning The OPT_LEVEL variable is unset. Defaulting to 0.)
9OPT_LEVEL = 0
10endif
11
12ifeq ($(OUTPUT_NAME),)
13$(error "The OUTPUT_NAME variable must be set to the name of the desired \
14         binary. Example: OUTPUT_NAME = my_nanoapp")
15endif
16
17# Define all ###################################################################
18
19# All is defined here as the first target which causes make to build all by
20# default when no targets are supplied.
21.PHONY: all
22all:
23
24# If no make command goals are specified, default to all. At least one target
25# is required for environment checks. Building all will require toolchains for
26# all supported architectures which may not be desirable.
27ifeq ($(MAKECMDGOALS),)
28MAKECMDGOALS = all
29endif
30
31# Variant-specific Support Source Files ########################################
32
33SYS_SUPPORT_PATH = $(CHRE_PREFIX)/build/sys_support
34
35# Host Toolchain ###############################################################
36
37# The host toolchain is used to compile any programs for the compilation host
38# in order to complete the build.
39
40ifeq ($(CHRE_HOST_CC),)
41CHRE_HOST_CC = g++
42endif
43
44# Makefile Includes ############################################################
45
46# Common Includes
47include $(CHRE_PREFIX)/build/clean.mk
48include $(CHRE_PREFIX)/build/tools_config.mk
49
50# Flag config
51include $(CHRE_PREFIX)/build/embedded_flags.mk
52
53# NanoPB Source Generation
54include $(CHRE_PREFIX)/build/nanopb.mk
55
56# TFLM Sources
57include $(CHRE_PREFIX)/external/tflm/tflm.mk
58
59# Rust config
60include $(CHRE_PREFIX)/build/rust/common_rust_config.mk