.PHONY: build-oxt install uninstall install-dev test clean help # Build .oxt extension package (self-contained with silo_client) build-oxt: @echo "Building silo-calc.oxt..." @rm -rf _oxt_build && mkdir _oxt_build @cp -r pythonpath description META-INF *.py *.xml *.xcu _oxt_build/ @cp -r silo-client/silo_client _oxt_build/pythonpath/silo_client @cd _oxt_build && zip -r ../silo-calc.oxt . -x '*.pyc' '*__pycache__/*' @rm -rf _oxt_build @echo "Built silo-calc.oxt" # Install extension system-wide (requires unopkg) install: build-oxt unopkg add --shared silo-calc.oxt 2>/dev/null || unopkg add silo-calc.oxt @echo "Installed silo-calc extension. Restart LibreOffice to load." # Uninstall extension uninstall: unopkg remove io.kindredsystems.silo.calc 2>/dev/null || true @echo "Uninstalled silo-calc extension." # Development install: symlink into user extensions dir install-dev: @CALC_EXT_DIR="$${HOME}/.config/libreoffice/4/user/extensions"; \ if [ -d "$$CALC_EXT_DIR" ]; then \ rm -rf "$$CALC_EXT_DIR/silo-calc"; \ ln -sf $(PWD) "$$CALC_EXT_DIR/silo-calc"; \ echo "Symlinked to $$CALC_EXT_DIR/silo-calc"; \ else \ echo "LibreOffice extensions dir not found at $$CALC_EXT_DIR"; \ echo "Try: make install (uses unopkg)"; \ fi @echo "Restart LibreOffice to load the Silo Calc extension" # Run Python tests test: python3 -m unittest tests/test_basics.py -v # Clean build artifacts clean: rm -f silo-calc.oxt rm -rf _oxt_build help: @echo "silo-calc targets:" @echo " build-oxt - Build .oxt extension package" @echo " install - Install extension (uses unopkg)" @echo " install-dev - Symlink for development" @echo " uninstall - Remove extension" @echo " test - Run Python tests" @echo " clean - Remove build artifacts"