- Fix GCC warning:

warning: converting to non-pointer type 'int' from NULL
- Force static linking to libstdc++ and libgcc, because MinGW GCC 4.5.0 wants to do it
  dynamically.

SVN r2362 (trunk)
This commit is contained in:
Randy Heit 2010-06-12 03:37:16 +00:00
parent c9406fbd45
commit 28e30fbb7b
2 changed files with 114 additions and 114 deletions

224
Makefile
View file

@ -1,112 +1,112 @@
CC = gcc CC = gcc
CXX = g++ CXX = g++
CFLAGS = -Wall -Izlib -pipe -ffast-math -MMD CFLAGS = -Wall -Izlib -pipe -ffast-math -MMD
# Optimization flags # Optimization flags
CFLAGS += -O3 -fomit-frame-pointer -DNDEBUG CFLAGS += -O3 -fomit-frame-pointer -DNDEBUG
# Unoptimization flags # Unoptimization flags
#CFLAGS += -g -D_DEBUG #CFLAGS += -g -D_DEBUG
# Processor features flags # Processor features flags
CFLAGS += -mtune=i686 CFLAGS += -mtune=i686
#CFLAGS += -march=k8 #CFLAGS += -march=k8
LDFLAGS = LDFLAGS = -static-libstdc++ -static-libgcc
RM = rm -f FILE RM = rm -f FILE
ZLIBDIR = zlib/ ZLIBDIR = zlib/
ifeq (Windows_NT,$(OS)) ifeq (Windows_NT,$(OS))
EXE = zdbsp.exe EXE = zdbsp.exe
LDFLAGS += -luser32 -lgdi32 LDFLAGS += -luser32 -lgdi32
ifneq (msys,$(OSTYPE)) ifneq (msys,$(OSTYPE))
RM = del /q /f FILE 2>nul RM = del /q /f FILE 2>nul
ZLIBDIR = "zlib\" ZLIBDIR = "zlib\"
endif endif
else else
EXE = zdbsp EXE = zdbsp
CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1 CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1
endif endif
# To generate profiling information for gprof, pass gprof=1 to make. # To generate profiling information for gprof, pass gprof=1 to make.
ifeq ($(gprof),1) ifeq ($(gprof),1)
CFLAGS += -g -fno-omit-frame-pointer -pg CFLAGS += -g -fno-omit-frame-pointer -pg
LDFLAGS += -g -pg LDFLAGS += -g -pg
endif endif
# To strip debugging symbols, pass strip=1 to make. # To strip debugging symbols, pass strip=1 to make.
ifeq ($(strip),1) ifeq ($(strip),1)
LDFLAGS += -s LDFLAGS += -s
endif endif
# To compile without support for backpatching ClassifyLine calls, pass nobackpatch=1 to make. # To compile without support for backpatching ClassifyLine calls, pass nobackpatch=1 to make.
ifeq ($(nobackpatch),1) ifeq ($(nobackpatch),1)
CFLAGS += -DDISABLE_BACKPATCH CFLAGS += -DDISABLE_BACKPATCH
endif endif
# To use SSE2 math for everything, pass sse=1 to make. # To use SSE2 math for everything, pass sse=1 to make.
ifeq ($(sse),1) ifeq ($(sse),1)
CFLAGS += -msse2 -mfpmath=sse CFLAGS += -msse2 -mfpmath=sse
endif endif
OBJS = main.o getopt.o getopt1.o blockmapbuilder.o processor.o processor_udmf.o sc_man.o view.o wad.o \ OBJS = main.o getopt.o getopt1.o blockmapbuilder.o processor.o processor_udmf.o sc_man.o view.o wad.o \
nodebuild.o nodebuild_events.o nodebuild_extract.o nodebuild_gl.o \ nodebuild.o nodebuild_events.o nodebuild_extract.o nodebuild_gl.o \
nodebuild_utility.o nodebuild_classify_nosse2.o \ nodebuild_utility.o nodebuild_classify_nosse2.o \
zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/trees.o \ zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/trees.o \
zlib/zutil.o zlib/zutil.o
# To compile without any SSE support, pass nosse=1 to make. # To compile without any SSE support, pass nosse=1 to make.
ifeq ($(nosse),1) ifeq ($(nosse),1)
CFLAGS += -DDISABLE_SSE CFLAGS += -DDISABLE_SSE
else else
OBJS += nodebuild_classify_sse1.o nodebuild_classify_sse2.o OBJS += nodebuild_classify_sse1.o nodebuild_classify_sse2.o
endif endif
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
ifeq (Windows_NT,$(OS)) ifeq (Windows_NT,$(OS))
OBJS += resource.o OBJS += resource.o
endif endif
all: $(EXE) all: $(EXE)
profile: profile:
$(MAKE) clean $(MAKE) clean
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LDFLAGS="$(LDFLAGS) -lgcov" $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LDFLAGS="$(LDFLAGS) -lgcov"
@echo "Process a few maps, then rebuild with make profile-use" @echo "Process a few maps, then rebuild with make profile-use"
profile-use: profile-use:
$(MAKE) clean $(MAKE) clean
$(MAKE) all CXXFLAGS="$(CXXFLAGS) -fprofile-use" $(MAKE) all CXXFLAGS="$(CXXFLAGS) -fprofile-use"
$(EXE): $(OBJS) $(EXE): $(OBJS)
$(CXX) -o $(EXE) $(OBJS) $(LDFLAGS) $(CXX) -o $(EXE) $(OBJS) $(LDFLAGS)
nodebuild_classify_sse2.o: nodebuild_classify_sse2.cpp nodebuild.h nodebuild_classify_sse2.o: nodebuild_classify_sse2.cpp nodebuild.h
$(CXX) $(CXXFLAGS) -msse -msse2 -march=i686 -mfpmath=sse -c -o $@ $< $(CXX) $(CXXFLAGS) -msse -msse2 -march=i686 -mfpmath=sse -c -o $@ $<
nodebuild_classify_sse1.o: nodebuild_classify_sse1.cpp nodebuild.h nodebuild_classify_sse1.o: nodebuild_classify_sse1.cpp nodebuild.h
$(CXX) $(CXXFLAGS) -msse -march=i686 -mfpmath=sse -c -o $@ $< $(CXX) $(CXXFLAGS) -msse -march=i686 -mfpmath=sse -c -o $@ $<
resource.o: resource.rc resource.o: resource.rc
windres -o $@ -i $< windres -o $@ -i $<
.PHONY: clean .PHONY: clean
clean: clean:
$(subst FILE,$(EXE),$(RM)) $(subst FILE,$(EXE),$(RM))
$(subst FILE,*.o,$(RM)) $(subst FILE,*.o,$(RM))
$(subst FILE,*.d,$(RM)) $(subst FILE,*.d,$(RM))
$(subst FILE,$(ZLIBDIR)*.o,$(RM)) $(subst FILE,$(ZLIBDIR)*.o,$(RM))
$(subst FILE,$(ZLIBDIR)*.d,$(RM)) $(subst FILE,$(ZLIBDIR)*.d,$(RM))
cleanprof: cleanprof:
$(subst FILE,*.gc*,$(RM)) $(subst FILE,*.gc*,$(RM))
$(subst FILE,$(ZLIBDIR)*.gc*,$(RM)) $(subst FILE,$(ZLIBDIR)*.gc*,$(RM))
cleanall: clean cleanprof cleanall: clean cleanprof
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
-include $(OBJS:%.o=%.d) -include $(OBJS:%.o=%.d)
endif endif

View file

@ -239,8 +239,8 @@ DWORD FNodeBuilder::AddMiniseg (int v1, int v2, DWORD partner, DWORD seg1, DWORD
newseg.planefront = true; newseg.planefront = true;
newseg.hashnext = NULL; newseg.hashnext = NULL;
newseg.storedseg = DWORD_MAX; newseg.storedseg = DWORD_MAX;
newseg.frontsector = NULL; newseg.frontsector = -1;
newseg.backsector = NULL; newseg.backsector = -1;
newseg.offset = 0; newseg.offset = 0;
newseg.angle = 0; newseg.angle = 0;