From aad8d06c3f0f3a248c983c6186db7f8d439059c1 Mon Sep 17 00:00:00 2001 From: Tido Klaassen Date: Tue, 6 Oct 2015 08:04:14 +0200 Subject: [PATCH] make: rename CFLAGS in target Makefiles to TGT_CFLAGS Renamed every instance of variable CFLAGS in target specific Makefiles to TGT_CFLAGS to free up CFLAGS for user defined compiler flags. Added information in README.md about existence and usage of CFLAGS environment variable in build process. --- README.md | 12 ++++++++++++ lib/Makefile.include | 2 +- lib/efm32/efm32g/Makefile | 4 ++-- lib/efm32/efm32gg/Makefile | 4 ++-- lib/efm32/efm32lg/Makefile | 4 ++-- lib/efm32/efm32tg/Makefile | 4 ++-- lib/lm3s/Makefile | 4 ++-- lib/lm4f/Makefile | 4 ++-- lib/lpc13xx/Makefile | 4 ++-- lib/lpc17xx/Makefile | 4 ++-- lib/lpc43xx/m0/Makefile | 4 ++-- lib/lpc43xx/m4/Makefile | 4 ++-- lib/sam/3a/Makefile | 4 ++-- lib/sam/3n/Makefile | 4 ++-- lib/sam/3s/Makefile | 4 ++-- lib/sam/3u/Makefile | 4 ++-- lib/sam/3x/Makefile | 4 ++-- lib/stm32/f0/Makefile | 4 ++-- lib/stm32/f1/Makefile | 4 ++-- lib/stm32/f2/Makefile | 4 ++-- lib/stm32/f3/Makefile | 4 ++-- lib/stm32/f4/Makefile | 4 ++-- lib/stm32/l0/Makefile | 4 ++-- lib/stm32/l1/Makefile | 4 ++-- lib/vf6xx/Makefile | 4 ++-- 25 files changed, 59 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 8b0987f3..2a262294 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ them as environment variables, for example: $ VARIABLE=value make * `FP_FLAGS` - Control the floating-point ABI + If the Cortex-M core supports a hard float ABI, it will be compiled with floating-point support by default. In cases where this is not desired, the behavior can be specified by setting `FP_FLAGS` Currently, M4F cores default @@ -100,6 +101,17 @@ them as environment variables, for example: $ FP_FLAGS="-mfloat-abi=soft" make # No hardfloat $ FP_FLAGS="-mfloat-abi=hard -mfpu=magic" make # New FPU we don't know of +* `CFLAGS` - Add to or supersede compiler flags + + If the library needs to be compiled with additional flags, they can be + passed to the build system via the environment variable `CFLAGS`. The + contents of `CFLAGS` will be placed after all flags defined by the build + system, giving the user a way to override any default if necessary. + + Examples: + + $ CFLAGS="-fshort-wchar" make # compile lib with 2 byte wide wchar_t + Example projects ---------------- diff --git a/lib/Makefile.include b/lib/Makefile.include index 657f70ec..8cff0669 100644 --- a/lib/Makefile.include +++ b/lib/Makefile.include @@ -42,7 +42,7 @@ $(SRCLIBDIR)/$(LIBNAME).ld: $(LIBNAME).ld %.o: %.c @printf " CC $(