Skip to content

Commit b2ddf66

Browse files
committed
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
1 parent 26bee8a commit b2ddf66

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ VALGRIND ?= valgrind
1818
GDB ?= gdb
1919
PERF ?= perf
2020

21+
# guess clang or gcc (clang sometimes masquerades as gcc because of
22+
# course it does)
23+
ifeq ($(shell $(CC) --version | grep clang),clang)
24+
NO_GCC = 1
25+
endif
26+
2127
SRC ?= $(filter-out $(wildcard *.t.* *.b.*),$(wildcard *.c))
2228
OBJ := $(SRC:%.c=$(BUILDDIR)/%.o)
2329
DEP := $(SRC:%.c=$(BUILDDIR)/%.d)
@@ -63,9 +69,9 @@ CFLAGS += -g3
6369
CFLAGS += -I.
6470
CFLAGS += -std=c99 -Wall -Wextra -pedantic
6571
CFLAGS += -Wmissing-prototypes
66-
ifeq ($(shell $(CC) --version | grep clang),)
67-
CFLAGS += -ftrack-macro-expansion=0
72+
ifndef NO_GCC
6873
CFLAGS += -fcallgraph-info=su
74+
CFLAGS += -ftrack-macro-expansion=0
6975
endif
7076

7177
ifdef DEBUG

0 commit comments

Comments
 (0)