qzdoom/Makefile.linux

150 lines
4 KiB
Text
Raw Normal View History

# created on 4/12/2006 by James Bentler
CXX ?= g++
CC ?= gcc
NASM ?= nasm
CCDV = @./ccdv
ifdef DEBUG
CFLAGS ?= -pipe -Wall -Wno-unused -fno-strict-aliasing
else
CFLAGS ?= -pipe -Wall -Wno-unused -fno-strict-aliasing -O2 -fomit-frame-pointer
CXXFLAGS ?= -fno-rtti
endif
ifdef GC
CFLAGS += -ffunction-sections
LDFLAGS += -Wl,--gc-sections
endif
CFLAGS += -MMD -DHAVE_FILELENGTH -D__forceinline=inline `sdl-config --cflags` `pkg-config gtk+-2.0 --cflags`
2006-04-17 13:53:34 +00:00
CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNEED_STRUPR
LDFLAGS += -lFLAC++ -lFLAC -lz -ljpeg -lfmod `sdl-config --libs` `pkg-config gtk+-2.0 --libs`
NASMFLAGS += -f elf -DM_TARGET_LINUX
SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ thingdef/)
VPATH = $(SRCDIRS)
INCLUDES = $(addprefix -I,$(SRCDIRS))
CFLAGS += $(INCLUDES)
RELEASEOBJ ?= releaseobj
DEBUGOBJ ?= debugobj
CPPSRCS = $(wildcard $(addsuffix *.cpp,$(SRCDIRS)))
CSRCS = $(wildcard $(addsuffix *.c,$(SRCDIRS)))
ifdef NOASM
CFLAGS += -DNOASM
else
ASRCS = $(wildcard src/*.nas)
CFLAGS += -DUSEASM=1
endif
SRCS = $(CSRCS) $(CPPSRCS) $(ASRCS)
CPPOBJFILES = $(notdir $(patsubst %.cpp,%.o,$(CPPSRCS)))
COBJFILES = $(notdir $(patsubst %.c,%.o,$(CSRCS)))
AOBJFILES = $(notdir $(patsubst %.nas,%.o,$(ASRCS)))
ZDOOM = zdoom
ZDOOMDEBUG = zdoomd
ifdef DEBUG
OBJDIR = $(DEBUGOBJ)
CFLAGS += -D_DEBUG -g3
NASMFLAGS += -g
ZDOOMBIN = $(ZDOOMDEBUG)
else
OBJDIR = $(RELEASEOBJ)
CFLAGS += -DNDEBUG
LDFLAGS += -Wl,-Map=$(ZDOOM).map
ifndef NOSTRIP
LDFLAGS += -s
endif
ZDOOMBIN = $(ZDOOM)
endif
CXXFLAGS += $(CFLAGS)
2006-04-17 13:53:34 +00:00
COBJS = $(addprefix $(OBJDIR)/,$(CPPOBJFILES) $(COBJFILES))
DEPS = $(patsubst %.o,%.d,$(COBJS))
OBJS = $(addprefix $(OBJDIR)/,$(AOBJFILES)) $(COBJS)
all: $(ZDOOMBIN) toolsandpk3 zdoom.pk3
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
$(ZDOOMBIN): ccdv updaterev $(OBJDIR) $(OBJS)
$(CCDV) $(CXX) $(LDFLAGS) $(OBJDIR)/autostart.o \
$(filter-out %/autostart.o %/autozend.o,$(OBJS)) \
$(OBJDIR)/autozend.o -o $(ZDOOMBIN)
$(OBJDIR)/%.o: %.cpp
$(CCDV) $(CXX) $(CXXFLAGS) -o $@ -c $<
$(OBJDIR)/%.o: %.c
$(CCDV) $(CC) $(CFLAGS) -o $@ -c $<
$(OBJDIR)/%.o: %.nas
$(CCDV) $(NASM) -o $@ $(NASMFLAGS) $<
# This file needs special handling so that it actually gets compiled with SSE2 support.
$(OBJDIR)/nodebuild_classify_sse2.o: 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 $@ $<
$(OBJDIR):
mkdir $(OBJDIR)
toolsandpk3: ccdv tools/makewad/makewad tools/dehsupp/dehsupp tools/xlatcc/xlatcc
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
$(MAKE) -C wadsrc/
zdoom.pk3: toolsandpk3
ln -sf wadsrc/zdoom.pk3 ./
tools/makewad/makewad:
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
$(MAKE) -C tools/makewad/
tools/dehsupp/dehsupp:
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
$(MAKE) -C tools/dehsupp/
tools/xlatcc/xlatcc:
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
$(MAKE) -C tools/xlatcc/
2006-04-17 13:53:34 +00:00
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
updaterev: tools/updaterevision/updaterevision
@tools/updaterevision/updaterevision . src/svnrevision.h
tools/updaterevision/updaterevision:
$(MAKE) -C tools/updaterevision
.PHONY : clean cleandeps cleanobjs distclean toolsandpk3 cleantools updaterev
2006-04-17 13:53:34 +00:00
clean: cleanobjs
rm -f $(ZDOOMDEBUG) $(ZDOOM) $(ZDOOM).map
rm -f ccdv
cleantools:
@$(MAKE) -C tools/makewad clean
@$(MAKE) -C tools/dehsupp clean
@$(MAKE) -C tools/xlatcc clean
cleandebug:
rm -f $(ZDOOMDEBUG) $(DEBUGOBJ)/*.o $(DEBUGOBJ)/*.d
-rmdir $(DEBUGOBJ)
cleanrelease:
rm -f $(ZDOOM) $(ZDOOM).map $(RELEASEOBJ)/*.o $(RELEASEOBJ)/*.o
-rmdir $(RELEASEOBJ)
2006-04-17 13:53:34 +00:00
# I could use a recursive delete instead, but that could be dangerous...
distclean: clean cleandeps
-rmdir $(RELEASEOBJ) $(DEBUGOBJ)
cleandeps:
rm -f $(RELEASEOBJ)/*.d $(DEBUGOBJ)/*.d
cleanobjs:
rm -f $(RELEASEOBJ)/*.o $(DEBUGOBJ)/*.o
ccdv: ccdv-posix.c
@gcc -Os -s ccdv-posix.c -o ccdv
- Unlimited the monster pain sounds in Hexen after playing as the Cleric a while and killing centaurs with the flechette. - Fixed: Moving to an old level in a hub caused the old player's inventory to spawn owned by the current player (but still hanging off the old player), so the game would hang when trying to delete it. - Modified re2c so that it doesn't add a date to the file it generates. Thus, if it regenerates a file during a full rebuild, SVN won't see it as a change. Also updated it to 0.10.5. - Fixed: SC_GetString() did not properly terminate sc_String when the last token in the file had no white space after it. Since I could not actually find the problem (it works fine in debug mode and I saw no logic errors), I decided to take this opportunity to reimplement it using an re2c-generated scanner. Now it's 1.6x faster than before and correctness is easier to verify. - Fixed: FMODSoundRenderer::Shutdown() also needs to reset NumChannels. - Added back the Manifest to zdoom.rc for non-VC8 Windows compilers. - Fixed MinGW compilation again. Now it uses the same method as Makefile.linux to find all the source files so that it doesn't need to be manually updated each time source files are added or removed. - Added the SVN revision number to the version string. A new tool is used to obtain this information from the svnversion command and write it into a header file. If you don't have the svn command line tools installed or didn't check it out from the repository, you can still build. I added some rules for this to Makefile.linux, and I assume they work because they do for Makefile.mingw. - Fixed: MIDISong2 did not delete MusHeader in its destructor. SVN r200 (trunk)
2006-06-20 20:30:39 +00:00
ifeq (,$(findstring $(MAKECMDGOALS),clean cleandeps cleanobjs distclean toolsandpk3 cleantools updaterev))
-include $(DEPS)
endif