summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 72f0585..90387ab 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,16 @@ else
DEBUG := 0
endif
+# Compiler detection
+ifneq ($(CC),)
+ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
+COMPILER := clang
+else
+COMPILER := gcc
+endif
+export COMPILER
+endif
+
# For packaging purposes, you might want to call your own:
# make CFLAGS="<flags>"
CFLAGS_DEF = -std=gnu99
@@ -83,7 +93,9 @@ endif
CFLAGS_DEF += -fomit-frame-pointer
CFLAGS_DEF += -fno-strict-aliasing
CFLAGS_DEF += -fasynchronous-unwind-tables
+ifneq ($(COMPILER), clang)
CFLAGS_DEF += -fno-delete-null-pointer-checks
+endif
CFLAGS_MIN = -D_REENTRANT
CFLAGS_MIN += -D_LARGEFILE_SOURCE