forked from guillaumechereau/goxel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (60 loc) · 1.9 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
SHELL = bash
ifeq ($(OS),Linux)
JOBS := "-j $(shell nproc)"
else
JOBS := "-j $(shell getconf _NPROCESSORS_ONLN)"
endif
.ONESHELL:
all: .FORCE
scons $(JOBS)
release:
scons $(JOBS) mode=release
profile:
scons $(JOBS) mode=profile
run:
./goxel
clean: .FORCE
scons -c
analyze:
scan-build scons mode=analyze
# For the moment only apply the format to uncommited changes.
format: .FORCE
git clang-format -f
# Generate an AppImage. Used by github CI.
appimage: .FORCE
scons mode=release nfd_backend=portal
rm -rf AppDir
mkdir AppDir
DESTDIR=AppDir PREFIX=/usr make install
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20231206-1/linuxdeploy-x86_64.AppImage \
--output linuxdeploy.AppImage -L -f
chmod +x linuxdeploy.AppImage
./linuxdeploy.AppImage --output=appimage --appdir=AppDir
# Targets to install/uninstall goxel and its data files on unix system.
PREFIX ?= /usr/local
.PHONY: install
install:
install -Dm755 goxel $(DESTDIR)$(PREFIX)/bin/goxel
for size in 16 24 32 48 64 128 256; do
install -Dm644 data/icons/icon$${size}.png \
$$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/icons/hicolor/ \
$${size}x$${size}/apps/goxel.png)
done
install -Dm644 snap/gui/goxel.desktop \
$(DESTDIR)$(PREFIX)/share/applications/goxel.desktop
install -Dm644 \
snap/gui/io.github.guillaumechereau.Goxel.metainfo.xml \
$$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/metainfo/ \
io.github.guillaumechereau.Goxel.metainfo.xml)
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/goxel
for size in 16 24 32 48 64 128 256; do \
rm -f $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/icons/hicolor/ \
$${size}x$${size}/apps/goxel.png)
done
rm -f $(DESTDIR)$(PREFIX)/share/applications/goxel.desktop
rm -f $$(printf '%s%s' $(DESTDIR)$(PREFIX)/share/metainfo/ \
io.github.guillaumechereau.Goxel.metainfo.xml)
.PHONY: all
.FORCE: