File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ INSTALL_PREFIX ?= /usr/local/bin
2+
3+ .PHONY : all
4+ all : target/release/backlightd target/release/backlightctl
5+
6+ target/release/backlightd : backlightd/Cargo.toml $(shell ls -1 backlightd/src/* .rs)
7+ cargo test --frozen --bin backlightd
8+ cargo build --frozen --release --bin backlightd
9+
10+ target/release/backlightctl : backlightctl/Cargo.toml $(shell ls -1 backlightctl/src/* .rs)
11+ cargo test --frozen --bin backlightctl
12+ cargo build --frozen --release --bin backlightctl
13+
14+ .PHONY : install
15+ install :
16+ install -Dm 755 -t $(INSTALL_PREFIX ) target/release/backlightd
17+ install -Dm 755 -t $(INSTALL_PREFIX ) target/release/backlightctl
18+ install -Dm 755 -t /etc/systemd/system backlightd.service
19+ sed -i ' s+$$INSTALL_PREFIX+$(INSTALL_PREFIX)+g' /etc/systemd/system/backlightd.service
20+ systemctl daemon-reload
21+ systemctl enable backlightd
22+ systemctl restart backlightd
23+
24+ .PHONY : clean
25+ clean :
26+ rm -rf target/release
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Description=A backlight daemon that allows you to manage the backlight of all ki
44[Service]
55Type =simple
66Restart =always
7- ExecStart =/usr/bin /backlightd
7+ ExecStart =$INSTALL_PREFIX /backlightd
88ProtectSystem =strict
99ReadWritePaths =/var/cache /run
1010ProtectHome =tmpfs
You can’t perform that action at this time.
0 commit comments