48 lines
1.1 KiB
Makefile
48 lines
1.1 KiB
Makefile
|
.PHONY: all build build-dev install clean uninstall run
|
||
|
|
||
|
PREFIX ?= /usr/local
|
||
|
BINDIR ?= $(PREFIX)/bin
|
||
|
LIBEXECDIR ?= $(PREFIX)/libexec
|
||
|
|
||
|
HELPER_DIR = $(LIBEXECDIR)/bscreensaver
|
||
|
HELPERS = \
|
||
|
bscreensaver-dbus-service \
|
||
|
bscreensaver-systemd \
|
||
|
bscreensaver-dialog-gtk3 \
|
||
|
$(NULL)
|
||
|
|
||
|
INSTALL ?= install
|
||
|
|
||
|
DEV_LOG_LEVEL = debug
|
||
|
|
||
|
all: build
|
||
|
|
||
|
build:
|
||
|
HELPER_DIR=$(HELPER_DIR) cargo build --release
|
||
|
|
||
|
build-dev:
|
||
|
HELPER_DIR=target/debug cargo build
|
||
|
|
||
|
install: build
|
||
|
$(INSTALL) -m 0755 -d $(BINDIR) $(HELPER_DIR)
|
||
|
$(INSTALL) -m 0755 target/release/bscreensaver $(BINDIR)
|
||
|
$(INSTALL) -m 0755 $(addprefix target/release/,$(HELPERS)) $(HELPER_DIR)
|
||
|
|
||
|
clean:
|
||
|
cargo clean
|
||
|
|
||
|
uninstall:
|
||
|
rm -f $(BINDIR)/bscreensaver $(addprefix $(HELPER_DIR)/,$(HELPERS)) || true
|
||
|
rmdir -p $(BINDIR) $(HELPER_DIR) || true
|
||
|
rmdir -p $(PREFIX) || true
|
||
|
|
||
|
run: build-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
|