Skip to content

Commit

Permalink
🔧 add make command
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <kyukawa315@gmail.com>
  • Loading branch information
vankichi committed Sep 26, 2024
1 parent 297449c commit e4bcbb2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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: \
Expand Down Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e4bcbb2

Please sign in to comment.