-
Notifications
You must be signed in to change notification settings - Fork 454
/
Makefile
160 lines (126 loc) · 4.42 KB
/
Makefile
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.PHONY: clean contributors run forum productionize deploy love
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
TMXTAR = tmx2lua.osx.tar
LOVE = bin/love.app/Contents/MacOS/love
else
TMXTAR = tmx2lua.linux.tar
LOVE = /usr/bin/love
endif
ifeq ($(shell which wget),)
wget = curl -O -L
else
wget = wget --no-check-certificate
endif
maps := $(patsubst %.tmx,%.lua,$(wildcard src/maps/*.tmx))
love: build/hawkthorne.love
build/hawkthorne.love: $(maps) src
mkdir -p build
cd src && zip -q -r ../build/hawkthorne.love . -x ".*" \
-x ".DS_Store" -x "*/full_soundtrack.ogg" -x "*.bak"
run: $(maps) $(LOVE)
$(LOVE) src
src/maps/%.lua: src/maps/%.tmx bin/tmx2lua
bin/tmx2lua $<
bin/tmx2lua:
mkdir -p bin
$(wget) http://hawkthorne.github.com/tmx2lua/downloads/$(TMXTAR)
tar -xvf $(TMXTAR)
rm -f $(TMXTAR)
mv tmx2lua bin
bin/love.app/Contents/MacOS/love:
mkdir -p bin
$(wget) https://bitbucket.org/kyleconroy/love/downloads/love-sparkle.zip
unzip -q love-sparkle.zip
rm -f love-sparkle.zip
mv love.app bin
cp osx/dsa_pub.pem bin/love.app/Contents/Resources
cp osx/Info.plist bin/love.app/Contents
/usr/bin/love:
sudo add-apt-repository ppa:bartbes/love-stable
sudo apt-get update
sudo apt-get install love
######################################################
# THE REST OF THESE TARGETS ARE FOR RELEASE AUTOMATION
######################################################
CI_TARGET=test
ifeq ($(TRAVIS), true)
ifeq ($(TRAVIS_BRANCH), release)
ifeq ($(TRAVIS_PULL_REQUEST), false)
CI_TARGET=clean test productionize upload deltas social
endif
endif
endif
positions: $(patsubst %.png,%.lua,$(wildcard src/positions/*.png))
src/positions/%.lua: psds/positions/%.png
overlay2lua src/positions/config.json $<
build/hawkthorne-win-x86.zip: build/hawkthorne.love
mkdir -p build
rm -rf hawkthorne
rm -f hawkthorne-win-x86.zip
cat win32/love.exe build/hawkthorne.love > win32/hawkthorne.exe
cp -r win32 hawkthorne
zip -q -r hawkthorne-win-x86 hawkthorne -x "*/love.exe"
mv hawkthorne-win-x86.zip build
win32/love.exe:
$(wget) https://bitbucket.org/kyleconroy/love/downloads/windows-build-files.zip
unzip -q windows-build-files.zip
rm -f windows-build-files.zip
build/hawkthorne-win-x64.zip: build/hawkthorne.love
mkdir -p build
rm -rf hawkthorne
rm -f hawkthorne-win-x64.zip
cat win64/love.exe build/hawkthorne.love > win64/hawkthorne.exe
cp -r win64 hawkthorne
zip -q -r hawkthorne-win-x64 hawkthorne -x "*/love.exe"
mv hawkthorne-win-x64.zip build
build/hawkthorne-osx.zip: bin/love.app/Contents/MacOS/love $(maps)
mkdir -p build
cp -r bin/love.app Journey\ to\ the\ Center\ of\ Hawkthorne.app
cp -r src Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/hawkthorne.love
rm -f Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/hawkthorne.love/.DS_Store
cp osx/Info.plist \
Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Info.plist
cp osx/Hawkthorne.icns \
Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/Love.icns
zip -q -r hawkthorne-osx Journey\ to\ the\ Center\ of\ Hawkthorne.app
mv hawkthorne-osx.zip build
rm -rf Journey\ to\ the\ Center\ of\ Hawkthorne.app
productionize:
venv/bin/python scripts/productionize.py
binaries: build/hawkthorne-osx.zip build/hawkthorne-win-x64.zip build/hawkthorne-win-x86.zip
upload: binaries venv
venv/bin/python scripts/upload_binaries.py
deltas: venv
venv/bin/python scripts/sparkle.py
cat sparkle/appcast.xml | xmllint -format - # Make sure the appcast is valid xml
venv/bin/python scripts/upload.py / sparkle/appcast.xml
social: venv post.md notes.html
venv/bin/python scripts/upload.py releases/$(current_version) notes.html
venv/bin/python scripts/socialize.py post.md
notes.html: post.md
venv/bin/python -m markdown post.md > notes.html
post.md:
venv/bin/python scripts/create_post.py $(shell git log master -n 1 --pretty=format:%H) post.md
venv:
virtualenv -q --python=python2.7 venv
venv/bin/pip install -q -r requirements.txt
deploy: $(CI_TARGET)
forum: venv
venv/bin/python scripts/create_forum_post.py
contributors: venv
venv/bin/python scripts/clean.py > CONTRIBUTORS
venv/bin/python scripts/credits.py > src/credits.lua
test:
busted spec
clean:
rm -rf build
rm -f release.md
rm -f post.md
rm -f notes.html
rm -rf src/maps/*.lua
rm -rf Journey\ to\ the\ Center\ of\ Hawkthorne.app
reset:
rm -rf ~/Library/Application\ Support/LOVE/hawkthorne/*.json
rm -rf $(XDG_DATA_HOME)/love/ ~/.local/share/love/
rm -rf src/maps/*.lua