From 17d62458f4d878ce4812018bef4c7ff555f12339 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 20 Jan 2013 21:17:36 +0000 Subject: [PATCH] Makefiles: simplify how to determine whether the final binary is stripped. Whenever it should be not, STRIP is set to the empty string. This fixes the Lunatic RELEASE=1 build. git-svn-id: https://svn.eduke32.com/eduke32@3422 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 22 +++++++++------------- polymer/eduke32/Makefile.common | 9 +++++++-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 7df7f18c4..c421a0d6d 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -164,18 +164,22 @@ ifneq (0,$(LUNATIC)) # strip on OSX says: removing global symbols from a final linked no longer supported. # Use -exported_symbols_list at link time when building # But, following _their_ directions does not give us the symbols! wtf? - STRIP+= -s $(SRC)/lunatic/dynsymlist_osx + ifneq ($(STRIP),0) + STRIP+= -s $(SRC)/lunatic/dynsymlist_osx + endif MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx PRINTLDFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx endif ifeq ($(PLATFORM),WINDOWS) + STRIP= MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def endif ifeq ($(SUBPLATFORM),LINUX) + STRIP= GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32 endif @@ -344,12 +348,8 @@ finish: $(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS) $(LINK_STATUS) if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi -ifeq (1,$(RELEASE)) - ifeq (0,$(DEBUGANYWAY)) - ifneq ($(PLATFORM),WII) - $(STRIP) $(EDUKE32) - endif - endif +ifneq ($(STRIP),) + $(STRIP) $(EDUKE32) endif ifeq ($(PLATFORM),DARWIN) cp -RPf "Apple/bundles/EDuke32.app" "./" @@ -360,12 +360,8 @@ endif $(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS) $(LINK_STATUS) if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi -ifeq (1,$(RELEASE)) - ifeq (0,$(DEBUGANYWAY)) - ifneq ($(PLATFORM),WII) - $(STRIP) $(MAPSTER32) - endif - endif +ifneq ($(STRIP),) + $(STRIP) $(MAPSTER32) endif ifeq ($(PLATFORM),DARWIN) cp -RPf "Apple/bundles/Mapster32.app" "./" diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 1c27f8ca7..303ffb28a 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -26,8 +26,6 @@ ifneq (0,$(CLANG)) CXX=clang -x c++ L_CC=clang -std=gnu89 L_CXX=clang -# AR=llvm-ar -# RANLIB=llvm-ranlib endif @@ -169,6 +167,13 @@ OPTLEVEL?=2 PROFILER?=0 MUDFLAP?=0 +ifeq ($(RELEASE),0) + STRIP= +endif +ifneq ($(DEBUGANYWAY),0) + STRIP= +endif + ifndef LTO LTO=1 ifneq (0,$(CLANG))