Makefiles:

- Properly handle the architecture definition when BUILD32_ON_64=1
 - Add proper $(*LDFLAGS) to which LTO and ARCH are correctly passed.
 - Cleanup of compiler flag variables.

This should fix to some degree building of the Build tools on OS X, and it may possibly fix the crashing of the OS X x86 32-bit build.

git-svn-id: https://svn.eduke32.com/eduke32@2520 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-03-23 20:22:10 +00:00
parent d51d9a0fb8
commit 64595adfb2
6 changed files with 80 additions and 73 deletions

View file

@ -40,9 +40,8 @@ OURCFLAGS=$(BASECFLAGS) \
OURCXXFLAGS=$(BASECXXFLAGS) OURCXXFLAGS=$(BASECXXFLAGS)
OURCONLYFLAGS=$(BASECONLYFLAGS) OURCONLYFLAGS=$(BASECONLYFLAGS)
NASMFLAGS=$(BASEASFLAGS) OURASFLAGS=$(BASEASFLAGS)
OURLDFLAGS=$(BASELDFLAGS) $(BUILDLDFLAGS)
MISCLINKOPTS=
JAUDIOLIBDIR=$(SRC)/jaudiolib JAUDIOLIBDIR=$(SRC)/jaudiolib
@ -168,14 +167,14 @@ ifneq (0,$(LUNATIC))
STRIP+= -s $(SRC)/lunatic/dynsymlist_osx STRIP+= -s $(SRC)/lunatic/dynsymlist_osx
MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx
MISCLINKOPTS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx OURLDFLAGS+= -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)
MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def
MISCLINKOPTS+= $(SRC)/lunatic/eduke32.def OURLDFLAGS+= $(SRC)/lunatic/eduke32.def
endif endif
ifeq ($(PLATFORM),LINUX) ifeq ($(PLATFORM),LINUX)
MISCLINKOPTS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist OURLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
endif endif
endif endif
@ -186,7 +185,7 @@ ifeq ($(PLATFORM),LINUX)
ifneq ($(CC),clang) ifneq ($(CC),clang)
OURCFLAGS += -fno-pic OURCFLAGS += -fno-pic
endif endif
NASMFLAGS += -f elf OURASFLAGS += -f elf
LIBS += -lvorbisfile -lvorbis -logg LIBS += -lvorbisfile -lvorbis -logg
endif endif
@ -217,12 +216,12 @@ ifeq ($(PLATFORM),DARWIN)
# EDITOROBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o # EDITOROBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o
GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o
endif endif
NASMFLAGS += -f macho OURASFLAGS += -f macho
endif endif
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
OURCFLAGS += -fno-pic -DUNDERSCORES -I$(DXROOT)/include OURCFLAGS += -fno-pic -DUNDERSCORES -I$(DXROOT)/include
NASMFLAGS+= -DUNDERSCORES -f win32 OURASFLAGS+= -DUNDERSCORES -f win32
LIBS += -L$(JAUDIOLIBDIR)/third-party/mingw32/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm -ldsound LIBS += -L$(JAUDIOLIBDIR)/third-party/mingw32/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm -ldsound
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
EDITOROBJS+= $(OBJ)/buildres.$o EDITOROBJS+= $(OBJ)/buildres.$o
@ -253,17 +252,17 @@ endif
OURCFLAGS+= $(BUILDCFLAGS) OURCFLAGS+= $(BUILDCFLAGS)
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
MISCLINKOPTS+= -Wl,--large-address-aware OURLDFLAGS+= -Wl,--large-address-aware
endif endif
#ifneq (0,$(KRANDDEBUG)) #ifneq (0,$(KRANDDEBUG))
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
MISCLINKOPTS+=-Wl,-map -Wl,$@.memmap OURLDFLAGS+=-Wl,-map -Wl,$@.memmap
else else
MISCLINKOPTS+=-Wl,-Map=$@.memmap OURLDFLAGS+=-Wl,-Map=$@.memmap
endif endif
#endif #endif
ifneq (0,$(PROFILER)) ifneq (0,$(PROFILER))
MISCLINKOPTS+=-pg OURLDFLAGS+=-pg
endif endif
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
@ -285,7 +284,7 @@ notice:
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB) $(MISCGAMEDEPS) eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB) $(MISCGAMEDEPS)
$(LINK_STATUS) $(LINK_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STATICSTDCPP) $(STDCPPLIB) $(MISCLINKOPTS); then $(LINK_OK); else $(LINK_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE)) ifeq (1,$(RELEASE))
ifeq (0,$(DEBUGANYWAY)) ifeq (0,$(DEBUGANYWAY))
$(STRIP) eduke32$(EXESUFFIX) $(STRIP) eduke32$(EXESUFFIX)
@ -299,7 +298,7 @@ endif
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB)
$(LINK_STATUS) $(LINK_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS) $(STATICSTDCPP) $(STDCPPLIB) $(MISCLINKOPTS); then $(LINK_OK); else $(LINK_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
ifeq (1,$(RELEASE)) ifeq (1,$(RELEASE))
ifeq (0,$(DEBUGANYWAY)) ifeq (0,$(DEBUGANYWAY))
$(STRIP) mapster32$(EXESUFFIX) $(STRIP) mapster32$(EXESUFFIX)
@ -355,15 +354,15 @@ $(EBACKTRACEDLL): Windows/src/backtrace.c
$(OBJ)/%.$o: $(SRC)/%.nasm $(OBJ)/%.$o: $(SRC)/%.nasm
$(COMPILE_STATUS) $(COMPILE_STATUS)
$(AS) $(NASMFLAGS) $< -o $@ $(AS) $(OURASFLAGS) $< -o $@
$(OBJ)/%.$o: $(SRC)/%.c $(OBJ)/%.$o: $(SRC)/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/lunatic/%.c $(OBJ)/%.$o: $(SRC)/lunatic/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist $(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist
sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@ sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
@ -377,7 +376,7 @@ $(SRC)/lunatic/eduke32.def: $(SRC)/lunatic/dynsymlist
$(OBJ)/%.$o: Apple/%.m $(OBJ)/%.$o: Apple/%.m
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/%.cc $(OBJ)/%.$o: $(SRC)/%.cc
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -393,7 +392,7 @@ $(OBJ)/%.$o: $(SRC)/%.cxx
$(OBJ)/%.$o: $(SRC)/jmact/%.c $(OBJ)/%.$o: $(SRC)/jmact/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/misc/%.rc $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -401,19 +400,19 @@ $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(OBJ)/%.$o: $(SRC)/util/%.c $(OBJ)/%.$o: $(SRC)/util/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(RSRC)/%.c $(OBJ)/%.$o: $(RSRC)/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c $(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(RSRC)/game_banner.c: $(RSRC)/game.bmp $(RSRC)/game_banner.c: $(RSRC)/game.bmp
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@ echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@

View file

@ -86,6 +86,11 @@ ifneq (0,$(CLANG))
endif endif
# compiler flags etc. # compiler flags etc.
BASECONLYFLAGS=-Wimplicit
BASECXXFLAGS= -fno-exceptions -fno-rtti
BASEASFLAGS=-s #-g
BASELDFLAGS=
LIBS=-lm LIBS=-lm
ifneq (0,$(USE_LIBPNG)) ifneq (0,$(USE_LIBPNG))
LIBS+= -lpng LIBS+= -lpng
@ -115,7 +120,7 @@ ifneq (0,$(RELEASE))
debug+= -fomit-frame-pointer -DNDEBUG debug+= -fomit-frame-pointer -DNDEBUG
endif endif
ifneq (0,$(LTO)) ifneq (0,$(LTO))
LIBS+= -flto BASELDFLAGS+= -flto
debug+= -DUSING_LTO -flto debug+= -DUSING_LTO -flto
endif endif
else else
@ -186,11 +191,6 @@ ifneq (0,$(DMALLOC))
BASECFLAGS+= -DDMALLOC BASECFLAGS+= -DDMALLOC
endif endif
BASECONLYFLAGS=-Wimplicit
BASECXXFLAGS= -fno-exceptions -fno-rtti
BASEASFLAGS=-s #-g
# Misc. stuff that is constant between Makefiles # Misc. stuff that is constant between Makefiles
EROOT:=build EROOT:=build

View file

@ -47,17 +47,18 @@ else
LIBS+= $(L_SSP) -Wl,--enable-auto-import LIBS+= $(L_SSP) -Wl,--enable-auto-import
endif endif
OURCFLAGS=$(BASECFLAGS) -Wno-char-subscripts -I$(INC) $(ARCH) include Makefile.shared
OURCFLAGS=$(BASECFLAGS) -Wno-char-subscripts -I$(INC)
OURCONLYFLAGS=$(BASECONLYFLAGS) OURCONLYFLAGS=$(BASECONLYFLAGS)
OURCXXFLAGS=$(BASECXXFLAGS) OURCXXFLAGS=$(BASECXXFLAGS)
ASFLAGS=$(BASEASFLAGS) OURASFLAGS=$(BASEASFLAGS)
OURLDFLAGS=$(BASELDFLAGS) $(BUILDLDFLAGS)
ifneq ($(LUNATIC),0) ifneq ($(LUNATIC),0)
OURCFLAGS+= -DLUNATIC_ENABLE OURCFLAGS+= -DLUNATIC_ENABLE
endif endif
include Makefile.shared
UTILLIBS= # -lpthread UTILLIBS= # -lpthread
UTILADDOBJS= UTILADDOBJS=
ifneq (0,$(NEDMALLOC)) ifneq (0,$(NEDMALLOC))
@ -124,31 +125,31 @@ EDITOROBJS=$(OBJ)/build.$o \
# PLATFORM SPECIFIC SETTINGS # PLATFORM SPECIFIC SETTINGS
ifeq ($(PLATFORM),LINUX) ifeq ($(PLATFORM),LINUX)
ASFLAGS+= -f elf OURASFLAGS+= -f elf
endif endif
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
ENGINEOBJS += $(OBJ)/osxbits.$o ENGINEOBJS += $(OBJ)/osxbits.$o
ifneq (0,$(OSX_STARTUPWINDOW)) ifneq (0,$(OSX_STARTUPWINDOW))
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o
endif endif
ASFLAGS += -f macho -DUNDERSCORES OURASFLAGS += -f macho -DUNDERSCORES
OURCFLAGS += -fno-pic -DUNDERSCORES OURCFLAGS += -fno-pic -DUNDERSCORES
endif endif
ifeq ($(PLATFORM),BSD) ifeq ($(PLATFORM),BSD)
ASFLAGS+= -f elf OURASFLAGS+= -f elf
OURCFLAGS+= -I/usr/X11R6/include OURCFLAGS+= -I/usr/X11R6/include
endif endif
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
OURCFLAGS+= -DUNDERSCORES -I$(DXROOT)/include -I$(FMODROOTWIN)/inc # -I$(ENETROOT)/include OURCFLAGS+= -DUNDERSCORES -I$(DXROOT)/include -I$(FMODROOTWIN)/inc # -I$(ENETROOT)/include
LIBS+= -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT) LIBS+= -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
ASFLAGS+= -DUNDERSCORES -f win32 OURASFLAGS+= -DUNDERSCORES -f win32
endif endif
ifeq ($(PLATFORM),BEOS) ifeq ($(PLATFORM),BEOS)
ASFLAGS+= -f elf OURASFLAGS+= -f elf
TARGETOPTS+= -DNOASM TARGETOPTS+= -DNOASM
endif endif
ifeq ($(PLATFORM),SYLLABLE) ifeq ($(PLATFORM),SYLLABLE)
ASFLAGS+= -f elf OURASFLAGS+= -f elf
endif endif
ifeq ($(RENDERTYPE),SDL) ifeq ($(RENDERTYPE),SDL)
@ -213,47 +214,47 @@ $(OBJ)/$(EDITORLIB): $(EDITOROBJS)
kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
generateicon$(EXESUFFIX): $(OBJ)/generateicon.$o $(OBJ)/compat.$o $(OBJ)/pragmas.$o $(OBJ)/kplib.$o \ generateicon$(EXESUFFIX): $(OBJ)/generateicon.$o $(OBJ)/compat.$o $(OBJ)/pragmas.$o $(OBJ)/kplib.$o \
$(OBJ)/cache1d.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) $(OBJ)/cache1d.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS) cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
enumdisplay$(EXESUFFIX): $(OBJ)/enumdisplay.$o $(UTILADDOBJS) enumdisplay$(EXESUFFIX): $(OBJ)/enumdisplay.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); fi
arttool$(EXESUFFIX): $(OBJ)/arttool.$o $(UTILADDOBJS) arttool$(EXESUFFIX): $(OBJ)/arttool.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CXX) -o $@ $^ $(STATICSTDCPP) $(UTILLIBS); then $(ONESTEP_OK); fi if $(CXX) -o $@ $^ $(OURLDFLAGS) $(STATICSTDCPP) $(UTILLIBS); then $(ONESTEP_OK); fi
givedepth$(EXESUFFIX): $(OBJ)/givedepth.$o $(UTILADDOBJS) givedepth$(EXESUFFIX): $(OBJ)/givedepth.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
mkpalette$(EXESUFFIX): $(OBJ)/mkpalette.$o $(UTILADDOBJS) mkpalette$(EXESUFFIX): $(OBJ)/mkpalette.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
unpackssi$(EXESUFFIX): $(OBJ)/unpackssi.$o $(UTILADDOBJS) unpackssi$(EXESUFFIX): $(OBJ)/unpackssi.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
bsuite$(EXESUFFIX): $(OBJ)/bsuite.$o $(UTILADDOBJS) bsuite$(EXESUFFIX): $(OBJ)/bsuite.$o $(UTILADDOBJS)
$(ONESTEP_STATUS) $(ONESTEP_STATUS)
if $(CC) -o $@ $^ $(UTILLIBS); then $(ONESTEP_OK); fi if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
# DEPENDENCIES # DEPENDENCIES
include Makefile.deps include Makefile.deps
@ -261,15 +262,15 @@ include Makefile.deps
# RULES # RULES
$(OBJ)/%.$o: $(SRC)/%.nasm $(OBJ)/%.$o: $(SRC)/%.nasm
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(AS) $(ASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(AS) $(OURASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/%.c $(OBJ)/%.$o: $(SRC)/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/%.m $(OBJ)/%.$o: $(SRC)/%.m
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/%.cc $(OBJ)/%.$o: $(SRC)/%.cc
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -285,7 +286,7 @@ $(OBJ)/%.$o: $(SRC)/%.cxx
$(OBJ)/%.$o: $(SRC)/misc/%.c $(OBJ)/%.$o: $(SRC)/misc/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/misc/%.rc $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -293,7 +294,7 @@ $(OBJ)/%.$o: $(SRC)/misc/%.rc
$(OBJ)/%.$o: $(SRC)/util/%.c $(OBJ)/%.$o: $(SRC)/util/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/%.$o: $(SRC)/util/%.cc $(OBJ)/%.$o: $(SRC)/util/%.cc
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -309,7 +310,7 @@ $(OBJ)/%.$o: $(SRC)/util/%.cxx
$(OBJ)/%.$o: $(RSRC)/%.c $(OBJ)/%.$o: $(RSRC)/%.c
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@ echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@

View file

@ -15,7 +15,6 @@ SDL_FRAMEWORK = 0
# Overridden for OSes that don't have the cutdown stdc++ that is supc++ # Overridden for OSes that don't have the cutdown stdc++ that is supc++
STDCPPLIB=-lsupc++ STDCPPLIB=-lsupc++
BUILDCFLAGS=
# GCC version, for conditional selection of flags. # GCC version, for conditional selection of flags.
# This is easier than trying to squeeze it out of gcc --version: # This is easier than trying to squeeze it out of gcc --version:
@ -41,6 +40,9 @@ ifndef ARCH
endif endif
endif endif
BUILDCFLAGS=$(ARCH)
BUILDLDFLAGS=$(ARCH)
# Detect the platform if it wasn't explicitly given to us from # Detect the platform if it wasn't explicitly given to us from
# the outside world. This allows cross-compilation by overriding # the outside world. This allows cross-compilation by overriding
# CC and giving us PLATFORM specifically. # CC and giving us PLATFORM specifically.
@ -113,7 +115,8 @@ ifeq ($(PLATFORM),DARWIN)
endif endif
ifeq (1,$(BUILD32_ON_64)) ifeq (1,$(BUILD32_ON_64))
BUILDCFLAGS += $(F_NO_STACK_PROTECTOR) -arch i386 BUILDCFLAGS += $(F_NO_STACK_PROTECTOR)
ARCH=-arch i386
else else
ifeq ($(findstring ppc,$(ARCH)),ppc) ifeq ($(findstring ppc,$(ARCH)),ppc)
BUILDCFLAGS += $(F_NO_STACK_PROTECTOR) BUILDCFLAGS += $(F_NO_STACK_PROTECTOR)

View file

@ -6,12 +6,14 @@ OBJNAME=libenet.a
SRC=src SRC=src
INC=include INC=include
CFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) $(F_NO_STACK_PROTECTOR)
# for BUILD_ECHOFLAGS: # for BUILD_ECHOFLAGS:
OURCFLAGS=$(CFLAGS) OURCFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) -I$(INC) -I$(SRC) -I../../$(EROOT)/include
ifneq ($(RELEASE),0)
# Debugging disabled
debug+= $(F_NO_STACK_PROTECTOR)
endif
OURCONLYFLAGS=$(BASECONLYFLAGS) OURCONLYFLAGS=$(BASECONLYFLAGS)
OURCXXFLAGS=$(BASECXXFLAGS) OURCXXFLAGS=$(BASECXXFLAGS)
CPPFLAGS=-I$(INC) -I$(SRC) -I../../$(EROOT)/include
OBJECTS=$(OBJ)/callbacks.o \ OBJECTS=$(OBJ)/callbacks.o \
@ -40,7 +42,7 @@ $(OBJNAME): $(OBJECTS)
$(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(INC)/enet/*.h $(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(INC)/enet/*.h
-mkdir -p $(OBJ) -mkdir -p $(OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CPPFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
.SILENT: .SILENT:

View file

@ -14,12 +14,14 @@ else
#DXROOT ?= c:/sdks/directx/dx8 #DXROOT ?= c:/sdks/directx/dx8
endif endif
CFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) $(F_NO_STACK_PROTECTOR)
# for BUILD_ECHOFLAGS: # for BUILD_ECHOFLAGS:
OURCFLAGS=$(CFLAGS) OURCFLAGS=$(BASECFLAGS) $(BUILDCFLAGS) -I$(INC) -I$(SRC) -DHAVE_VORBIS
ifneq ($(RELEASE),0)
# Debugging disabled
debug+= $(F_NO_STACK_PROTECTOR)
endif
OURCONLYFLAGS=$(BASECONLYFLAGS) OURCONLYFLAGS=$(BASECONLYFLAGS)
OURCXXFLAGS=$(BASECXXFLAGS) OURCXXFLAGS=$(BASECXXFLAGS)
CPPFLAGS=-I$(INC) -I$(SRC) -DHAVE_VORBIS
ifeq ($(PLATFORM),DARWIN) ifeq ($(PLATFORM),DARWIN)
ifeq (1,$(SDL_FRAMEWORK)) ifeq (1,$(SDL_FRAMEWORK))
@ -40,14 +42,14 @@ OBJECTS=$(OBJ)/drivers.o \
$(OBJ)/driver_nosound.o $(OBJ)/driver_nosound.o
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)
CPPFLAGS+= -I$(DXROOT)/include -Ithird-party/mingw32/include OURCFLAGS+= -I$(DXROOT)/include -Ithird-party/mingw32/include
OBJECTS+= $(OBJ)/driver_directsound.o OBJECTS+= $(OBJ)/driver_directsound.o
OBJNAME=libjfaudiolib_win32.a OBJNAME=libjfaudiolib_win32.a
OBJ=obj_win OBJ=obj_win
else else
CPPFLAGS+= -DHAVE_SDL OURCFLAGS+= -DHAVE_SDL
ifneq ($(PLATFORM),DARWIN) ifneq ($(PLATFORM),DARWIN)
CPPFLAGS+=`pkg-config --cflags vorbis` OURCFLAGS+=`pkg-config --cflags vorbis`
endif endif
OBJECTS+= $(OBJ)/driver_sdl.o OBJECTS+= $(OBJ)/driver_sdl.o
endif endif
@ -62,7 +64,7 @@ $(OBJNAME): $(OBJECTS)
$(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c $(OBJECTS): $(OBJ)/%.o: $(SRC)/%.c
-mkdir -p $(OBJ) -mkdir -p $(OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
if $(CC) $(CPPFLAGS) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
ifeq ($(PRETTY_OUTPUT),1) ifeq ($(PRETTY_OUTPUT),1)
.SILENT: .SILENT: