2006-06-01 17:32:32 +00:00
|
|
|
CFLAGS = -Wall -fomit-frame-pointer -Izlib -pipe -ffast-math -MMD
|
|
|
|
|
|
|
|
# Optimization flags
|
2006-06-06 02:45:48 +00:00
|
|
|
CFLAGS += -O3 -fomit-frame-pointer -DNDEBUG
|
2006-06-01 17:32:32 +00:00
|
|
|
|
|
|
|
# Unoptimization flags
|
2006-06-06 02:45:48 +00:00
|
|
|
#CFLAGS += -g -D_DEBUG
|
2006-06-01 17:32:32 +00:00
|
|
|
|
|
|
|
# Processor features flags
|
|
|
|
CFLAGS += -mtune=i686
|
2006-06-06 19:15:39 +00:00
|
|
|
#CFLAGS += -march=k8
|
2006-06-01 17:32:32 +00:00
|
|
|
|
2006-05-31 20:25:20 +00:00
|
|
|
LDFLAGS =
|
|
|
|
RM = rm -f FILE
|
|
|
|
ZLIBDIR = zlib/
|
|
|
|
|
|
|
|
ifeq (Windows_NT,$(OS))
|
|
|
|
EXE = zdbsp.exe
|
|
|
|
LDFLAGS += -luser32 -lgdi32
|
|
|
|
ifneq (msys,$(OSTYPE))
|
|
|
|
RM = del /q /f FILE 2>nul
|
|
|
|
ZLIBDIR = "zlib\"
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
EXE = zdbsp
|
|
|
|
CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNO_MAP_VIEWER=1
|
|
|
|
endif
|
|
|
|
|
2006-06-03 04:12:33 +00:00
|
|
|
# To generate profiling information for gprof, pass gprof=1 to make.
|
|
|
|
ifneq ($(gprof),)
|
|
|
|
CFLAGS += -g -fno-omit-frame-pointer -pg
|
|
|
|
LDFLAGS += -g -pg
|
|
|
|
endif
|
|
|
|
|
|
|
|
# To strip debugging symbols, pass strip=1 to make.
|
|
|
|
ifneq ($(strip),)
|
|
|
|
LDFLAGS += -s
|
|
|
|
endif
|
|
|
|
|
2006-06-06 19:15:39 +00:00
|
|
|
# To use SSE2 math for everything, pass sse=1 to make.
|
|
|
|
ifneq ($(sse),)
|
|
|
|
CFLAGS += -msse -msse2 -mfpmath=sse
|
|
|
|
endif
|
|
|
|
|
2006-05-31 20:25:20 +00:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
|
|
|
|
CXXFLAGS = $(CFLAGS)
|
|
|
|
|
|
|
|
OBJS = main.o getopt.o getopt1.o blockmapbuilder.o processor.o view.o wad.o \
|
|
|
|
nodebuild.o nodebuild_events.o nodebuild_extract.o nodebuild_gl.o \
|
2006-06-06 19:15:39 +00:00
|
|
|
nodebuild_utility.o nodebuild_classify_sse2.o nodebuild_classify_nosse2.o \
|
2006-05-31 20:25:20 +00:00
|
|
|
zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/trees.o \
|
|
|
|
zlib/zutil.o
|
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
profile:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LDFLAGS="$(LDFLAGS) -lgcov"
|
|
|
|
@echo "Process a few maps, then rebuild with make profile-use"
|
|
|
|
|
|
|
|
profile-use:
|
|
|
|
$(MAKE) clean
|
|
|
|
$(MAKE) all CXXFLAGS="$(CXXFLAGS) -fprofile-use"
|
|
|
|
|
|
|
|
$(EXE): $(OBJS)
|
|
|
|
$(CCDV) $(CXX) -o $(EXE) $(OBJS) $(LDFLAGS)
|
|
|
|
|
2006-06-06 19:15:39 +00:00
|
|
|
nodebuild_classify_sse2.o: nodebuild_classify_sse2.cpp nodebuild.h
|
|
|
|
$(CXX) $(CXXFLAGS) -msse2 -mfpmath=sse -c -o $@ $<
|
|
|
|
|
2006-05-31 20:25:20 +00:00
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(subst FILE,$(EXE),$(RM))
|
|
|
|
$(subst FILE,*.o,$(RM))
|
|
|
|
$(subst FILE,*.d,$(RM))
|
|
|
|
$(subst FILE,$(ZLIBDIR)*.o,$(RM))
|
|
|
|
$(subst FILE,$(ZLIBDIR)*.d,$(RM))
|
|
|
|
|
|
|
|
cleanprof:
|
|
|
|
$(subst FILE,*.gc*,$(RM))
|
|
|
|
$(subst FILE,$(ZLIBDIR)*.gc*,$(RM))
|
|
|
|
|
|
|
|
cleanall: clean cleanprof
|
|
|
|
|
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
|
|
|
-include $(OBJS:%.o=%.d)
|
|
|
|
endif
|