diff options
author | Leonard Kugis <leonard@kug.is> | 2025-10-06 15:35:57 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-10-06 15:35:57 +0200 |
commit | d0f9161188e70b1144db4739d97e20be872e06aa (patch) | |
tree | 8d9fd913724c1078018e819ded2625fafc7bff1d /Makefile | |
parent | 460fe72c98204758b12931efb15f5a35b387d6f3 (diff) | |
download | squashr-d0f9161188e70b1144db4739d97e20be872e06aa.tar.gz |
Implemented as Makefile project
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ffbdd73 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +# Konfigurierbare Variablen (Standard wie bei Autotools) +PREFIX ?= /usr/local +BINDIR ?= $(PREFIX)/bin +ETCDIR ?= /etc +DESTDIR ?= + +BIN := target/release/squashr +NAME := squashr + +.PHONY: all build release debug install uninstall clean + +all: release + +build: release + +release: + cargo build --release + +debug: + cargo build + +install: $(BIN) + # Binärdatei + install -d $(DESTDIR)$(BINDIR) + install -m 0755 $(BIN) $(DESTDIR)$(BINDIR)/$(NAME) + # Beispiel-Config nur anlegen, wenn noch nicht vorhanden + install -d $(DESTDIR)$(ETCDIR) + @if [ ! -f "$(DESTDIR)$(ETCDIR)/squashr.conf" ]; then \ + install -m 0644 packaging/squashr.conf "$(DESTDIR)$(ETCDIR)/squashr.conf"; \ + echo "Installed default $(ETCDIR)/squashr.conf"; \ + else \ + echo "Keeping existing $(ETCDIR)/squashr.conf"; \ + fi + @echo "Installed $(NAME) to $(DESTDIR)$(BINDIR)/$(NAME)" + +uninstall: + @rm -f "$(DESTDIR)$(BINDIR)/$(NAME)" + @echo "Removed $(DESTDIR)$(BINDIR)/$(NAME)" + @echo "(Keeping $(ETCDIR)/squashr.conf, remove manually if neccessary.)" + +clean: + cargo clean + |