Skip to content

Instantly share code, notes, and snippets.

@josefnpat
Forked from vrld/gist:5166463
Created March 15, 2013 00:16
Show Gist options
  • Save josefnpat/5166476 to your computer and use it in GitHub Desktop.
Save josefnpat/5166476 to your computer and use it in GitHub Desktop.
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