2008-08-20 22:58:09 +00:00
|
|
|
#
|
2006-04-13 20:47:06 +00:00
|
|
|
# Build Makefile for GNU Make
|
2008-08-20 22:58:09 +00:00
|
|
|
#
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# Notes:
|
|
|
|
# As of 6 July 2005, the engine should handle optimisations being enabled.
|
|
|
|
# If things seem to be going wrong, lower or disable optimisations, then
|
|
|
|
# try again. If things are still going wrong, call me.
|
|
|
|
#
|
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
include ../Makefile.common
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# SDK locations for Windows - adjust to match your setup
|
|
|
|
#
|
2010-12-19 22:29:01 +00:00
|
|
|
ifneq ($(DXROOT_OVERRIDE),)
|
|
|
|
DXROOT=$(DXROOT_OVERRIDE)
|
|
|
|
else
|
2012-03-12 04:48:42 +00:00
|
|
|
DXROOT=../../sdk/dx
|
2012-03-12 04:47:49 +00:00
|
|
|
#DXROOT=c:/sdks/directx/dx8
|
2010-12-19 22:29:01 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
FMODROOTWIN=c:/sdks/fmodapi374win/api
|
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Build locations - OBJ gets overridden to the game-specific objects dir
|
|
|
|
#
|
2006-08-31 01:54:23 +00:00
|
|
|
OBJ?=obj.gnu
|
|
|
|
SRC=src
|
|
|
|
RSRC=rsrc
|
|
|
|
INC=include
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-12 04:16:41 +00:00
|
|
|
# ENETROOT=$(SRC)/enet
|
2008-11-11 13:24:05 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Filename extensions - these won't need to change
|
|
|
|
#
|
2006-04-13 20:47:06 +00:00
|
|
|
o=o
|
|
|
|
res=o
|
|
|
|
asm=nasm
|
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Debugging and release
|
|
|
|
#
|
|
|
|
ifneq ($(RELEASE),0)
|
2010-07-03 08:53:57 +00:00
|
|
|
# Debugging disabled
|
2010-12-19 22:29:01 +00:00
|
|
|
debug+= $(F_NO_STACK_PROTECTOR)
|
2006-04-13 20:47:06 +00:00
|
|
|
else
|
2010-07-03 08:53:57 +00:00
|
|
|
# Debugging enabled
|
2010-12-19 22:29:01 +00:00
|
|
|
debug+= -DNOSDLPARACHUTE
|
2009-04-07 18:56:22 +00:00
|
|
|
endif
|
|
|
|
|
2012-03-23 20:22:10 +00:00
|
|
|
include Makefile.shared
|
|
|
|
|
|
|
|
OURCFLAGS=$(BASECFLAGS) -Wno-char-subscripts -I$(INC)
|
2012-03-12 04:48:42 +00:00
|
|
|
OURCONLYFLAGS=$(BASECONLYFLAGS)
|
2010-12-19 22:29:01 +00:00
|
|
|
OURCXXFLAGS=$(BASECXXFLAGS)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS=$(BASEASFLAGS)
|
|
|
|
OURLDFLAGS=$(BASELDFLAGS) $(BUILDLDFLAGS)
|
2008-09-26 17:20:10 +00:00
|
|
|
|
2011-12-04 18:09:50 +00:00
|
|
|
ifneq ($(LUNATIC),0)
|
2012-08-02 10:52:38 +00:00
|
|
|
OURCFLAGS+= -DLUNATIC
|
2011-12-04 18:09:50 +00:00
|
|
|
endif
|
|
|
|
|
2012-04-08 07:23:24 +00:00
|
|
|
UTILLIBS= -lm # -lpthread
|
2012-03-04 20:11:49 +00:00
|
|
|
UTILADDOBJS=
|
|
|
|
ifneq (0,$(NEDMALLOC))
|
|
|
|
UTILADDOBJS+= $(OBJ)/nedmalloc.$o
|
|
|
|
endif
|
2010-08-13 06:45:38 +00:00
|
|
|
|
2006-09-10 17:40:34 +00:00
|
|
|
ENGINEOBJS=
|
|
|
|
ifeq (0,$(NOASM))
|
|
|
|
ENGINEOBJS+= $(OBJ)/a.$o
|
2011-06-15 10:38:12 +00:00
|
|
|
else
|
|
|
|
ENGINEOBJS+= $(OBJ)/a-c.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
2010-05-03 08:30:25 +00:00
|
|
|
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
ENGINEOBJS+= \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/baselayer.$o \
|
|
|
|
$(OBJ)/cache1d.$o \
|
|
|
|
$(OBJ)/compat.$o \
|
|
|
|
$(OBJ)/crc32.$o \
|
|
|
|
$(OBJ)/defs.$o \
|
|
|
|
$(OBJ)/engine.$o \
|
2008-12-02 10:44:39 +00:00
|
|
|
$(OBJ)/polymost.$o \
|
|
|
|
$(OBJ)/hightile.$o \
|
|
|
|
$(OBJ)/textfont.$o \
|
|
|
|
$(OBJ)/smalltextfont.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/kplib.$o \
|
2009-12-05 09:22:43 +00:00
|
|
|
$(OBJ)/quicklz.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/md4.$o \
|
|
|
|
$(OBJ)/osd.$o \
|
|
|
|
$(OBJ)/pragmas.$o \
|
2009-06-09 02:12:35 +00:00
|
|
|
$(OBJ)/scriptfile.$o \
|
2010-05-18 00:30:30 +00:00
|
|
|
$(OBJ)/mutex.$o
|
2008-11-11 13:24:05 +00:00
|
|
|
|
2009-05-07 16:00:49 +00:00
|
|
|
ifeq (1,$(USE_OPENGL))
|
2010-08-12 21:06:51 +00:00
|
|
|
ENGINEOBJS+= $(OBJ)/mdsprite.$o
|
|
|
|
ENGINEOBJS+= $(OBJ)/glbuild.$o
|
2009-05-07 16:00:49 +00:00
|
|
|
endif
|
|
|
|
|
2008-05-10 01:29:37 +00:00
|
|
|
ifeq (1,$(POLYMER))
|
2010-08-12 21:06:51 +00:00
|
|
|
ENGINEOBJS+= $(OBJ)/polymer.$o
|
2008-05-10 01:29:37 +00:00
|
|
|
endif
|
2006-08-31 01:54:23 +00:00
|
|
|
|
2010-05-18 00:30:30 +00:00
|
|
|
ifeq (1,$(NEDMALLOC))
|
2010-08-12 21:06:51 +00:00
|
|
|
ENGINEOBJS+= $(OBJ)/nedmalloc.$o
|
2010-05-18 00:30:30 +00:00
|
|
|
endif
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
EDITOROBJS=$(OBJ)/build.$o \
|
|
|
|
$(OBJ)/config.$o
|
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# PLATFORM SPECIFIC SETTINGS
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
ifeq ($(PLATFORM),LINUX)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -f elf
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
2008-08-20 22:58:09 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2012-03-08 06:07:10 +00:00
|
|
|
ENGINEOBJS += $(OBJ)/osxbits.$o
|
|
|
|
ifneq (0,$(OSX_STARTUPWINDOW))
|
|
|
|
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o
|
|
|
|
endif
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS += -f macho -DUNDERSCORES
|
2011-10-11 16:53:52 +00:00
|
|
|
OURCFLAGS += -fno-pic -DUNDERSCORES
|
2008-08-20 22:58:09 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
ifeq ($(PLATFORM),BSD)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -f elf
|
2010-08-12 21:06:51 +00:00
|
|
|
OURCFLAGS+= -I/usr/X11R6/include
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2010-08-12 21:06:51 +00:00
|
|
|
OURCFLAGS+= -DUNDERSCORES -I$(DXROOT)/include -I$(FMODROOTWIN)/inc # -I$(ENETROOT)/include
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -DUNDERSCORES -f win32
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),BEOS)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -f elf
|
2010-08-12 21:06:51 +00:00
|
|
|
TARGETOPTS+= -DNOASM
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),SYLLABLE)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -f elf
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(RENDERTYPE),SDL)
|
2010-08-12 21:06:51 +00:00
|
|
|
ENGINEOBJS+= $(OBJ)/sdlayer.$o
|
2012-03-23 20:23:46 +00:00
|
|
|
|
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2012-03-26 05:04:21 +00:00
|
|
|
ifneq ($(findstring x86_64,$(ARCH)),x86_64)
|
|
|
|
ifeq (,$(ARCH))
|
|
|
|
ifneq ($(findstring x86_64,$(SYSARCH)),x86_64)
|
|
|
|
UTILLIBS += -read_only_relocs suppress
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
UTILLIBS += -read_only_relocs suppress
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-03-23 20:23:46 +00:00
|
|
|
ifeq (1,$(SDL_FRAMEWORK))
|
|
|
|
OURCFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
|
|
|
|
-I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
|
2012-03-26 05:04:21 +00:00
|
|
|
UTILLIBS += -Wl,-framework,SDL -Wl,-framework,SDL_mixer ../Apple/lib/libSDLmain.a
|
2012-03-23 20:23:46 +00:00
|
|
|
else
|
|
|
|
OURCFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
|
2012-03-26 05:04:21 +00:00
|
|
|
UTILLIBS += -lSDL_mixer
|
2012-03-23 20:23:46 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (0,$(SDL_FRAMEWORK))
|
|
|
|
OURCFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
|
|
|
UTILLIBS+= -lSDL_mixer
|
|
|
|
else
|
|
|
|
OURCFLAGS += -DSDL_FRAMEWORK
|
|
|
|
endif
|
2010-08-12 21:06:51 +00:00
|
|
|
|
|
|
|
ifeq (1,$(HAVE_GTK2))
|
|
|
|
OURCFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
|
|
|
ENGINEOBJS+= $(OBJ)/gtkbits.$o
|
|
|
|
ifeq ($(LINKED_GTK),0)
|
|
|
|
ENGINEOBJS+= $(OBJ)/dynamicgtk.$o
|
|
|
|
endif
|
|
|
|
EDITOROBJS+= $(OBJ)/startgtk.editor.$o
|
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(RENDERTYPE),WIN)
|
2010-08-12 21:06:51 +00:00
|
|
|
ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/startwin.editor.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
OURCFLAGS+= $(BUILDCFLAGS)
|
|
|
|
|
2008-10-22 04:14:30 +00:00
|
|
|
.SILENT:
|
2012-03-04 20:11:49 +00:00
|
|
|
.PHONY: clean cleanutils veryclean all utils enginelib editorlib
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
|
2012-03-23 20:23:46 +00:00
|
|
|
UTILOBJS=$(OBJ)/kextract.$o $(OBJ)/kgroup.$o $(OBJ)/transpal.$o $(OBJ)/wad2art.$o $(OBJ)/wad2map.$o $(OBJ)/kmd2tool.$o \
|
|
|
|
$(OBJ)/md2tool.$o \
|
2012-04-08 07:23:24 +00:00
|
|
|
$(OBJ)/generateicon.$o $(OBJ)/cacheinfo.$o $(OBJ)/arttool.$o $(OBJ)/givedepth.$o $(OBJ)/mkpalette.$o \
|
2012-03-18 08:48:32 +00:00
|
|
|
$(OBJ)/unpackssi.$o $(OBJ)/bsuite.$o \
|
2012-03-14 06:26:29 +00:00
|
|
|
$(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(OBJ)/pragmas.$o $(OBJ)/kplib.$o $(OBJ)/cache1d.$o
|
2012-03-23 20:23:46 +00:00
|
|
|
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX) kmd2tool$(EXESUFFIX) \
|
|
|
|
md2tool$(EXESUFFIX) \
|
2012-03-18 08:48:32 +00:00
|
|
|
generateicon$(EXESUFFIX) cacheinfo$(EXESUFFIX) arttool$(EXESUFFIX) givedepth$(EXESUFFIX) mkpalette$(EXESUFFIX) \
|
|
|
|
unpackssi$(EXESUFFIX) bsuite$(EXESUFFIX)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-04-08 07:23:24 +00:00
|
|
|
DXUTILOBJS=$(OBJ)/enumdisplay.$o $(OBJ)/getdxdidf.$o
|
|
|
|
DXUTILS=enumdisplay$(EXESUFFIX) getdxdidf$(EXESUFFIX)
|
|
|
|
|
|
|
|
SDLUTILOBJS=$(OBJ)/makesdlkeytrans.$o
|
|
|
|
SDLUTILS=makesdlkeytrans$(EXESUFFIX)
|
|
|
|
|
2008-10-22 04:14:30 +00:00
|
|
|
# all: $(OBJ)/$(ENGINELIB) $(OBJ)/$(EDITORLIB)
|
2012-04-08 07:23:24 +00:00
|
|
|
utils: start $(UTILS) finish utilfinish
|
|
|
|
dxutils: start $(DXUTILS) finish dxutilfinish
|
|
|
|
sdlutils: start $(SDLUTILS) finish sdlutilfinish
|
2012-03-12 04:48:42 +00:00
|
|
|
|
|
|
|
start:
|
|
|
|
$(BUILD_STARTED)
|
|
|
|
|
|
|
|
finish:
|
|
|
|
$(BUILD_FINISHED)
|
2012-04-08 07:23:24 +00:00
|
|
|
|
|
|
|
utilfinish:
|
2012-03-12 04:48:42 +00:00
|
|
|
@ls -l $(UTILS)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-04-08 07:23:24 +00:00
|
|
|
dxutilfinish:
|
|
|
|
@ls -l $(DXUTILS)
|
|
|
|
|
|
|
|
sdlutilfinish:
|
|
|
|
@ls -l $(SDLUTILS)
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
enginelib: $(OBJ)/$(ENGINELIB)
|
|
|
|
$(OBJ)/$(ENGINELIB): $(ENGINEOBJS)
|
2010-12-19 22:29:01 +00:00
|
|
|
$(BUILD_ECHOFLAGS)
|
|
|
|
$(ARCHIVE_STATUS)
|
|
|
|
if $(AR) rc $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
editorlib: $(OBJ)/$(EDITORLIB)
|
|
|
|
$(OBJ)/$(EDITORLIB): $(EDITOROBJS)
|
2010-12-19 22:29:01 +00:00
|
|
|
$(BUILD_ECHOFLAGS)
|
|
|
|
$(ARCHIVE_STATUS)
|
|
|
|
if $(AR) rc $@ $^; then $(ARCHIVE_OK); else $(ARCHIVE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
2012-03-04 20:11:49 +00:00
|
|
|
#pragmacheck$(EXESUFFIX): $(OBJ)/pragmacheck.$o $(OBJ)/pragmas.$o
|
|
|
|
# $(CC) $(subst -Dmain=app_main,,$(OURCFLAGS)) -o $@ $^
|
|
|
|
|
2012-03-12 04:48:42 +00:00
|
|
|
kextract$(EXESUFFIX): $(OBJ)/kextract.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
kgroup$(EXESUFFIX): $(OBJ)/kgroup.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
transpal$(EXESUFFIX): $(OBJ)/transpal.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
wad2art$(EXESUFFIX): $(OBJ)/wad2art.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
wad2map$(EXESUFFIX): $(OBJ)/wad2map.$o $(OBJ)/pragmas.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-23 20:23:46 +00:00
|
|
|
kmd2tool$(EXESUFFIX): $(OBJ)/kmd2tool.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
md2tool$(EXESUFFIX): $(OBJ)/md2tool.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-14 06:26:29 +00:00
|
|
|
generateicon$(EXESUFFIX): $(OBJ)/generateicon.$o $(OBJ)/compat.$o $(OBJ)/pragmas.$o $(OBJ)/kplib.$o \
|
|
|
|
$(OBJ)/cache1d.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
cacheinfo$(EXESUFFIX): $(OBJ)/cacheinfo.$o $(OBJ)/compat.$o $(OBJ)/compat_tools.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-14 06:26:29 +00:00
|
|
|
enumdisplay$(EXESUFFIX): $(OBJ)/enumdisplay.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT)/include -lgdi32; then $(ONESTEP_OK); fi
|
2012-03-23 20:23:46 +00:00
|
|
|
getdxdidf$(EXESUFFIX): $(OBJ)/getdxdidf.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS) -I$(DXROOT)/include -ldinput; then $(ONESTEP_OK); fi
|
|
|
|
makesdlkeytrans$(EXESUFFIX): $(OBJ)/makesdlkeytrans.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
arttool$(EXESUFFIX): $(OBJ)/arttool.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CXX) -o $@ $^ $(OURLDFLAGS) $(STATICSTDCPP) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
givedepth$(EXESUFFIX): $(OBJ)/givedepth.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
mkpalette$(EXESUFFIX): $(OBJ)/mkpalette.$o $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-18 08:48:32 +00:00
|
|
|
unpackssi$(EXESUFFIX): $(OBJ)/unpackssi.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2012-03-18 08:48:32 +00:00
|
|
|
bsuite$(EXESUFFIX): $(OBJ)/bsuite.$o $(UTILADDOBJS)
|
|
|
|
$(ONESTEP_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) -o $@ $^ $(OURLDFLAGS) $(UTILLIBS); then $(ONESTEP_OK); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# DEPENDENCIES
|
|
|
|
include Makefile.deps
|
|
|
|
|
|
|
|
# RULES
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.nasm
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(AS) $(OURASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-06-26 19:49:50 +00:00
|
|
|
# comment out to debug a-c.o
|
2012-06-13 23:13:23 +00:00
|
|
|
$(OBJ)/a-c.$o: $(SRC)/a-c.c
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CC) $(OURCONLYFLAGS) $(subst -O0,-O2,$(subst -fcatch-undefined-behavior,,$(OURCFLAGS))) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.m
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
|
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cc
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-08-20 22:58:09 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cpp
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-11-11 13:24:05 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cxx
|
2012-03-12 04:48:42 +00:00
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-11-11 13:24:05 +00:00
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/misc/%.c
|
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2012-03-14 06:26:29 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/misc/%.rc
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2008-10-19 12:14:04 +00:00
|
|
|
if $(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
|
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.cc
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.cpp
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.cxx
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(RSRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
2006-08-31 01:54:23 +00:00
|
|
|
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
|
|
|
|
|
|
|
# PHONIES
|
2008-08-20 22:58:09 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
clean:
|
2006-08-31 01:54:23 +00:00
|
|
|
-rm -f $(OBJ)/*
|
2012-03-12 04:47:49 +00:00
|
|
|
echo -n "" > $(OBJ)/keep.me
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-03-04 20:11:49 +00:00
|
|
|
cleanutils:
|
2012-04-08 07:23:24 +00:00
|
|
|
-rm -f $(UTILS) $(UTILOBJS) $(DXUTILS) $(DXUTILOBJS) $(SDLUTILS) $(SDLUTILOBJS) $(UTILADDOBJS)
|
2012-03-04 20:11:49 +00:00
|
|
|
|
2012-03-14 06:27:45 +00:00
|
|
|
printutils:
|
|
|
|
echo "$(UTILS)"
|
|
|
|
|
2012-04-08 07:23:24 +00:00
|
|
|
printdxutils:
|
|
|
|
echo "$(DXUTILS)"
|
|
|
|
|
|
|
|
printsdlutils:
|
|
|
|
echo "$(SDLUTILS)"
|
|
|
|
|
2012-03-04 20:11:49 +00:00
|
|
|
veryclean: clean cleanutils
|
|
|
|
-rm -f $(ENGINELIB) $(EDITORLIB)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
.PHONY: fixlineends
|
|
|
|
fixlineends:
|
|
|
|
for a in `find . -type f \( -name '*.c' -o -name '*.h' -o -name 'Makefile*' \) \! -path '*/.svn/*'`; do \
|
|
|
|
echo Fixing $$a && tr -d "\015" < $$a > $$a.fix && mv $$a.fix $$a; \
|
|
|
|
done
|
2008-11-11 13:24:05 +00:00
|
|
|
|
|
|
|
# DO NOT DELETE
|
|
|
|
|
|
|
|
|