-
-FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON
-FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-c -Ono-cs $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
-FTEQCCFLAGS_PROGS ?=
-FTEQCCFLAGS_MENU ?=
-
-# NOTE: use -DUSE_FTE instead of -TFTE here!
-# It will automagically add an engine check with -TID and then change back to -TFTE
-FTEQCCFLAGS_CSPROGS ?=
+QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON=1
+QCC ?= fteqcc
+
+VERSION_MESSAGE = $(shell cd server && $(QCC) --version --help)
+ifneq (,$(findstring GMQCC,$(VERSION_MESSAGE)))
+# this is gmqcc
+QCCFLAGS ?= \
+ -std=fteqcc \
+ -Werror -Wall \
+ -Wno-field-redeclared \
+ -Wno-double-declaration \
+ -Wno-assign-function-types \
+ -Wno-unused-variable \
+ -O3 \
+ -fftepp \
+ -ftranslatable-strings \
+ -fadjust-vector-fields \
+ -fassign-function-types \
+ -fcorrect-ternary \
+ -fshort-logic \
+ -flno \
+ $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+else
+# this. is. fteqccccccccccccccccccc!
+QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+endif