sm-zombiereloaded-3/Makefile

50 lines
1.2 KiB
Makefile
Raw Normal View History

# Script made by [SG-10]Cpt.Moore
# Note that this script will convert line endings in source files to LF.
2008-10-04 22:59:11 +02:00
SOURCEDIR=src
SMINCLUDES=env/include
ZRINCLUDES=src/include
2008-10-04 22:59:11 +02:00
BUILDDIR=build
SPCOMP_LINUX=env/linux/bin/spcomp
SPCOMP_DARWIN=env/darwin/bin/spcomp
DOS2UNIX_LINUX=dos2unix
DOS2UNIX_DARWIN=env/darwin/bin/dos2unix -p
VERSIONDUMP=./updateversion.sh
2008-10-04 22:59:11 +02:00
OS = $(shell uname -s)
ifeq "$(OS)" "Darwin"
SPCOMP = $(SPCOMP_DARWIN)
DOS2UNIX = $(DOS2UNIX_DARWIN)
else
SPCOMP = $(SPCOMP_LINUX)
DOS2UNIX = $(DOS2UNIX_LINUX)
endif
2008-10-04 22:59:11 +02:00
vpath %.sp $(SOURCEDIR)
vpath %.inc $(SOURCEDIR)/zr
2008-10-04 22:59:11 +02:00
vpath %.smx $(BUILDDIR)
SOURCEFILES=$(SOURCEDIR)/*.sp
OBJECTS=$(patsubst %.sp, %.smx, $(notdir $(wildcard $(SOURCEFILES))))
all: prepare $(OBJECTS)
2008-10-04 22:59:11 +02:00
prepare: clean prepare_builddir
2008-10-04 22:59:11 +02:00
prepare_newlines:
@echo "Removing windows newlines"
@find $(SOURCEDIR) -name \*.inc -exec $(DOS2UNIX) "{}" \;
@find $(SOURCEDIR) -name \*.sp -exec $(DOS2UNIX) "{}" \;
@find $(SMINCLUDES) -name \*.inc -exec $(DOS2UNIX) "{}" \;
@find $(ZRINCLUDES) -name \*.inc -exec $(DOS2UNIX) "{}" \;
2008-10-04 22:59:11 +02:00
prepare_builddir:
@mkdir -p $(BUILDDIR)
%.smx: %.sp
$(VERSIONDUMP)
$(SPCOMP) -w241 -i$(SOURCEDIR) -i$(SMINCLUDES) -i$(ZRINCLUDES) -o$(BUILDDIR)/$@ $<
2008-10-04 22:59:11 +02:00
clean:
@rm -fr $(BUILDDIR)