make: Add new targets
- fmt: Apply clang-format - list-boards: list of available build targets - help: Short description of make targets Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
58f9ed4051
commit
623d3ce8ab
26
Makefile
26
Makefile
@ -13,10 +13,7 @@ endif
|
|||||||
# Parameter for current board
|
# Parameter for current board
|
||||||
ifeq ($(BOARD),)
|
ifeq ($(BOARD),)
|
||||||
all:
|
all:
|
||||||
@echo "Please set BOARD to one of the following:"
|
@echo -e "\x1B[31mBOARD must be specified\x1B[0m"
|
||||||
@cd src/board && for board in */*/board.mk; do \
|
|
||||||
echo " $$(dirname "$$board")"; \
|
|
||||||
done
|
|
||||||
@exit 1
|
@exit 1
|
||||||
else
|
else
|
||||||
# Calculate version
|
# Calculate version
|
||||||
@ -73,11 +70,32 @@ endif
|
|||||||
clean:
|
clean:
|
||||||
rm -rf $(obj)
|
rm -rf $(obj)
|
||||||
|
|
||||||
|
.PHONY: fmt
|
||||||
|
fmt:
|
||||||
|
./scripts/clang-format.sh apply
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
./scripts/lint/lint.sh
|
./scripts/lint/lint.sh
|
||||||
|
|
||||||
|
.PHONY: list-boards
|
||||||
|
list-boards:
|
||||||
|
@cd src/board && for board in */*/board.mk; do \
|
||||||
|
echo "$$(dirname "$$board")"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
# This target is run during setup, and is not shown in the help text.
|
||||||
.PHONY: git-config
|
.PHONY: git-config
|
||||||
git-config:
|
git-config:
|
||||||
$(eval HOOKS = "$(shell git rev-parse --git-dir)/hooks")
|
$(eval HOOKS = "$(shell git rev-parse --git-dir)/hooks")
|
||||||
ln -sfrv scripts/hooks/pre-commit.sh "$(HOOKS)/pre-commit"
|
ln -sfrv scripts/hooks/pre-commit.sh "$(HOOKS)/pre-commit"
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@echo "System76 EC build targets"
|
||||||
|
@echo " [all] BOARD=<B> Build the specified board"
|
||||||
|
@echo " list-boards List available target boards"
|
||||||
|
@echo " clean Remove build artifacts"
|
||||||
|
@echo " fmt Format the source code"
|
||||||
|
@echo " lint Run lint checks"
|
||||||
|
@echo " help Print this message"
|
||||||
|
Reference in New Issue
Block a user