aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
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
+