forked from JosePedroDias/tetrisl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (56 loc) · 1.76 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
.PHONY: run-src symbolics clean dist run-dist test lua-repl screenshot capture capture-trim export-lua
os := $(shell uname)
ifeq ($(os),Darwin)
lua = lua5.1
luacheck = luacheck
love = /Applications/love.app/Contents/MacOS/love
open = open
else
lua = "c:\\ProgramData\\chocolatey\\lib\\lua51\\tools\\lua5.1.exe"
luacheck = "C:\\ProgramData\\chocolatey\\lib\\luarocks\\luarocks-2.4.4-win32\\systree\\bin\\luacheck.bat"
love = "C:\\Program Files\\LOVE\\lovec"
open = explorer
endif
rootd = `pwd`
srcd = "$(rootd)/src"
#srcd = c:\users\josep\Work\tetrisl\src
gamename = tetris.love
run-src:
@$(love) $(srcd)
symbolics:
@cd src && ln -s ../assets/fonts fonts && cd ..
@cd src && ln -s ../assets/images images && cd ..
@cd src && ln -s ../assets/sounds sounds && cd ..
clean:
@rm -rf dist src/fonts src/images src/sounds
dist:
@rm -rf dist build
@mkdir dist
@mkdir build
@cp -R src/* build
@find ./build -type f -exec sed -iE 's/src.//g' {} \;
@rm -rf ./build/*.luaE
@cd build && zip -9 -q -r ../dist/$(gamename) . && cd ..
@cd assets && zip -9 -q -r ../dist/$(gamename) . && cd ..
@rm -rf build
run-dist: dist
@$(love) dist/$(gamename)
export-lua:
@luarocks --lua-dir=/usr/local/opt/[email protected] path --bin
# not yet working for windows
lua-repl:
@$(lua) -i
lint:
@$(luacheck) src
test:
@$(lua) tests/testy.lua tests/board.lua
# @$(lua) tests/testy.lua tests/*.lua
run-server:
cd network && $(lua) server.lua
screenshot:
@ffmpeg -f gdigrab -framerate 15 -i title="tetris" -vframes 1 screenshot.jpg
capture:
@rm -f grab.mp4
@ffmpeg -f gdigrab -framerate 15 -i title="tetris" -b:v 1M grab.mp4
capture-trim:
@ffmpeg -ss 8 -i grab.mp4 -y -vcodec copy -to 30 -avoid_negative_ts make_zero grab2.mp4