Update Makefile to install all targets

- Add ork-server and orkmode (GUI) to install target
- Make UI build optional (only if Qt6 Qml available)
- Add ui target for explicit GUI build
- Clean ui/build directory on 'make clean'
- Update help text with requirements
This commit is contained in:
Levi Neely 2026-10-01 08:58:42 +02:00
parent ed73ae5cca
commit bc2130d5b1
1 changed files with 35 additions and 5 deletions

View File

@ -1,4 +1,4 @@
.PHONY: all build release debug install uninstall clean test check help .PHONY: all build release debug install uninstall clean test check help ui
PREFIX ?= $(HOME)/.local PREFIX ?= $(HOME)/.local
BINDIR ?= $(PREFIX)/bin BINDIR ?= $(PREFIX)/bin
@ -6,7 +6,13 @@ BINDIR ?= $(PREFIX)/bin
CARGO ?= cargo CARGO ?= cargo
CARGO_FLAGS ?= CARGO_FLAGS ?=
# Check if Qt6 Qml is available for UI build
HAS_QT6_QML := $(shell pkg-config --exists Qt6Qml 2>/dev/null && echo yes || echo no)
all: release all: release
ifeq ($(HAS_QT6_QML),yes)
all: ui
endif
build: release build: release
@ -16,15 +22,31 @@ release:
debug: debug:
$(CARGO) build $(CARGO_FLAGS) $(CARGO) build $(CARGO_FLAGS)
ui:
ifeq ($(HAS_QT6_QML),yes)
cmake -S ui -B ui/build -DCMAKE_BUILD_TYPE=Release
cmake --build ui/build -j
else
@echo "Skipping UI build: Qt6 Qml not found"
endif
install: release install: release
install -d $(BINDIR) install -d $(BINDIR)
install -m 755 target/release/ork $(BINDIR)/ork install -m 755 target/release/ork $(BINDIR)/ork
install -m 755 target/release/ork-server $(BINDIR)/ork-server
ifeq ($(HAS_QT6_QML),yes)
install: ui
install -m 755 ui/build/bin/orkmode $(BINDIR)/orkmode
endif
uninstall: uninstall:
rm -f $(BINDIR)/ork rm -f $(BINDIR)/ork
rm -f $(BINDIR)/ork-server
rm -f $(BINDIR)/orkmode
clean: clean:
$(CARGO) clean $(CARGO) clean
rm -rf ui/build
test: test:
$(CARGO) test $(CARGO_FLAGS) $(CARGO) test $(CARGO_FLAGS)
@ -40,12 +62,14 @@ fmt-check:
$(CARGO) fmt -- --check $(CARGO) fmt -- --check
help: help:
@echo "orkmode - org-mode parser and CLI" @echo "orkmode - org-mode implementation (CLI + server + GUI)"
@echo "" @echo ""
@echo "Targets:" @echo "Targets:"
@echo " all, build, release Build release binary" @echo " all Build release (+ ui if Qt6 available)"
@echo " debug Build debug binary" @echo " release Build Rust binaries (ork, ork-server)"
@echo " install Install to $(BINDIR)" @echo " ui Build Qt6/QML GUI (orkmode) [requires Qt6]"
@echo " debug Build debug Rust binaries"
@echo " install Install binaries to $(BINDIR)"
@echo " uninstall Remove from $(BINDIR)" @echo " uninstall Remove from $(BINDIR)"
@echo " clean Remove build artifacts" @echo " clean Remove build artifacts"
@echo " test Run tests" @echo " test Run tests"
@ -56,3 +80,9 @@ help:
@echo "Variables:" @echo "Variables:"
@echo " PREFIX Installation prefix (default: ~/.local)" @echo " PREFIX Installation prefix (default: ~/.local)"
@echo " CARGO Cargo command (default: cargo)" @echo " CARGO Cargo command (default: cargo)"
@echo ""
@echo "Requirements:"
@echo " Rust 1.70+, C compiler (tree-sitter)"
@echo " Qt 6.3+, CMake 3.21+ (optional, for ui target)"
@echo ""
@echo "Qt6 Qml detected: $(HAS_QT6_QML)"