-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (58 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
78 lines (58 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
love=love
zip=/usr/bin/zip
luac=/usr/bin/luac
builddir=build
distdir=dist
windir=love-bin/love-0.8.0-win-x86
osxapp=love-bin/love.app
lin32=love-bin/love32
lin64=love-bin/love64
game=defract
sources=*.lua */*.lua
res=*/*.frag */*/*.frag *.ttf *.otf
readme=README.markdown
version=0.5.3
distname = $(game)-$(version)
.PHONY : run test love clean win
run : test
$(love) .
test :
$(luac) -p $(sources)
dist : love win osx lin32 lin64
love : $(builddir)/$(game).love
cp $(builddir)/$(game).love $(distdir)/$(distname).love
osx : $(builddir)/$(game).app
cd $(builddir); \
zip -9 -q -r ../$(distdir)/$(distname).osx.zip $(game).app
win : $(builddir)/$(game).exe
mkdir -p $(distdir)/$(distname)
cp $(windir)/*.dll $(readme) $(builddir)/$(game).exe $(distdir)/$(distname)
cd $(distdir); zip -q -r $(distname).win.zip $(distname)
rm -rf $(distdir)/$(distname)
lin32 : $(builddir)/$(game)-i686
mkdir -p $(distdir)/$(distname)
cp $(builddir)/$(game)-i686 $(readme) $(distdir)/$(distname)
cd $(distdir); zip -q -r $(distname)-i686.lin.zip $(distname)
rm -rf $(distdir)/$(distname)
lin64 : $(builddir)/$(game)-x86_64
mkdir -p $(distdir)/$(distname)
cp $(builddir)/$(game)-i686 $(readme) $(distdir)/$(distname)
cd $(distdir); zip -q -r $(distname)-x86_64.lin.zip $(distname)
rm -rf $(distdir)/$(distname)
$(builddir)/$(game).app : $(builddir)/$(game).love
cp -a $(osxapp) $(builddir)/$(game).app
cp $(builddir)/$(game).love $(builddir)/$(game).app/Contents/Resources/
cp $(readme) $(builddir)/$(game).app
$(builddir)/$(game).exe : $(builddir)/$(game).love
cat $(windir)/love.exe $(builddir)/$(game).love > $(builddir)/$(game).exe
$(builddir)/$(game)-i686 : $(builddir)/$(game).love
cat $(lin32) $(builddir)/$(game).love > $(builddir)/$(game)-i686
chmod +x $(builddir)/$(game)-i686
$(builddir)/$(game)-x86_64 : $(builddir)/$(game).love
cat $(lin64) $(builddir)/$(game).love > $(builddir)/$(game)-x86_64
chmod +x $(builddir)/$(game)-x86_64
$(builddir)/$(game).love : $(sources) $(res)
mkdir -p $(builddir)
$(zip) $(builddir)/$(game).love $(sources) $(res)
clean :
rm -rf $(builddir)/* $(distdir)/*