-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (64 loc) · 3.25 KB
/
Copy pathMakefile
File metadata and controls
75 lines (64 loc) · 3.25 KB
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
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share/openbox
ICONDIR = $(PREFIX)/share/icons/hicolor/scalable/apps
DESKTOPDIR = $(PREFIX)/share/applications
METAINFODIR = $(PREFIX)/share/metainfo
LICENSEDIR = $(PREFIX)/share/licenses/openbox
PYTHON_SOURCES = $(shell sed '/^[[:space:]]*#/d;/^[[:space:]]*$$/d' runtime_modules.txt)
DATA_FILES = index.html openbox.svg openbox.metainfo.xml LICENSE assets/openbox-logo.png
STATIC_FILES = static/app.js static/app.css
NATIVE_HOST = native_host
.PHONY: install uninstall appimage check version-check dev-venv test-one native-host
native-host:
gcc -O2 native_host.c -o $(NATIVE_HOST) $$(pkg-config --cflags --libs webkit2gtk-4.1)
dev-venv:
python3 -m venv .venv-dev
.venv-dev/bin/pip install --disable-pip-version-check -r requirements-dev.txt
# Full verification gate: lint, compile, tests, coverage floors.
# Dev-only dependencies live in .venv-dev; the runtime app stays dep-free.
check: dev-venv
python3 scripts/check_tests.py
# A single test file, e.g. `make test-one TEST=test_saves.py`.
test-one:
python3 -B $(TEST)
# Fails when the version in updates.py disagrees with any published spot.
version-check:
python3 scripts/check_version_sync.py
install: native-host
install -d $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(SHAREDIR)
install -d $(DESTDIR)$(SHAREDIR)/themes
install -d $(DESTDIR)$(ICONDIR)
install -Dm755 openbox.sh $(DESTDIR)$(BINDIR)/openbox
install -Dm755 openbox-native.sh $(DESTDIR)$(BINDIR)/openbox-native
install -d $(DESTDIR)$(DESKTOPDIR)
install -d $(DESTDIR)$(METAINFODIR)
install -d $(DESTDIR)$(LICENSEDIR)
install -Dm755 $(NATIVE_HOST) $(DESTDIR)$(SHAREDIR)/$(NATIVE_HOST)
install -d $(DESTDIR)$(SHAREDIR)/emulator_defs
for f in emulator_defs/*.yaml; do install -Dm644 "$$f" "$(DESTDIR)$(SHAREDIR)/emulator_defs/"; done
install -Dm755 scripts/openbox-launcher.sh $(DESTDIR)$(SHAREDIR)/openbox-launcher.sh
# Runtime Python modules (web_app.py, the handlers/ package, parity_*.py,
# ...) from runtime_modules.txt, mirroring the repo layout under the share
# dir. `install -D` creates the handlers/ subdirectory as needed.
for f in $(PYTHON_SOURCES); do install -Dm644 "$$f" "$(DESTDIR)$(SHAREDIR)/$$f"; done
# plugin_catalog.py resolves plugins/catalog.json relative to its own path.
install -Dm644 plugins/catalog.json $(DESTDIR)$(SHAREDIR)/plugins/catalog.json
for f in $(DATA_FILES); do install -Dm644 "$$f" "$(DESTDIR)$(SHAREDIR)/$$f"; done
for f in $(STATIC_FILES); do install -Dm644 "$$f" "$(DESTDIR)$(SHAREDIR)/$$f"; done
for f in themes/*.css; do install -Dm644 "$$f" "$(DESTDIR)$(SHAREDIR)/$$f"; done
install -Dm644 openbox.desktop $(DESTDIR)$(DESKTOPDIR)/io.openbox.GameLauncher.desktop
install -Dm644 openbox.svg $(DESTDIR)$(ICONDIR)/io.openbox.GameLauncher.svg
install -Dm644 openbox.metainfo.xml $(DESTDIR)$(METAINFODIR)/io.openbox.GameLauncher.metainfo.xml
install -Dm644 LICENSE $(DESTDIR)$(LICENSEDIR)/LICENSE
uninstall:
rm -f $(DESTDIR)$(BINDIR)/openbox
rm -f $(DESTDIR)$(BINDIR)/openbox-native
rm -rf $(DESTDIR)$(SHAREDIR)
rm -f $(DESTDIR)$(ICONDIR)/io.openbox.GameLauncher.svg
rm -f $(DESTDIR)$(DESKTOPDIR)/io.openbox.GameLauncher.desktop
rm -f $(DESTDIR)$(METAINFODIR)/io.openbox.GameLauncher.metainfo.xml
rm -rf $(DESTDIR)$(LICENSEDIR)
appimage:
bash build_appimage.sh