bscreensaver/Makefile

57 lines
1.4 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-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-04 07:27:18 +00:00
$(INSTALL) -m 0755 -d $(BINDIR) $(HELPER_DIR) $(CONFIG_DIR)
$(INSTALL) -m 0755 target/release/bscreensaver $(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)
clean:
cargo clean
uninstall:
rm -f $(BINDIR)/bscreensaver $(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