ソースを参照

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
Christopher Haster 7 ヶ月 前
コミット
bff4dfd1b1
1 ファイル変更8 行追加2 行削除
  1. 8 2
      Makefile

+ 8 - 2
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