2022-11-30 16:41:14 +01:00
|
|
|
DUMPMACHINE := $(strip $(shell $(CC) -dumpmachine))
|
2022-11-30 16:15:12 +01:00
|
|
|
ifeq ($(DUMPMACHINE),)
|
2022-11-30 16:41:14 +01:00
|
|
|
$(error C compiler could not be detected!)
|
2022-11-30 16:15:12 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(DEBUG),)
|
|
|
|
XCFLAGS = -Og -g
|
|
|
|
else
|
|
|
|
ifneq ($(ASAN),)
|
|
|
|
XCFLAGS = -O1 -g -fsanitize=address -fno-omit-frame-pointer
|
|
|
|
XLDFLAGS += -static-libasan
|
|
|
|
else
|
|
|
|
XCFLAGS = -Ofast -DNDEBUG
|
|
|
|
ifneq ($(firstword $(filter x86_64-%,$(DUMPMACHINE))),)
|
|
|
|
XCFLAGS += -march=x86-64 -mtune=nocona
|
|
|
|
else ifneq ($(firstword $(filter i686-%,$(DUMPMACHINE))),)
|
|
|
|
XCFLAGS += -march=pentiumpro -mtune=intel
|
|
|
|
endif
|
|
|
|
ifneq ($(FLTO),)
|
|
|
|
XCFLAGS += -flto
|
|
|
|
endif
|
|
|
|
XLDFLAGS += -s -static
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(firstword $(filter %-mingw32 %-cygwin,$(DUMPMACHINE))),)
|
|
|
|
EXE_SUFFIX := .exe
|
|
|
|
ifneq ($(firstword $(filter i686-%,$(DUMPMACHINE))),)
|
|
|
|
XLDFLAGS += -Wl,--large-address-aware
|
|
|
|
endif
|
|
|
|
endif
|