2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
SOURCEDIR=src
|
2009-08-27 19:53:52 +02:00
|
|
|
SMINCLUDES=env/include
|
2008-10-04 22:59:11 +02:00
|
|
|
BUILDDIR=build
|
2009-08-27 19:53:52 +02:00
|
|
|
SPCOMP=env/linux/bin/spcomp
|
2009-08-23 06:19:15 +02:00
|
|
|
VERSIONDUMP=./updateversion.sh
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
vpath %.sp $(SOURCEDIR)
|
|
|
|
vpath %.inc $(SOURCEDIR)/include
|
|
|
|
vpath %.smx $(BUILDDIR)
|
|
|
|
|
|
|
|
SOURCEFILES=$(SOURCEDIR)/*.sp
|
|
|
|
OBJECTS=$(patsubst %.sp, %.smx, $(notdir $(wildcard $(SOURCEFILES))))
|
|
|
|
|
|
|
|
all: prepare $(OBJECTS)
|
|
|
|
|
|
|
|
prepare: prepare_newlines prepare_builddir
|
|
|
|
|
|
|
|
prepare_newlines:
|
|
|
|
@echo "Removing windows newlines"
|
|
|
|
@find $(SOURCEDIR) -name \*.inc -exec dos2unix -p '{}' \;
|
|
|
|
@find $(SOURCEDIR) -name \*.sp -exec dos2unix -p '{}' \;
|
|
|
|
|
|
|
|
prepare_builddir:
|
|
|
|
@echo "Creating build directory"
|
|
|
|
@mkdir -p $(BUILDDIR)
|
|
|
|
|
|
|
|
%.smx: %.sp
|
2009-08-23 06:19:15 +02:00
|
|
|
$(VERSIONDUMP)
|
2009-08-27 19:53:52 +02:00
|
|
|
$(SPCOMP) -i$(SOURCEDIR) -i$(SOURCEDIR)/include -i$(SMINCLUDES) -o$(BUILDDIR)/$@ $<
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Removing build directory"
|
|
|
|
@rm -fr $(BUILDDIR)
|
|
|
|
|