slightly clean up makefile

- pass "-g" on mingw builds generally after everything (needs testing)
-use "libs" instead of "LDFLAGS" (identical purpose)
- pass "mno-ms-bitfields" on gcc, shouldnt be really needed but just in case
This commit is contained in:
Alug committed 2025-10-20 18:36:51 +02:00
1 parent 72ce4eea35
commit 8339ab9552
1 file changed
+15 -18
+15 -18
View File
@@ -254,10 +254,15 @@ ifdef STATIC
libs+=-static
endif
ifeq ($(CC),gcc)
opts+=-mno-ms-bitfields
libs+=-mno-ms-bitfields
endif
# build with profiling information
ifdef PROFILEMODE
opts+=-pg
LDFLAGS+=-pg
libs+=-pg
endif
ifdef DEBUGMODE
@@ -267,40 +272,32 @@ debug_opts=-DNDEBUG
opts+=-O3
ifdef USELTO
# compile with LTO
ifdef MINGW
opts+=-flto=auto -g
LDFLAGS+=-flto=auto -g
else
opts+=-flto=auto
LDFLAGS+=-flto=auto
endif
libs+=-flto=auto
endif
endif
ifdef USEASAN
# compile with asan
ifdef MINGW
opts+=-fsanitize=address -g
libs+=-fsanitize=address -g
else
opts+=-fsanitize=address
libs+=-fsanitize=address
endif
endif
ifdef USEUBSAN
# compile with asan
ifdef MINGW
opts+=-fsanitize=undefined -g
libs+=-fsanitize=undefined -g
else
opts+=-fsanitize=undefined
libs+=-fsanitize=undefined
endif
endif
ifeq ($(CC),clang)
LDFLAGS+= -fuse-ld=lld
libs+=-fuse-ld=lld
endif
ifdef MINGW
# mingw needs this passed AFTER lto and the likes were passed
# otherwise libbacktrace may break
opts+=-g
libs+=-g
endif
# debug_opts also get passed to windres