Improved Makefiles.

This commit is contained in:
LoRd_MuldeR 2022-11-29 15:39:49 +01:00
parent 93a286563a
commit c016cd0af3
3 changed files with 35 additions and 12 deletions

View File

@ -1,14 +1,22 @@
DUMPMACHINE := $(shell $(CC) -dumpmachine)
ifneq ($(SANITIZE_ADDRESS),1)
XCFLAGS = -Ofast -flto -DNDEBUG -s -static
ifneq ($(DEBUG),)
XCFLAGS = -Og -g
else
ifneq ($(ASAN),)
XCFLAGS = -O1 -g -fsanitize=address -fno-omit-frame-pointer -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
else
XCFLAGS = -fsanitize=address -static-libasan -g
ifneq ($(FLTO),)
XCFLAGS += -flto
endif
XCFLAGS += -s -static
endif
endif
ifneq ($(firstword $(filter %-mingw32 %-cygwin,$(DUMPMACHINE))),)

View File

@ -1,14 +1,21 @@
DUMPMACHINE := $(shell $(CC) -dumpmachine)
ifneq ($(SANITIZE_ADDRESS),1)
XCFLAGS = -Ofast -flto -DNDEBUG
ifneq ($(DEBUG),)
XCFLAGS = -Og -g
else
ifneq ($(ASAN),)
XCFLAGS = -O1 -g -fsanitize=address -fno-omit-frame-pointer -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
else
XCFLAGS = -fsanitize=address -static-libasan -g
ifneq ($(FLTO),)
XCFLAGS += -flto
endif
endif
endif
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -Iinclude $(XCFLAGS)

View File

@ -1,14 +1,22 @@
DUMPMACHINE := $(shell $(CC) -dumpmachine)
ifneq ($(SANITIZE_ADDRESS),1)
XCFLAGS = -Ofast -flto -DNDEBUG -s -static
ifneq ($(DEBUG),)
XCFLAGS = -Og -g
else
ifneq ($(ASAN),)
XCFLAGS = -O1 -g -fsanitize=address -fno-omit-frame-pointer -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
else
XCFLAGS = -fsanitize=address -static-libasan -g
ifneq ($(FLTO),)
XCFLAGS += -flto
endif
XCFLAGS += -s -static
endif
endif
ifneq ($(firstword $(filter %-mingw32 %-cygwin,$(DUMPMACHINE))),)