mirror of
https://github.com/juanfont/headscale.git
synced 2026-02-07 20:04:00 +01:00
Merge pull request #2 from qavats/codex/build-headscale-using-vs-code-yc1qqg
build: add build-deps Makefile target and document in CONTRIBUTING.md
This commit is contained in:
commit
b540bcc2b5
@ -37,6 +37,10 @@ If you find mistakes in the documentation, please submit a fix to the documentat
|
||||
|
||||
If you prefer using VS Code for day-to-day development, use the integrated terminal from the repository root and:
|
||||
|
||||
1. Start the Nix development environment first (choose one):
|
||||
|
||||
- Direct command: `nix develop --extra-experimental-features nix-command --extra-experimental-features flakes`
|
||||
- Make target: `make build-deps`
|
||||
1. Start the Nix development environment first:
|
||||
|
||||
`nix develop --extra-experimental-features nix-command --extra-experimental-features flakes`
|
||||
|
||||
13
Makefile
13
Makefile
@ -37,6 +37,17 @@ check-deps:
|
||||
$(call check_tool,clang-format)
|
||||
$(call check_tool,buf)
|
||||
|
||||
|
||||
# Development environment bootstrap
|
||||
.PHONY: build-deps
|
||||
build-deps:
|
||||
@command -v nix >/dev/null 2>&1 || { \
|
||||
echo "Error: nix not found. Install Nix to use build-deps."; \
|
||||
exit 1; \
|
||||
}
|
||||
@echo "Bootstrapping development dependencies via Nix..."
|
||||
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes --command true
|
||||
|
||||
# Build targets
|
||||
.PHONY: build
|
||||
build: check-deps $(GO_SOURCES) go.mod go.sum
|
||||
@ -107,6 +118,7 @@ help:
|
||||
@echo "Main targets:"
|
||||
@echo " all - Run lint, test, and build (default)"
|
||||
@echo " build - Build headscale binary"
|
||||
@echo " build-deps - Bootstrap development dependencies via Nix"
|
||||
@echo " test - Run Go tests"
|
||||
@echo " fmt - Format all code (Go, docs, proto)"
|
||||
@echo " lint - Lint all code (Go, proto)"
|
||||
@ -123,6 +135,7 @@ help:
|
||||
@echo ""
|
||||
@echo "Dependencies:"
|
||||
@echo " check-deps - Verify required tools are available"
|
||||
@echo " build-deps - Prepare development dependencies (Nix)"
|
||||
@echo ""
|
||||
@echo "Note: If not running in a nix shell, ensure dependencies are available:"
|
||||
@echo " nix develop"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user