-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile.in
88 lines (66 loc) · 3.71 KB
/
Makefile.in
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
# User-configurable variables
DESTDIR ?=
# Convenience variables
FLAGS_SDL2 = -Fu./SDL2/units/
## -- Sources
SOURCES := $(filter-out src/ld25.pas, $(wildcard src/*.pas src/*.inc))
EXECUTABLE := build/$(EXE_PREFIX)colorful$(EXE_SUFFIX)
GFX_SOURCES := $(filter-out $(GFX_FILTER), $(wildcard gfx/*.png))
GFX_TARGETS := $(GFX_SOURCES:gfx/%.png=build/gfx/%.png)
MAP_SOURCES := $(wildcard map/*/*.txt)
MAP_TARGETS := $(MAP_SOURCES:map/%.txt=build/map/%.txt)
SFX_SOURCES := $(wildcard sfx/*.wav)
SFX_TARGETS := $(SFX_SOURCES:sfx/%.wav=build/sfx/%.ogg)
SLIDE_SOURCES := $(wildcard slides/*.png)
SLIDE_TARGETS := $(SLIDE_SOURCES:slides/%.png=build/slides/%.png)
## -- .PHONY targets
.PHONY = all assets clean executable install
all: assets executable
assets: $(GFX_TARGETS) $(MAP_TARGETS) $(SFX_TARGETS) $(SLIDE_TARGETS)
executable: $(EXECUTABLE)
clean:
rm -rf build/
install: all
# Executable
install -m 755 -p -D "$(EXECUTABLE)" "$(DESTDIR)$(PREFIX)/bin/colorful"
# Data files
install -m 755 -d "$(DESTDIR)$(PREFIX)/share/suve/colorful"
cp -t "$(DESTDIR)$(PREFIX)/share/suve/colorful/" -a build/gfx build/map build/sfx build/slides
# Icons
install -m 644 -p -D "pkg/colorful.svg" "$(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/colorful.svg"
install -m 644 -p -D "pkg/colorful-32x32.png" "$(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/colorful.png"
install -m 644 -p -D "pkg/colorful-64x64.png" "$(DESTDIR)$(PREFIX)/share/icons/hicolor/64x64/apps/colorful.png"
install -m 644 -p -D "pkg/colorful-128x128.png" "$(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/colorful.png"
# Desktop file and AppStream metadata
install -m 644 -p -D "pkg/pl.suve.colorful.desktop" "$(DESTDIR)$(PREFIX)/share/applications/pl.suve.colorful.desktop"
install -m 644 -p -D "pkg/pl.suve.colorful.metainfo.xml" "$(DESTDIR)$(PREFIX)/share/metainfo/pl.suve.colorful.metainfo.xml"
# Man pages
install -m 644 -p -D "pkg/man/en.man" "$(DESTDIR)$(PREFIX)/share/man/man6/colorful.6"
install -m 644 -p -D "pkg/man/de.man" "$(DESTDIR)$(PREFIX)/share/man/de/man6/colorful.6"
install -m 644 -p -D "pkg/man/es.man" "$(DESTDIR)$(PREFIX)/share/man/es/man6/colorful.6"
install -m 644 -p -D "pkg/man/fr.man" "$(DESTDIR)$(PREFIX)/share/man/fr/man6/colorful.6"
install -m 644 -p -D "pkg/man/he.man" "$(DESTDIR)$(PREFIX)/share/man/he/man6/colorful.6"
install -m 644 -p -D "pkg/man/id.man" "$(DESTDIR)$(PREFIX)/share/man/id/man6/colorful.6"
install -m 644 -p -D "pkg/man/nl.man" "$(DESTDIR)$(PREFIX)/share/man/nl/man6/colorful.6"
install -m 644 -p -D "pkg/man/pl.man" "$(DESTDIR)$(PREFIX)/share/man/pl/man6/colorful.6"
install -m 644 -p -D "pkg/man/pt.man" "$(DESTDIR)$(PREFIX)/share/man/pt/man6/colorful.6"
install -m 644 -p -D "pkg/man/pt_BR.man" "$(DESTDIR)$(PREFIX)/share/man/pt_BR/man6/colorful.6"
install -m 644 -p -D "pkg/man/ro.man" "$(DESTDIR)$(PREFIX)/share/man/ro/man6/colorful.6"
install -m 644 -p -D "pkg/man/ru.man" "$(DESTDIR)$(PREFIX)/share/man/ru/man6/colorful.6"
install -m 644 -p -D "pkg/man/uk.man" "$(DESTDIR)$(PREFIX)/share/man/uk/man6/colorful.6"
# -- Real targets
build/gfx/%.png: gfx/%.png
mkdir -p "$(dir $@)"
optipng -clobber -out "$@" "$<" >/dev/null 2>/dev/null
build/map/%.txt: map/%.txt
mkdir -p "$(dir $@)"
sed -e 's|\r$$||g' -e 's|^[\t]*||g' -e 's| 0*\([0-9][0-9]*\)| \1|g' -e '/^\[$(PLATFORM_BAD)\]/d' -e 's/^\[$(PLATFORM_GOOD)\]\s*//g' < "$<" > "$@"
build/sfx/%.ogg: sfx/%.wav
mkdir -p "$(dir $@)"
oggenc --quiet "--quality=$(OGG_QUALITY)" -o "$@" "$<"
build/slides/%.png: slides/%.png
mkdir -p "$(dir $@)"
optipng -clobber -out "$@" "$<" >/dev/null 2>/dev/null
$(EXECUTABLE): src/ld25.pas $(SOURCES)
mkdir -p "$(dir $@)/obj"
$(FPC) $(FLAGS_SDL2) -FUbuild/obj/ -o'$@' $(FPC_FLAGS) '$<'