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:
parent
ed73ae5cca
commit
bc2130d5b1
40
Makefile
40
Makefile
|
|
@ -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
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
|
|
@ -6,7 +6,13 @@ BINDIR ?= $(PREFIX)/bin
|
|||
CARGO ?= cargo
|
||||
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
|
||||
ifeq ($(HAS_QT6_QML),yes)
|
||||
all: ui
|
||||
endif
|
||||
|
||||
build: release
|
||||
|
||||
|
|
@ -16,15 +22,31 @@ release:
|
|||
debug:
|
||||
$(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 -d $(BINDIR)
|
||||
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:
|
||||
rm -f $(BINDIR)/ork
|
||||
rm -f $(BINDIR)/ork-server
|
||||
rm -f $(BINDIR)/orkmode
|
||||
|
||||
clean:
|
||||
$(CARGO) clean
|
||||
rm -rf ui/build
|
||||
|
||||
test:
|
||||
$(CARGO) test $(CARGO_FLAGS)
|
||||
|
|
@ -40,12 +62,14 @@ fmt-check:
|
|||
$(CARGO) fmt -- --check
|
||||
|
||||
help:
|
||||
@echo "orkmode - org-mode parser and CLI"
|
||||
@echo "orkmode - org-mode implementation (CLI + server + GUI)"
|
||||
@echo ""
|
||||
@echo "Targets:"
|
||||
@echo " all, build, release Build release binary"
|
||||
@echo " debug Build debug binary"
|
||||
@echo " install Install to $(BINDIR)"
|
||||
@echo " all Build release (+ ui if Qt6 available)"
|
||||
@echo " release Build Rust binaries (ork, ork-server)"
|
||||
@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 " clean Remove build artifacts"
|
||||
@echo " test Run tests"
|
||||
|
|
@ -56,3 +80,9 @@ help:
|
|||
@echo "Variables:"
|
||||
@echo " PREFIX Installation prefix (default: ~/.local)"
|
||||
@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)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue