Makefile 798 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Simple Makefile for Bifrost prompt-rewriter plugin
  2. PLUGIN_NAME := prompt-rewriter
  3. SO_FILE := $(PLUGIN_NAME).so
  4. GO_FILES := main.go
  5. # Default target
  6. .PHONY: all
  7. all: build
  8. # Build the shared object plugin
  9. .PHONY: build
  10. build:
  11. @echo "Building $(SO_FILE)..."
  12. go build -buildmode=plugin -o $(SO_FILE) .
  13. @echo "Done → $(SO_FILE)"
  14. # Download / tidy dependencies
  15. .PHONY: deps
  16. deps:
  17. go mod tidy
  18. # Clean build artifacts
  19. .PHONY: clean
  20. clean:
  21. rm -f $(SO_FILE)
  22. @echo "Cleaned"
  23. # Rebuild from scratch
  24. .PHONY: rebuild
  25. rebuild: clean deps build
  26. # Show help
  27. .PHONY: help
  28. help:
  29. @echo "Usage:"
  30. @echo " make - build the plugin (.so)"
  31. @echo " make deps - download/tidy Go modules"
  32. @echo " make clean - remove the .so file"
  33. @echo " make rebuild - clean + deps + build"