mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-30 16:00:55 +00:00
01f59fa85f
heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. SVN r995 (trunk)
162 lines
5.1 KiB
Text
162 lines
5.1 KiB
Text
# This makefile makes zdoom(d).exe only.
|
|
# Makefile.mgw builds this plus everything else.
|
|
|
|
# Sub-makefile autogenerated by premake
|
|
# And then tweaked by hand
|
|
|
|
# Where did you install the FMOD API to? Change this line so that the build process can find it.
|
|
FMODDIR = "e:/program files (x86)/FMOD SoundSystem/FMOD Programmers API Win32"
|
|
|
|
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
|
|
WINCMD=0
|
|
else
|
|
WINCMD=1
|
|
endif
|
|
|
|
CC ?= gcc
|
|
CXX ?= g++
|
|
|
|
CONFIG ?= Release
|
|
OPTLEVEL ?= 2
|
|
ARCH_TYPE ?= pentium
|
|
TUNE_TYPE ?= i686
|
|
RELEASETARGET ?= zdoomgcc.exe
|
|
DEBUGTARGET ?= zdoomgccd.exe
|
|
DEBUGOBJDIR ?= debugobj
|
|
RELEASEOBJDIR ?= releaseobj
|
|
|
|
# Can be libdumbd.a, if you really need to debug DUMB
|
|
DUMBLIB ?= libdumb.a
|
|
|
|
CCDV ?= @ccdv
|
|
RE2C = tools/re2c/re2c
|
|
LEMON = tools/lemon/lemon
|
|
|
|
CPPFLAGS = -DWIN32 -D_WIN32 -D_WINDOWS -DHAVE_STRUPR -DHAVE_FILELENGTH -DI_DO_NOT_LIKE_BIG_DOWNLOADS -D__forceinline=inline -MMD -Izlib -IFLAC -Ijpeg-6b -Isrc -Isrc/win32 -Isrc/g_doom -Isrc/g_heretic -Isrc/g_hexen -Isrc/g_raven -Isrc/g_strife -Isrc/g_shared -Isrc/oplsynth -Isrc/sound -Isrc/textures -Isrc/thingdef -Isnes_spc/snes_spc
|
|
ifdef FMODDIR
|
|
CPPFLAGS += -I$(FMODDIR)/api/inc
|
|
LDFLAGS += -L$(FMODDIR)/api/lib
|
|
endif
|
|
|
|
LDFLAGS += zlib/libz.a jpeg-6b/libjpeg.a snes_spc/libsnes_spc.a dumb/lib/$(DUMBLIB) -lfmodex -lwsock32 -lwinmm -lddraw -ldsound -ldxguid -ldinput8 -lole32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32
|
|
LDFLAGS += -lsetupapi -Wl,--subsystem,windows -lws2_32
|
|
|
|
CFLAGS += -fno-strict-aliasing
|
|
|
|
ifeq ($(CONFIG),Debug)
|
|
OBJDIR = $(DEBUGOBJDIR)
|
|
CFLAGS += $(CPPFLAGS) -Wall -Wno-unused -g3
|
|
CPPFLAGS += -D_DEBUG
|
|
CXXFLAGS = $(CFLAGS)
|
|
TARGET = $(DEBUGTARGET)
|
|
endif
|
|
ifeq ($(CONFIG),Release)
|
|
OBJDIR = $(RELEASEOBJDIR)
|
|
CFLAGS += $(CPPFLAGS) -march=$(ARCH_TYPE) -mtune=$(TUNE_TYPE) -Wall -Wno-unused -O$(OPTLEVEL) -fomit-frame-pointer -pipe
|
|
CFLAGS += -ffunction-sections -fno-rtti
|
|
CPPFLAGS += -DNDEBUG
|
|
CXXFLAGS = $(CFLAGS)
|
|
LDFLAGS += -s -Wl,-Map=zdoomgcc.map -Wl,--gc-sections
|
|
TARGET = $(RELEASETARGET)
|
|
endif
|
|
|
|
SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ win32/ textures/ thingdef/ timidity/)
|
|
VPATH = $(SRCDIRS)
|
|
|
|
CPPSRCS = $(wildcard $(addsuffix *.cpp,$(SRCDIRS))) src/xlat/parse_xlat.cpp
|
|
CSRCS = $(wildcard $(addsuffix *.c,$(SRCDIRS)))
|
|
RCSRCS = $(wildcard $(addsuffix *.rc,$(SRCDIRS)))
|
|
ifdef NOASM
|
|
CFLAGS += -DNOASM
|
|
else
|
|
ASRCS = $(wildcard src/*.nas)
|
|
CFLAGS += -DUSEASM=1
|
|
endif
|
|
SRCS = $(CSRCS) $(CPPSRCS) $(ASRCS)
|
|
CPPOBJFILES = $(notdir $(CPPSRCS:%.cpp=%.o))
|
|
COBJFILES = $(notdir $(CSRCS:%.c=%.o))
|
|
# win32/wrappers.nas should be built *only* for Visual C++ 2005 to enable execution on Windows 95
|
|
AOBJFILES = $(filter-out %/wrappers.o,$(notdir $(ASRCS:%.nas=%.o)))
|
|
RCOBJFILES = $(notdir $(RCSRCS:%.rc=%.o))
|
|
|
|
COBJS = $(addprefix $(OBJDIR)/,$(CPPOBJFILES) $(COBJFILES) $(RCOBJFILES))
|
|
DEPS = $(patsubst %.o,%.d,$(COBJS))
|
|
UNORDEREDOBJS = $(addprefix $(OBJDIR)/,$(AOBJFILES)) $(COBJS)
|
|
|
|
OBJS = $(OBJDIR)/autostart.o $(filter-out %/autostart.o %/autozend.o,$(UNORDEREDOBJS)) $(OBJDIR)/autozend.o
|
|
|
|
all: $(TARGET)
|
|
|
|
# This file needs special handling so that it actually gets compiled with SSE2 support.
|
|
$(OBJDIR)/nodebuild_classify_sse2.o: src/nodebuild_classify_sse2.cpp
|
|
$(CCDV) $(CXX) $(CXXFLAGS) -msse2 -mfpmath=sse -c -o $@ $<
|
|
|
|
# This file needs special handling because GCC misoptimizes it otherwise.
|
|
$(OBJDIR)/fmopl.o: src/oplsynth/fmopl.cpp
|
|
$(CCDV) $(CXX) $(CXXFLAGS) -fno-tree-dominator-opts -fno-tree-fre -c -o $@ $<
|
|
|
|
src/sc_man_scanner.h: src/sc_man_scanner.re
|
|
$(CCDV) $(RE2C) -s -o $@ $<
|
|
|
|
src/xlat/xlat_parser.c: src/xlat/xlat_parser.y
|
|
$(CCDV) $(LEMON) -s src/xlat/xlat_parser.y
|
|
|
|
# Dunno why make isn't picking this stuff up automatically for this file.
|
|
$(OBJDIR)/parse_xlat.o: src/xlat/parse_xlat.cpp src/xlat/xlat.h src/xlat/xlat_parser.c src/xlat/xlat_parser.h
|
|
$(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
|
|
$(OBJDIR)/%.o : %.cpp
|
|
$(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
|
|
$(OBJDIR)/%.o : %.nas
|
|
$(CCDV) nasm -o $@ -f win32 $<
|
|
@tools/fixrtext/fixrtext $@
|
|
|
|
$(OBJDIR)/%.o : %.rc
|
|
$(CCDV) windres --include-dir=src/win32 -o $@ -i $<
|
|
|
|
|
|
$(TARGET): testobjdir updaterev $(OBJS)
|
|
$(CCDV) $(CXX) -o $@ $(OBJS) $(LDFLAGS)
|
|
|
|
ifeq (1,$(WINCMD))
|
|
clean:
|
|
-del /q /f $(RELEASETARGET) 2>nul
|
|
-del /q /f $(DEBUGTARGET) 2>nul
|
|
-del /q /f $(DEBUGOBJDIR) 2>nul
|
|
-del /q /f $(RELEASEOBJDIR) 2>nul
|
|
|
|
cleandep:
|
|
-del /q /f $(DEBUGOBJDIR)\*.d 2>nul
|
|
-del /q /f $(RELEASEOBJDIR)\*.d 2>nul
|
|
else
|
|
clean:
|
|
rm -f $(RELEASETARGET)
|
|
rm -f $(DEBUGTARGET)
|
|
rm -fr $(DEBUGOBJDIR)
|
|
rm -fr $(RELEASEOBJDIR)
|
|
|
|
cleandep:
|
|
rm -f $(DEBUGOBJDIR)/*.d
|
|
rm -f $(RELEASEOBJDIR)/*.d
|
|
endif
|
|
|
|
testobjdir:
|
|
ifeq (1,$(WINCMD))
|
|
-@if not exist $(OBJDIR) mkdir $(OBJDIR)
|
|
else
|
|
-@if [ ! -e $(OBJDIR) ]; then mkdir $(OBJDIR); fi
|
|
endif
|
|
|
|
updaterev: tools/updaterevision/updaterevision.exe
|
|
@tools/updaterevision/updaterevision . src/svnrevision.h
|
|
|
|
tools/updaterevision/updaterevision.exe:
|
|
$(MAKE) -C tools/updaterevision
|
|
|
|
|
|
ifeq (,$(findstring $(MAKECMDGOALS),clean cleandep updaterev))
|
|
-include $(DEPS)
|
|
endif
|
|
|
|
.PHONY: clean all updaterev testobjdir cleandep
|