support CARGO_TARGET_DIR

This commit is contained in:
dengelt 2024-07-14 20:28:12 +02:00 committed by Jeremy Soller
parent e9e6cc275b
commit a6832ef888

View file

@ -5,6 +5,7 @@ includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(datarootdir)
CARGO_TARGET_DIR ?= target
TARGET = debug
DEBUG ?= 0
ifeq ($(DEBUG),0)
@ -32,7 +33,7 @@ $(BIN): Cargo.toml Cargo.lock src/main.rs vendor-check
cargo build $(ARGS) --bin ${BIN}
install:
install -Dm0755 target/$(TARGET)/$(BIN) $(DESTDIR)$(bindir)/$(BIN)
install -Dm0755 $(CARGO_TARGET_DIR)/$(TARGET)/$(BIN) $(DESTDIR)$(bindir)/$(BIN)
install -Dm0644 data/$(APPID).desktop $(DESTDIR)$(datadir)/applications/$(APPID).desktop
install -Dm0644 data/$(APPID).svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/$(APPID).svg