diff --git a/Makefile b/Makefile index e55f5e975ef..e0113b4a321 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,10 @@ MIRROR_GATEWAY_IMAGE = $(NAME)-mirror-gateway READREPLICA_ROTATE_IMAGE = $(NAME)-readreplica-rotate MAINTAINER = "$(ORG).org $(NAME) team <$(NAME)@$(ORG).org>" +DEADLINK_CHECK_PATH ?= "" +DEADLINK_IGNORE_PATH ?= "" +DEADLINK_CHECK_FORMAT = html + DEFAULT_BUILDKIT_SYFT_SCANNER_IMAGE = $(GHCRORG)/$(BUILDKIT_SYFT_SCANNER_IMAGE):nightly VERSION ?= $(eval VERSION := $(shell cat versions/VALD_VERSION))$(VERSION) @@ -447,6 +451,11 @@ dockerfile: workflow: $(call gen-workflow,$(ROOTDIR),$(MAINTAINER)) +.PHONY: deadlink-checker +## generate deadlink-checker +deadlink-checker: + $(call gen-deadlink-checker,$(ROOTDIR),$(MAINTAINER),$(DEADLINK_CHECK_PATH),$(DEADLINK_IGNORE_PATH),$(DEADLINK_CHECK_FORMAT)) + .PHONY: init ## initialize development environment init: \ @@ -679,7 +688,7 @@ $(LIB_PATH)/libfaiss.a: .PHONY: usearch/install ## install usearch -usearch/install: +usearch/install: ifeq ($(OS),linux) curl -sSL https://github.com/unum-cloud/usearch/releases/download/v$(USEARCH_VERSION)/usearch_$(OS)_$(GOARCH)_$(USEARCH_VERSION).deb -o usearch_$(OS)_$(USEARCH_VERSION).deb dpkg -i usearch_$(OS)_$(USEARCH_VERSION).deb diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index fa357d142d2..e8dcb51c1a0 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -418,3 +418,20 @@ define update-github-actions done endef +define gen-deadlink-checker + BIN_PATH="$(TEMP_DIR)/vald-deadlink-checker-gen"; \ + rm -rf $$BIN_PATH; \ + MAINTAINER=$2 \ + GOPRIVATE=$(GOPRIVATE) \ + GOARCH=$(GOARCH) \ + GOOS=$(GOOS) \ + go build -modcacherw \ + -mod=readonly \ + -a \ + -tags "osusergo netgo static_build" \ + -trimpath \ + -o $$BIN_PATH $(ROOTDIR)/hack/tools/deadlink/main.go; \ + $$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \ + rm -rf $$BIN_PATH +endef +