One container build now produces all three packages from the same binary. build-deb.sh is renamed to build-packages.sh, make deb to make packages. The release workflow publishes the three packages with one SHA256SUMS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
69 lines
2.6 KiB
Makefile
69 lines
2.6 KiB
Makefile
# Build, check and install KorTerm. Plain cargo underneath; no containers involved.
|
|
|
|
PREFIX ?= $(HOME)/.local
|
|
BINDIR := $(PREFIX)/bin
|
|
APPDIR := $(PREFIX)/share/applications
|
|
ICONROOT := $(PREFIX)/share/icons/hicolor
|
|
SMALL_ICON_SIZES := 16 22 24 32 48 64
|
|
TRAY_ICON_SIZES := 16 22 24 32 48 64
|
|
APP_ID := me.r4ven.KorTerm
|
|
FONTDIR := $(PREFIX)/share/fonts/korterm
|
|
|
|
CARGO ?= cargo
|
|
BIN := target/release/korterm
|
|
|
|
# An empty PREFIX would install into /bin and /share.
|
|
ifeq ($(strip $(PREFIX)),)
|
|
$(error PREFIX must not be empty)
|
|
endif
|
|
|
|
.PHONY: help build run test lint check packages install uninstall clean
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
help: ## Show this help
|
|
@grep -E '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf " %-12s %s\n", $$1, $$2}'
|
|
|
|
build: ## Build the release binary
|
|
$(CARGO) build --release --locked
|
|
|
|
run: ## Run the debug build
|
|
$(CARGO) run
|
|
|
|
test: ## Run all tests
|
|
$(CARGO) test --workspace
|
|
|
|
lint: ## Check formatting and run clippy with warnings as errors
|
|
$(CARGO) fmt --check
|
|
$(CARGO) clippy --workspace --all-targets -- -D warnings
|
|
|
|
check: lint test ## Lint and test
|
|
|
|
packages: ## Build the .deb, .rpm and Arch packages in dist/ (needs Docker)
|
|
scripts/build-packages.sh
|
|
|
|
install: build ## Install the binary, desktop entry, icons and fonts under PREFIX (default ~/.local)
|
|
install -Dm755 "$(BIN)" "$(BINDIR)/korterm"
|
|
install -d "$(APPDIR)"
|
|
sed "s|@BINDIR@|$(BINDIR)|g" "data/$(APP_ID).desktop" > "$(APPDIR)/$(APP_ID).desktop"
|
|
chmod 644 "$(APPDIR)/$(APP_ID).desktop"
|
|
for s in $(SMALL_ICON_SIZES); do install -Dm644 "data/icons/$${s}x$${s}.png" "$(ICONROOT)/$${s}x$${s}/apps/$(APP_ID).png"; done
|
|
for s in $(TRAY_ICON_SIZES); do install -Dm644 "data/icons/tray-$${s}x$${s}.png" "$(ICONROOT)/$${s}x$${s}/apps/$(APP_ID)-tray.png"; done
|
|
|
|
install -Dm644 "data/$(APP_ID).png" "$(ICONROOT)/512x512/apps/$(APP_ID).png"
|
|
install -d "$(FONTDIR)"
|
|
install -m644 packaging/fonts/HackNerdFontMono-*.ttf "$(FONTDIR)/"
|
|
-fc-cache -f "$(FONTDIR)" 2>/dev/null
|
|
-update-desktop-database "$(APPDIR)" 2>/dev/null
|
|
if [ -f "$(PREFIX)/share/icons/hicolor/index.theme" ]; then gtk-update-icon-cache -q "$(PREFIX)/share/icons/hicolor"; fi
|
|
|
|
uninstall: ## Remove what install put in PREFIX
|
|
rm -f "$(BINDIR)/korterm" "$(APPDIR)/$(APP_ID).desktop" "$(ICONROOT)/512x512/apps/$(APP_ID).png"
|
|
for s in $(SMALL_ICON_SIZES); do rm -f "$(ICONROOT)/$${s}x$${s}/apps/$(APP_ID).png"; done
|
|
for s in $(TRAY_ICON_SIZES); do rm -f "$(ICONROOT)/$${s}x$${s}/apps/$(APP_ID)-tray.png"; done
|
|
rm -rf "$(FONTDIR)"
|
|
rm -f "$(ICONROOT)/scalable/actions/$(APP_ID)-split-stack-symbolic.svg"
|
|
-update-desktop-database "$(APPDIR)" 2>/dev/null
|
|
|
|
clean: ## Remove build artifacts
|
|
$(CARGO) clean
|