diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index f544a4f69..5a6329d3a 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -339,10 +339,6 @@ COMMON_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_EDIT DUKE3D_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_OBJS))) DUKE3D_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_EDITOR_OBJS))) -LUNATIC_COMMON_OBJS_EXP := $(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(LUNATIC_COMMON_OBJS))) -LUNATIC_GAME_OBJS_EXP := $(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(LUNATIC_GAME_OBJS))) -LUNATIC_OBJS_EXP := $(LUNATIC_COMMON_OBJS_EXP) $(LUNATIC_GAME_OBJS_EXP) - ifeq ($(PRETTY_OUTPUT),1) .SILENT: @@ -606,10 +602,13 @@ $(DUKE3D_RSRC)/editor_banner.c: $(DUKE3D_RSRC)/build.bmp $(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ): mkdir $@ -# PHONIES +## PHONIES +# Delete executables, object files created from sources in source/, and +# miscellaneous generated files related to Lunatic on non-Linux. clean: - -rm -f $(EDUKE32) $(MAPSTER32) $(LUNATIC_OBJS_EXP) $(COMMON_OBJS_EXP) $(DUKE3D_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(DUKE3D_EDITOR_OBJS_EXP) $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS) core* + echo "rm -f $(EDUKE32) $(MAPSTER32) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS)" + -rm -f $(EDUKE32) $(MAPSTER32) $(DUKE3D_OBJ)/*.o $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS) ifeq ($(PLATFORM),DARWIN) -rm -rf EDuke32.app Mapster32.app endif @@ -621,7 +620,9 @@ cleanutils: -rm -f $(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(UTILS))) $(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(GAMEUTILS))) $(addsuffix $(EXESUFFIX),$(DXUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(DXUTILS))) $(addsuffix $(EXESUFFIX),$(SDLUTILS)) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(SDLUTILS))) $(UTIL_OBJS_EXP) veryclean: clean cleanutils - -rm -f $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(ENET_OBJS_EXP) $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL) + echo "Removed test game and utils objects." + echo "rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL)" + -rm -f $(ENGINE_OBJ)/*.o $(AUDIOLIB_OBJ)/*.o $(ENET_OBJ)/*.o $(DUKE3D_RSRC)/*banner* $(EBACKTRACEDLL) printutils: echo "$(addsuffix $(EXESUFFIX),$(UTILS) $(GAMEUTILS))" diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 73ba7ab47..e8bb0a48d 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -190,7 +190,9 @@ endif # Debugging/Build options # CPLUSPLUS - 1 = enable C++ building # RELEASE - 1 = no debugging -# DEBUGANYWAY - 1 = include debug symbols even when generating release code +# DEBUGANYWAY: +# 1 = Include debug symbols even when generating release code. +# 2 = Also enable sanitizers with Clang. On the C side, make 'sprite' etc. be real arrays. # DISABLEINLINING - 1 = compile inline functions as extern __fastcall instead of static inline # FORCEWARNINGS - 1 = do not disable any compiler warnings within the source # KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system @@ -379,6 +381,7 @@ ifneq (0,$(KRANDDEBUG)) RELEASE=0 endif ifneq (0,$(PROFILER)) + # XXX: Why? DEBUGANYWAY=1 endif @@ -423,12 +426,14 @@ endif # See http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation # for a list of possible UBSan options. # Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer -# CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size -fsanitize-undefined-trap-on-error -# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow -# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow +CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size +#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow +#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow +#CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS) -fsanitize-undefined-trap-on-error ifneq (0,$(RELEASE)) - # Debugging disabled + ## Debugging disabled + ifeq (0,$(CLANG)) COMMONFLAGS += -funswitch-loops ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \< 4))) @@ -446,39 +451,39 @@ ifneq (0,$(RELEASE)) endif endif endif + ifeq (0,$(DEBUGANYWAY)) COMMONFLAGS += -fomit-frame-pointer COMPILERFLAGS += -DNDEBUG else - COMPILERFLAGS += -DDEBUGGINGAIDS -# ifneq (0,$(CLANG)) -# COMMONFLAGS += $(CLANG_DEBUG_FLAGS) -# endif + # Our $(DEBUGANYWAY) -> DEBUGGINGAIDS #define + COMPILERFLAGS += -DDEBUGGINGAIDS=$(DEBUGANYWAY) + ifneq (0,$(CLANG)) + ifeq (2,$(DEBUGANYWAY)) + COMMONFLAGS += $(CLANG_DEBUG_FLAGS) + endif + endif endif + ifneq (0,$(LTO)) COMPILERFLAGS += -DUSING_LTO COMMONFLAGS += -flto - # We don't need the following since we don't make intermediate .a files any more. -# ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4))) -# ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 9))) -# COMMONFLAGS += -ffat-lto-objects -# endif -# endif endif else - # Debugging enabled - ifeq (0,$(DEBUGANYWAY)) - COMPILERFLAGS += -DDEBUGGINGAIDS - else - COMPILERFLAGS += -DDEBUGGINGAIDS=2 + ## Debugging enabled + + # Our $(DEBUGANYWAY) -> DEBUGGINGAIDS #define + COMPILERFLAGS += -DDEBUGGINGAIDS=$(DEBUGANYWAY) + ifneq (0,$(CLANG)) + ifeq (2,$(DEBUGANYWAY)) + COMMONFLAGS += $(CLANG_DEBUG_FLAGS) + endif endif -# ifneq (0,$(CLANG)) -# COMMONFLAGS += $(CLANG_DEBUG_FLAGS) -# endif ifeq ($(SUBPLATFORM),LINUX) LIBS+=-rdynamic endif + ifneq (0,$(MUDFLAP)) LIBS+= -lmudflapth COMMONFLAGS += -fmudflapth