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
This commit is contained in:
helixhorned 2013-01-20 21:17:36 +00:00
parent cbb4d3c6eb
commit 17d62458f4
2 changed files with 16 additions and 15 deletions

View file

@ -164,18 +164,22 @@ ifneq (0,$(LUNATIC))
# strip on OSX says: removing global symbols from a final linked no longer supported. # strip on OSX says: removing global symbols from a final linked no longer supported.
# Use -exported_symbols_list at link time when building # Use -exported_symbols_list at link time when building
# But, following _their_ directions does not give us the symbols! wtf? # But, following _their_ directions does not give us the symbols! wtf?
ifneq ($(STRIP),0)
STRIP+= -s $(SRC)/lunatic/dynsymlist_osx STRIP+= -s $(SRC)/lunatic/dynsymlist_osx
endif
MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx 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 PRINTLDFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx
endif endif
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
STRIP=
MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def
GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def
MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def
EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def
endif endif
ifeq ($(SUBPLATFORM),LINUX) ifeq ($(SUBPLATFORM),LINUX)
STRIP=
GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32 EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32
endif endif
@ -344,13 +348,9 @@ finish:
$(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS) $(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS)
$(LINK_STATUS) $(LINK_STATUS)
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE)) ifneq ($(STRIP),)
ifeq (0,$(DEBUGANYWAY))
ifneq ($(PLATFORM),WII)
$(STRIP) $(EDUKE32) $(STRIP) $(EDUKE32)
endif endif
endif
endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
cp -RPf "Apple/bundles/EDuke32.app" "./" cp -RPf "Apple/bundles/EDuke32.app" "./"
mkdir -p "EDuke32.app/Contents/MacOS" mkdir -p "EDuke32.app/Contents/MacOS"
@ -360,13 +360,9 @@ endif
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS) $(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS)
$(LINK_STATUS) $(LINK_STATUS)
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE)) ifneq ($(STRIP),)
ifeq (0,$(DEBUGANYWAY))
ifneq ($(PLATFORM),WII)
$(STRIP) $(MAPSTER32) $(STRIP) $(MAPSTER32)
endif endif
endif
endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
cp -RPf "Apple/bundles/Mapster32.app" "./" cp -RPf "Apple/bundles/Mapster32.app" "./"
mkdir -p "Mapster32.app/Contents/MacOS" mkdir -p "Mapster32.app/Contents/MacOS"

View file

@ -26,8 +26,6 @@ ifneq (0,$(CLANG))
CXX=clang -x c++ CXX=clang -x c++
L_CC=clang -std=gnu89 L_CC=clang -std=gnu89
L_CXX=clang L_CXX=clang
# AR=llvm-ar
# RANLIB=llvm-ranlib
endif endif
@ -169,6 +167,13 @@ OPTLEVEL?=2
PROFILER?=0 PROFILER?=0
MUDFLAP?=0 MUDFLAP?=0
ifeq ($(RELEASE),0)
STRIP=
endif
ifneq ($(DEBUGANYWAY),0)
STRIP=
endif
ifndef LTO ifndef LTO
LTO=1 LTO=1
ifneq (0,$(CLANG)) ifneq (0,$(CLANG))