mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-14 02:43:30 +08:00
Added NO_GCC to allow users to explicitly disable GCC-specific flags
This is the same as the implicit Clang => NO_GCC behavior introduced by yamt, but with an explicit variable that can be assigned by users using other, non-gcc, compilers: $ NO_GCC=1 make Note, stack measurements are currently GCC specific: $ NO_GCC=1 make stack ... snip ... FileNotFoundError: [Errno 2] No such file or directory: 'lfs.ci' make: *** [Makefile:494: lfs.stack.csv] Error 1
This commit is contained in:
10
Makefile
10
Makefile
@@ -18,6 +18,12 @@ VALGRIND ?= valgrind
|
||||
GDB ?= gdb
|
||||
PERF ?= perf
|
||||
|
||||
# guess clang or gcc (clang sometimes masquerades as gcc because of
|
||||
# course it does)
|
||||
ifneq ($(shell $(CC) --version | grep clang),)
|
||||
NO_GCC = 1
|
||||
endif
|
||||
|
||||
SRC ?= $(filter-out $(wildcard *.t.* *.b.*),$(wildcard *.c))
|
||||
OBJ := $(SRC:%.c=$(BUILDDIR)/%.o)
|
||||
DEP := $(SRC:%.c=$(BUILDDIR)/%.d)
|
||||
@@ -63,9 +69,9 @@ CFLAGS += -g3
|
||||
CFLAGS += -I.
|
||||
CFLAGS += -std=c99 -Wall -Wextra -pedantic
|
||||
CFLAGS += -Wmissing-prototypes
|
||||
ifeq ($(shell $(CC) --version | grep clang),)
|
||||
CFLAGS += -ftrack-macro-expansion=0
|
||||
ifndef NO_GCC
|
||||
CFLAGS += -fcallgraph-info=su
|
||||
CFLAGS += -ftrack-macro-expansion=0
|
||||
endif
|
||||
|
||||
ifdef DEBUG
|
||||
|
Reference in New Issue
Block a user