Created
March 15, 2013 00:14
-
-
Save vrld/5166463 to your computer and use it in GitHub Desktop.
make love
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
love=$(/usr/bin/env love) | |
zip=$(/usr/bin/env zip) | |
luac=$(/usr/bin/env luac) | |
# path to win and osx distributions | |
windir=~/Stuff/love-win-x86 | |
osxapp=~/Stuff/love.0.8.app | |
game=TITLE-OF-THE-GAME.love | |
sources=*.lua **/*.lua | |
res=fonts/*.ttf gfx/*.png sound/*.ogg #adjust accordingly | |
# change this for out of tree builds. directories must exist | |
builddir=. | |
distdir=. | |
.PHONY : run test love clean win | |
run : test | |
$(love) . | |
test : | |
$(luac) -p $(sources) | |
dist : love win osx | |
love : $(builddir)/$(game).love | |
cp $(builddir)/$(game).love $(distdir)/$(game).love | |
osx : $(builddir)/$(game).app | |
cd $(builddir); \ | |
zip -9 -q -r ../$(distdir)/$(game).osx.zip $(game).app | |
win : $(builddir)/$(game).exe | |
cd $(builddir); \ | |
cp $(windir)/*.dll .; \ | |
zip -q ../$(distdir)/$(game).win.zip $(game).exe *.dll; \ | |
rm *.dll | |
$(builddir)/$(game).app : $(builddir)/$(game).love | |
cp -a $(osxapp) $(builddir)/$(game).app | |
cp $(builddir)/$(game).love $(builddir)/$(game).app/Contents/Resources/ | |
$(builddir)/$(game).exe : $(builddir)/$(game).love | |
cat $(windir)/love.exe $(builddir)/$(game).love > $(builddir)/$(game).exe | |
$(builddir)/$(game).love : $(sources) $(res) | |
mkdir -p $(builddir) | |
$(zip) $(builddir)/$(game).love $(sources) $(res) | |
clean : | |
rm -rf $(builddir)/* $(distdir)/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment