Skip to content

Commit

Permalink
Makefile: use sane compiler flags for old C/C++ code (no lto, no unsa…
Browse files Browse the repository at this point in the history
…fe math, no strict aliasing, no strict overflow)

Signed-off-by: Jussi Kivilinna <[email protected]>
  • Loading branch information
jkivilin committed Oct 13, 2024
1 parent 6d2fdce commit 757db49
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ endif

TARGET = jk_botti_mm
BASEFLAGS = -Wall -Wno-write-strings
BASEFLAGS += -fno-strict-aliasing -fno-strict-overflow
ARCHFLAG += -march=i686 -mtune=generic -msse -msse2 -msse3

ifeq ($(DBG_FLGS),1)
OPTFLAGS = -O0 -g
else
OPTFLAGS = -O2 -fomit-frame-pointer -g
OPTFLAGS += -funsafe-math-optimizations
LTOFLAGS = -flto -fvisibility=hidden
LINKFLAGS += ${OPTFLAGS} ${LTOFLAGS}
endif

INCLUDES = -I"./metamod" \
Expand Down Expand Up @@ -89,10 +87,10 @@ distclean:
# ${CPP} ${CPPFLAGS} -funroll-loops -c $< -o $@

%.o: %.cpp
${CPP} ${CPPFLAGS} ${LTOFLAGS} -c $< -o $@
${CPP} ${CPPFLAGS} -c $< -o $@

%.o: %.c
${CPP} ${CFLAGS} ${LTOFLAGS} -c $< -o $@
${CPP} ${CFLAGS} -c $< -o $@

depend: Rules.depend

Expand Down

0 comments on commit 757db49

Please sign in to comment.