Skip to content

Commit

Permalink
fix: Use DESTDIR properly in the Makefile and introduce PREFIX
Browse files Browse the repository at this point in the history
This allows for packaging tooling to use the Makefile properly.
  • Loading branch information
Conan-Kudo committed Nov 25, 2023
1 parent e98df05 commit 9cb5344
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
export CARGO_TARGET_DIR ?= ./target
DESTDIR ?= /usr/local
DESTDIR ?= /
PREFIX ?= /usr/local

build-release:
cargo build --release

install:
install -Dm755 target/release/lact ${DESTDIR}/bin/lact
install -Dm644 res/lactd.service ${DESTDIR}/lib/systemd/system/lactd.service
install -Dm755 res/io.github.lact-linux.desktop ${DESTDIR}/share/applications/io.github.lact-linux.desktop
install -Dm755 res/io.github.lact-linux.png ${DESTDIR}/share/pixmaps/io.github.lact-linux.png
install -Dm755 target/release/lact $(DESTDIR)$(PREFIX)/bin/lact
install -Dm644 res/lactd.service $(DESTDIR)$(PREFIX)/lib/systemd/system/lactd.service
install -Dm755 res/io.github.lact-linux.desktop $(DESTDIR)$(PREFIX)/share/applications/io.github.lact-linux.desktop
install -Dm755 res/io.github.lact-linux.png $(DESTDIR)$(PREFIX)/share/pixmaps/io.github.lact-linux.png

uninstall:
rm ${DESTDIR}/bin/lact
rm ${DESTDIR}/lib/systemd/system/lactd.service
rm ${DESTDIR}/share/applications/io.github.lact-linux.desktop
rm ${DESTDIR}/share/pixmaps/io.github.lact-linux.png
rm $(DESTDIR)$(PREFIX)/bin/lact
rm $(DESTDIR)$(PREFIX)/lib/systemd/system/lactd.service
rm $(DESTDIR)$(PREFIX)/share/applications/io.github.lact-linux.desktop
rm $(DESTDIR)$(PREFIX)/share/pixmaps/io.github.lact-linux.png

0 comments on commit 9cb5344

Please sign in to comment.