VideoTools/Makefile

77 lines
1.9 KiB
Makefile

# root/Makefile
# Cross-platform installer for VideoTools (Linux / Windows via Git Bash or WSL)
PREFIX ?= /usr/local
INSTALL_DIR = $(PREFIX)/bin
DOC_DIR = $(PREFIX)/share/doc/videotools
SCRIPT = video-tools.sh
DOCS = docs
VERSION_FILE = VERSION
# ------------------------
# Installation
# ------------------------
install: verify
@echo "Installing VideoTools..."
@mkdir -p "$(INSTALL_DIR)"
@install -m 755 "$(SCRIPT)" "$(INSTALL_DIR)/video-tools"
@echo "✔ Installed script to $(INSTALL_DIR)/video-tools"
@mkdir -p "$(DOC_DIR)"
@cp -r "$(DOCS)"/* "$(DOC_DIR)/"
@echo "✔ Installed documentation to $(DOC_DIR)"
@if [ -f "$(VERSION_FILE)" ]; then \
VERSION=$$(cat $(VERSION_FILE)); \
echo "✔ VideoTools v$$VERSION installed successfully."; \
else \
echo "⚠ Version file not found. Install completed without version info."; \
fi
@echo ""
# ------------------------
# Uninstall
# ------------------------
uninstall:
@echo "Removing VideoTools..."
@rm -f "$(INSTALL_DIR)/video-tools"
@rm -rf "$(DOC_DIR)"
@echo "✔ VideoTools uninstalled."
# ------------------------
# Verification
# ------------------------
verify:
@echo "Checking environment..."
@if ! command -v ffmpeg >/dev/null 2>&1; then \
echo "✖ FFmpeg not found. Please install FFmpeg before continuing."; \
exit 1; \
else \
echo "✔ FFmpeg found."; \
fi
@echo "✔ Environment OK."
@echo ""
# ------------------------
# Documentation
# ------------------------
docs:
@echo "Available documentation files:"
@ls -1 "$(DOCS)"
# ------------------------
# Help
# ------------------------
help:
@echo "Available targets:"
@echo " make install Install the toolkit system-wide"
@echo " make uninstall Remove the toolkit"
@echo " make verify Check if FFmpeg and environment are ready"
@echo " make docs List documentation files"
@echo " make help Show this message"