bscreensaver/Makefile

60 lines
1.7 KiB
Makefile
Raw Normal View History

2022-05-04 07:51:14 +00:00
.PHONY: all release dev install clean uninstall run run-dialog
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBEXECDIR ?= $(PREFIX)/libexec
2022-05-04 07:27:18 +00:00
SYSCONFDIR ?= $(PREFIX)/etc
2022-05-05 08:14:53 +00:00
DATADIR ?= $(PREFIX)/share
2022-05-05 08:14:53 +00:00
APPLICATIONS_DIR = $(DATADIR)/applications
2022-05-04 07:27:18 +00:00
CONFIG_DIR = $(SYSCONFDIR)/xdg/bscreensaver
HELPER_DIR = $(LIBEXECDIR)/bscreensaver
HELPERS = \
bscreensaver-dbus-service \
bscreensaver-systemd \
bscreensaver-dialog-gtk3 \
$(NULL)
INSTALL ?= install
DEV_LOG_LEVEL = debug
2022-05-04 07:51:14 +00:00
all: release
2022-05-04 07:51:14 +00:00
release:
HELPER_DIR=$(HELPER_DIR) cargo build --release
2022-05-04 07:51:14 +00:00
dev:
HELPER_DIR=target/debug cargo build
2022-05-04 07:51:14 +00:00
install: release
2022-05-05 08:14:53 +00:00
$(INSTALL) -m 0755 -d $(BINDIR) $(HELPER_DIR) $(CONFIG_DIR) $(APPLICATIONS_DIR)
$(INSTALL) -m 0755 target/release/bscreensaver target/release/bscreensaver-command target/release/bscreensaver-settings $(BINDIR)
$(INSTALL) -m 0755 $(addprefix target/release/,$(HELPERS)) $(HELPER_DIR)
2022-05-04 07:27:18 +00:00
$(INSTALL) -m 0644 bscreensaver.toml.example $(CONFIG_DIR)
2022-05-05 08:14:53 +00:00
$(INSTALL) -m 0644 settings/bscreensaver-settings.desktop $(APPLICATIONS_DIR)
clean:
cargo clean
uninstall:
2022-05-05 08:14:53 +00:00
rm -f $(BINDIR)/bscreensaver $(BINDIR)/bscreensaver-command $(BINDIR)/bscreensaver-settings $(addprefix $(HELPER_DIR)/,$(HELPERS)) || true
rmdir -p $(BINDIR) $(HELPER_DIR) || true
rmdir -p $(PREFIX) || true
2022-05-04 07:51:14 +00:00
run: dev
BSCREENSAVER_LOCAL_DEV=1 \
RUST_BACKTRACE=1 \
BSCREENSAVER_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_DBUS_SERVICE_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_SYSTEMD_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_DIALOG_GTK3_LOG=$(DEV_LOG_LEVEL) \
HELPER_DIR=target/debug \
cargo run --bin bscreensaver
2022-05-04 06:47:06 +00:00
run-dialog:
RUST_BACKTRACE=1 \
BSCREENSAVER_DIALOG_GTK3_LOG=$(DEV_LOG_LEVEL) \
BSCREENSAVER_DIALOG_STANDALONE=1 \
cargo run --bin bscreensaver-dialog-gtk3