summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2763928..b53033d 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ MKDIR_P = mkdir -p
SERVICE_USER = _lexd
SERVICE_GROUP = _lexd
-.PHONY: all clean distclean
+.PHONY: all clean distclean install install-user uninstall
all: $(TARGET)
@@ -100,11 +100,15 @@ install-user:
useradd -g $(SERVICE_GROUP) -s /sbin/nologin -m -c "lexd daemon user" $(SERVICE_USER); \
fi
-install: $(TARGET) install-user
+install: install-user
+ @if [ ! -f $(TARGET) ]; then \
+ echo "Error: $(TARGET) executable not found. Please build it first or provide the binary." >&2; \
+ exit 1; \
+ fi
@$(MKDIR_P) $(BINDIR)
@echo "===> Installing executable to $(BINDIR)/$(TARGET)..."
@$(INSTALL_PROGRAM) $(TARGET) $(BINDIR)/$(TARGET)
- @echo "===> Installing RC script to $(DESTDIR)$(RCDIR)/$(TARGET)..."
+ @echo "===> Installing RC script to $(RCDIR)/$(TARGET)..."
@$(MKDIR_P) $(RCDIR)
@$(INSTALL_SCRIPT) $(TARGET).rc $(RCDIR)/$(TARGET)
@echo "===> Creating data directory $(VARDIR)..."
@@ -129,5 +133,4 @@ clean:
rm -f $(TARGET) $(OBJS)
distclean: clean
- rm -rf deps
-
+ rm -rf deps \ No newline at end of file