Skip to content

Commit 651c157

Browse files
committed
Drop 'make docs-local' and just use 'make docs'
* make docs includes building OpenAPI too
1 parent 1e4d6ed commit 651c157

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

Makefile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.PHONY: build build-dev build-linux build-linux-arm64 clean docs docs-cli docs-local docs-nav install lint local-down local-up test uninstall validate-registry check-licenses check-notice notice
2-
31
MODULE_PATH := github.com/mozilla-ai/mcpd/v2
42

53
# /usr/local/bin is a common default for user-installed binaries
@@ -32,6 +30,7 @@ BUILDFLAGS := -trimpath
3230
# The license types allowed to be imported by the project
3331
ALLOWED_LICENSES := Apache-2.0,MIT,BSD-2-Clause,BSD-3-Clause,ZeroBSD,Unlicense
3432

33+
.PHONY: check-licenses
3534
check-licenses:
3635
@echo "Checking licenses..."
3736
@go install github.com/google/go-licenses/v2@latest
@@ -43,6 +42,7 @@ check-licenses:
4342
exit 1; \
4443
fi
4544

45+
.PHONY: check-notice
4646
check-notice:
4747
@echo "Checking NOTICE..."
4848
@go install github.com/google/go-licenses/v2@latest
@@ -56,87 +56,100 @@ check-notice:
5656
echo "✓ NOTICE is up to date"; \
5757
fi
5858

59+
.PHONY: notice
5960
notice:
6061
@echo "Generating NOTICE..."
6162
@go install github.com/google/go-licenses/v2@latest
6263
@go-licenses report ./... --ignore github.com/mozilla-ai/mcpd/v2 --template build/licenses/notice.tpl > NOTICE
6364
@echo "✓ NOTICE generated"
6465

66+
.PHONY: lint
6567
lint: check-notice
6668
golangci-lint run --fix -v
6769

70+
.PHONY: test
6871
test: lint
6972
go test ./...
7073

74+
.PHONY: validate-registry
7175
validate-registry:
7276
@echo "Validating Mozilla AI registry against schema..."
7377
@go run -tags=validate_registry ./tools/validate/registry.go \
7478
internal/provider/mozilla_ai/data/schema.json \
7579
internal/provider/mozilla_ai/data/registry.json
7680

81+
.PHONY: build
7782
build: lint
7883
@echo "building mcpd (version: $(VERSION), commit: $(COMMIT))..."
7984
@go build $(BUILDFLAGS) -o mcpd -ldflags="$(LDFLAGS)" .
8085

86+
.PHONY: build-linux
8187
build-linux:
8288
@echo "building mcpd for amd64/linux (version: $(VERSION), commit: $(COMMIT))..."
8389
@GOOS=linux GOARCH=amd64 go build $(BUILDFLAGS) -o mcpd -ldflags="$(LDFLAGS)" .
8490

91+
.PHONY: build-linux-arm64
8592
build-linux-arm64:
8693
@echo "building mcpd for arm64/linux (version: $(VERSION), commit: $(COMMIT))..."
8794
@GOOS=linux GOARCH=arm64 go build $(BUILDFLAGS) -o mcpd -ldflags="$(LDFLAGS)" .
8895

8996
# For development builds without optimizations (for debugging)
97+
.PHONY: build-dev
9098
build-dev:
9199
@echo "building mcpd for development (version: $(VERSION), commit: $(COMMIT))..."
92100
@go build -o mcpd -ldflags="-X '$(MODULE_PATH)/internal/cmd.version=$(VERSION)' \
93101
-X '$(MODULE_PATH)/internal/cmd.commit=$(COMMIT)' \
94102
-X '$(MODULE_PATH)/internal/cmd.date=$(DATE)'" .
95103

104+
.PHONY: install
96105
install: build
97106
@# Copy the executable to the install directory
98107
@# Requires sudo if INSTALL_DIR is a system path like /usr/local/bin
99108
@echo "installing mcpd to $(INSTALL_DIR)..."
100109
@cp mcpd $(INSTALL_DIR)/mcpd
101110
@chmod +x $(INSTALL_DIR)/mcpd
102111

112+
.PHONY: clean
103113
clean:
104114
@# Remove the built executable and any temporary files
105115
@echo "cleaning up local build artifacts..."
106116
@rm -f mcpd # The executable itself
107117
@rm -rf $(TARGET_PLATFORM) # Remove any orphaned Docker build directories
108118

119+
.PHONY: uninstall
109120
uninstall:
110121
@# Remove the installed executable from the system
111122
@# Requires sudo if INSTALL_DIR is a system path
112123
@echo "uninstalling mcpd from $(INSTALL_DIR)..."
113124
@rm -f $(INSTALL_DIR)/mcpd
114125

115126
# Runs MkDocs locally
116-
docs: docs-local
117-
118-
# Runs MkDocs locally
119-
docs-local: docs-nav
127+
.PHONY: docs
128+
docs: docs-nav docs-api
120129
@uv venv && \
121130
source .venv/bin/activate && \
122131
uv pip install mkdocs mkdocs-material && \
123132
uv run mkdocs serve
124133

125134
# Generates CLI markdown documentation
135+
.PHONY: docs-cli
126136
docs-cli:
127137
@go run -tags=docsgen_cli ./tools/docsgen/cmds/main.go
128138
@echo "mcpd CLI command documentation generated"
129139

130140
# Generates OpenAPI specification YAML
141+
.PHONY: docs-api
131142
docs-api:
132143
@go run -tags=docsgen_api ./tools/docsgen/api/openapi.go
133144
@echo "OpenAPI specification generated"
134145

135146
## Updates mkdocs.yaml nav to match generated CLI docs
147+
.PHONY: docs-nav
136148
docs-nav: docs-cli
137149
@go run -tags=docsgen_nav ./tools/docsgen/nav/main.go
138150
@echo "navigation updated for MkDocs site"
139151

152+
.PHONY: local-up
140153
local-up: build-linux
141154
@echo "organizing binary for docker build"
142155
@mkdir -p $(TARGET_PLATFORM)
@@ -146,6 +159,7 @@ local-up: build-linux
146159
@echo "cleaning up temporary platform directory"
147160
@rm -rf $(TARGET_PLATFORM)
148161

162+
.PHONY: local-down
149163
local-down:
150164
@echo "stopping mcpd container"
151165
@docker compose down

docs/makefile.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,13 @@ These commands manage the [MkDocs](https://www.mkdocs.org) developer documentati
137137
make docs-nav
138138
```
139139

140-
- **Serve the docs locally using MkDocs + uv**
141-
```bash
142-
make docs-local
143-
```
144-
145-
- **Full pipeline: generate CLI docs, update nav, serve locally**
140+
- **Serve the docs locally using MkDocs + uv: generate CLI docs, update nav, serve locally**
146141
```bash
147142
make docs
148143
```
149144

150145
!!! tip "First time?"
151-
The `docs-local` command will create a virtual environment using `uv`, install MkDocs + Material theme, and start the local server at [http://localhost:8000](http://localhost:8000).
146+
The `docs` command will create a virtual environment using `uv`, install MkDocs + Material theme, and start the local server at [http://localhost:8000/mcpd/](http://localhost:8000/mcpd/).
152147

153148
---
154149

@@ -165,8 +160,7 @@ Here's a complete list of Makefile targets:
165160
| `check-licenses` | Validate all dependency licenses are allowed |
166161
| `check-notice` | Verify NOTICE file is up to date |
167162
| `clean` | Remove compiled binary from working directory |
168-
| `docs` | Alias for `docs-local` (runs everything) |
169-
| `docs-cli` | Generate Markdown CLI reference docs |
163+
| `docs` | Serve docs locally via `mkdocs serve` |
170164
| `docs-local` | Serve docs locally via `mkdocs serve` |
171165
| `docs-nav` | Update CLI doc nav in `mkdocs.yaml` |
172166
| `install` | Install binary to system path |

0 commit comments

Comments
 (0)