VideoTools/Makefile

93 lines
2.3 KiB
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
@if ! command -v ffprobe >/dev/null 2>&1; then \
echo "✖ FFprobe not found. Please install FFprobe before continuing."; \
exit 1; \
else \
echo "✔ FFprobe found."; \
fi
@echo "✔ Environment OK."
@echo ""
# ------------------------
# Documentation
# ------------------------
docs:
@echo "Available documentation files:"
@ls -1 "$(DOCS)" | sed 's/^/ - /'
# ------------------------
# Help
# ------------------------
help:
@echo "VideoTools Makefile — available targets:"
@echo ""
@echo " make install Install the toolkit system-wide"
@echo " make uninstall Remove all installed files"
@echo " make verify Check FFmpeg, FFprobe, and environment"
@echo " make docs List available documentation"
@echo " make help Show this message"
@echo ""
@echo "Installation directories:"
@echo " Script: $(INSTALL_DIR)"
@echo " Docs : $(DOC_DIR)"
@echo ""
@echo "Note: Windows users can run 'make' via Git Bash or WSL."
# ------------------------
# End of File
# ------------------------