-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (44 loc) · 1.28 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
build_dir := build
debug_dir := $(build_dir)/debug
release_dir := $(build_dir)/release
deploy_dir := deploy
packer := $(build_dir)/packer
sdl_flags := `sdl2-config --cflags --libs` -lSDL2_gfx -lSDL2_ttf -lSDL2_image -lSDL2_mixer
release: $(release_dir)/zatacka
debug: $(debug_dir)/zatacka
run: release
$(release_dir)/zatacka
gdb: debug
gdb $(debug_dir)/zatacka
deploy: $(deploy_dir)/zatacka-linux.zip
$(debug_dir)/zatacka: code/*.cpp code/*.h Makefile $(build_dir)/resource.h
mkdir -p $(debug_dir)
g++ \
-o $@ \
-Og -g3 \
code/*.cpp \
$(build_dir)/resource.c -I$(build_dir) \
$(sdl_flags) \
-DVERSION="\"$(shell ./version_string.sh debug)\""
$(release_dir)/zatacka: code/*.cpp code/*.h Makefile $(build_dir)/resource.h
mkdir -p $(release_dir)
g++ \
-o $@ \
-O3 -s \
code/*.cpp \
$(build_dir)/resource.c -I$(build_dir) \
$(sdl_flags) \
-DVERSION="\"$(shell ./version_string.sh)\""
$(deploy_dir)/zatacka-linux.zip: $(release_dir)/zatacka
mkdir -p $(deploy_dir)
rm -f $@
zip -j $@ $^
$(build_dir)/resource.h: $(packer) res/death.png res/logo.png res/font_hun.ttf res/font_bold_hun.ttf
$(packer)
$(packer): packer/main.c packer/packer.c packer/packer.h Makefile
mkdir -p $(build_dir)
gcc -o $@ packer/*.c
.PHONY: clean
clean:
rm -rf $(build_dir)
rm -rf $(deploy_dir)