-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (24 loc) · 838 Bytes
/
Makefile
File metadata and controls
29 lines (24 loc) · 838 Bytes
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
.PHONY: help licenses licenses-check licenses-install
GO_LICENSES := $(shell which go-licenses 2>/dev/null)
help:
@echo "Available targets:"
@echo " licenses - Check licenses of all dependencies (installs go-licenses if needed)"
@echo " licenses-check - Check licenses without installing"
@echo " licenses-install - Install go-licenses tool"
licenses-install:
@echo "Installing go-licenses..."
go install github.com/google/go-licenses@latest
licenses:
ifndef GO_LICENSES
@echo "go-licenses not found, installing..."
@$(MAKE) licenses-install
endif
@echo "Checking licenses..."
go-licenses csv ./... 2>/dev/null | column -t -s,
licenses-check:
ifdef GO_LICENSES
go-licenses csv ./... 2>/dev/null | column -t -s,
else
@echo "Error: go-licenses not installed. Run 'make licenses-install' first."
@exit 1
endif