From ab00791f2a820bafb2b663f6953d67e41da4e034 Mon Sep 17 00:00:00 2001 From: Felix Walter Date: Fri, 29 Sep 2023 09:15:57 +0200 Subject: [PATCH] mk: Document current build options in config.mk.example Signed-off-by: Felix Walter --- config.mk.example | 36 +++++++++++++++++++++++++++++------- mk/posix.mk | 1 - 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/config.mk.example b/config.mk.example index 75713ce..54fe27b 100644 --- a/config.mk.example +++ b/config.mk.example @@ -1,20 +1,42 @@ -# Example for Makefile configuration options -# Copy this to config.mk and either download the required software packages -# and extract them to an arbitrary directory or install them -# with your package manager. The variables show the defaults applied by the -# build system automatically. +# Example for build-time configuration options. +# Copy this to `config.mk` and adjust as needed. The values shown below are +# usage examples, whereas the first one is always the default value. -# Toolchain to be used. `gcc` or `clang` can be selected +##################### +# Toolchain options # +##################### + +# Toolchain to be used. `gcc` or `clang` can be selected. Note that this can +# also be specified on the command line, e.g.: `make TOOLCHAIN=clang` #TOOLCHAIN := gcc -# Toolchain prefix for local posix target +# Toolchain prefix, useful for cross-compilation. # can be left empy most of the time (default: search in $PATH) #TOOLCHAIN_POSIX := +#TOOLCHAIN_POSIX := arm-linux-gnueabihf- # Prefix for the Clang compiler #CLANG_PREFIX := +#CLANG_PREFIX := /opt/my-clang-installation/ # --sysroot provided to the Clang compiler, useful for providing the path to # the embedded toolchain so the proper headers are found. # If left empty, the option is not provided to the compiler. #CLANG_SYSROOT_POSIX := + +# Value passed to the compiler via `-march`. If not specified, will use +# `-march=native` on x86/x86_64 platforms and not pass the parameter on others. +#ARCH := +#ARCH := armv7-m + +# Use flags suitable for the macOS linker. If not specified, autodetect. +#EXPECT_MACOS_LINKER := 0 + +# Additional compiler flags. +#CPPFLAGS += + +# Additional linker flags. +#LDFLAGS += + +# Additional flags passed to compiler and linker. +#ARCH_FLAGS += diff --git a/mk/posix.mk b/mk/posix.mk index e4463f6..e1c928b 100644 --- a/mk/posix.mk +++ b/mk/posix.mk @@ -5,7 +5,6 @@ GCC_TOOLCHAIN_PREFIX ?= $(TOOLCHAIN_POSIX) CLANG_PREFIX ?= CLANG_SYSROOT_POSIX ?= CLANG_SYSROOT ?= $(CLANG_SYSROOT_POSIX) -CPU ?= # COMPILER AND LINKER FLAGS