commit b7056e7528155d9688245236d66d21db13442783
parent 9628de18ddbb27fbcb3ab56a98852b6372311ec2
Author: falkTX <falktx@falktx.com>
Date: Thu, 22 Sep 2022 01:48:36 +0100
Alternative approach at compiler detection
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/Makefile.base.mk b/Makefile.base.mk
@@ -35,7 +35,11 @@ DPF_MAKEFILE_BASE_INCLUDED = true
# ---------------------------------------------------------------------------------------------------------------------
# Auto-detect target compiler if not defined
+ifeq ($(shell echo '\#test' | grep -- '\#test'),\#test)
TARGET_COMPILER = $(shell echo '\#ifdef __clang__\nclang\n\#else\ngcc\n\#endif' | $(CC) -E -P -x c - 2>/dev/null)
+else
+TARGET_COMPILER = $(shell echo '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC) -E -P -x c - 2>/dev/null)
+endif
ifneq ($(CLANG),true)
ifneq ($(GCC),true)