-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (50 loc) · 2.72 KB
/
Copy pathMakefile
File metadata and controls
69 lines (50 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
SHELL := /usr/bin/env bash
.SHELLFLAGS := -euo pipefail -c
.DEFAULT_GOAL := help
REPO_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
-include .env.local
TOOLCHAIN ?= $(or $(NEXTTANG_TOOLCHAIN),oss)
TARGET ?= $(or $(NEXTTANG_TARGET),console138k)
PROFILE ?= $(or $(NEXTTANG_PROFILE),release)
export NEXTTANG_GOWIN_HOME
export NEXTTANG_OSS_CAD_SUITE
.PHONY: help show-config doctor doctor-strict repo-check shell-lint hdl-lint hdl-lint-strict test check ci synth diagnostic-bootrom clean
help: ## Show the supported development commands.
@awk 'BEGIN {FS = ":.*## "; printf "NextTang development commands:\n\n"} /^[a-zA-Z0-9_-]+:.*## / {printf " %-16s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
show-config: ## Print the selected toolchain, target, profile, and output path.
@printf 'toolchain=%s\ntarget=%s\nprofile=%s\noutput=%s\n' \
'$(TOOLCHAIN)' '$(TARGET)' '$(PROFILE)' \
'$(REPO_ROOT)/build/$(TOOLCHAIN)/$(TARGET)/$(PROFILE)'
doctor: ## Report repository, vendor, and open-source tool availability.
@$(REPO_ROOT)/scripts/doctor.sh --mode all
doctor-strict: ## Require the selected TOOLCHAIN to be ready.
@$(REPO_ROOT)/scripts/doctor.sh --mode '$(TOOLCHAIN)' --strict
repo-check: ## Validate tracked files, local links, and generated-artifact policy.
@python3 $(REPO_ROOT)/scripts/check_repo.py
shell-lint: ## Parse shell scripts and run ShellCheck when it is installed.
@bash -n $(REPO_ROOT)/scripts/*.sh $(REPO_ROOT)/tests/*.sh \
$(REPO_ROOT)/boards/*/*.sh
@if command -v shellcheck >/dev/null 2>&1; then \
shellcheck -x -P SCRIPTDIR $(REPO_ROOT)/scripts/*.sh \
$(REPO_ROOT)/tests/*.sh $(REPO_ROOT)/boards/*/*.sh; \
else \
printf '%s\n' 'shellcheck: SKIP (not installed)'; \
fi
hdl-lint: ## Elaborate every board profile and lint its Verilog when Verilator is installed.
@$(REPO_ROOT)/scripts/hdl_lint.sh
hdl-lint-strict: ## As hdl-lint, but fail on width and unconnected-pin warnings too.
@$(REPO_ROOT)/scripts/hdl_lint.sh --strict
test: ## Run unit and shell regression tests.
@python3 -m unittest discover -s $(REPO_ROOT)/tests -p 'test_*.py'
@$(REPO_ROOT)/tests/doctor_test.sh
check: repo-check shell-lint hdl-lint test ## Run every local non-synthesis quality gate.
ci: check ## Run the deterministic CI gate.
synth: ## Dispatch a real board build; fails closed until that board driver exists.
@$(REPO_ROOT)/scripts/synth.sh \
--toolchain '$(TOOLCHAIN)' --target '$(TARGET)' --profile '$(PROFILE)'
diagnostic-bootrom: ## Rebuild the original open diagnostic boot ROM.
@python3 $(REPO_ROOT)/scripts/build_diagnostic_boot.py \
--source $(REPO_ROOT)/firmware/diagnostic/boot.asm \
--output $(REPO_ROOT)/rtl/core/nexttang_diagnostic_bootrom.vhd
clean: ## Remove only the repository build directory.
@$(REPO_ROOT)/scripts/clean.sh