-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.74 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
# LD42
# Copyright (C) 2018 Artur "suve" Iwicki
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program (LICENCE-AGPL-v3.txt).
# If not, see <http://www.gnu.org/licenses/>.
GRAPHICS_DEVEL := $(shell ls gfx/*.png)
GRAPHICS_BUILD := $(GRAPHICS_DEVEL:gfx/%.png=build/%.png)
SOUNDS_DEVEL := $(shell ls sfx/*.wav)
SOUNDS_BUILD := $(SOUNDS_DEVEL:sfx/%.wav=build/%.wav)
SOURCES_DEVEL := $(shell ls src/*.js)
SOURCES_BUILD := $(SOURCES_DEVEL:src/%.js=build/%.js)
MAPS_DEVEL := $(shell ls map/*.png)
MAPS_BUILD := $(MAPS_DEVEL:map/%.png=build/map/%.js)
all: build/index.html build/style.css $(SOURCES_BUILD) $(GRAPHICS_BUILD) $(SOUNDS_BUILD) $(MAPS_BUILD)
build/%.html: src/%.html
mkdir -p build
cp "$<" "$@"
build/%.css: src/%.css
mkdir -p build
cp "$<" "$@"
build/map/%.js: map/%.png src/map-to-js.php
mkdir -p build/map
src/map-to-js.php "$<" > "$@"
build/%.js: src/%.js
mkdir -p build
cat "$<" | sed -e 's|"\.\./gfx/\([a-zA-Z0-9._+"\-]*\)");|"\1");|g' -e 's|"\.\./sfx/\([a-zA-Z0-9._\-]*\)"|"\1"|g' > "$@"
build/%.png: gfx/%.png
mkdir -p build
convert "$<" -transparent '#209C00' -transparent '#FF678B' "$@.transparent.png"
pngcrush "$@.transparent.png" "$@" >/dev/null 2>/dev/null
rm "$@.transparent.png"
build/%.wav: sfx/%.wav
mkdir -p build
cp "$<" "$@"
clean:
rm -rf build/