Skip to content

Commit

Permalink
Modify Makefile to automatically build prefetch plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
billie60 committed Dec 22, 2023
1 parent b5b57f9 commit 9d3ff61
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
all: clean build
optimizer: clean-optimizer build-optimizer
prefetch: clean-prefetch build-prefetch

PKG = github.com/containerd/nydus-snapshotter
PACKAGES ?= $(shell go list ./... | grep -v /tests)
Expand Down Expand Up @@ -75,6 +76,10 @@ static-release:
converter:
GOOS=${GOOS} GOARCH=${GOARCH} ${PROXY} go build -ldflags "$(LDFLAGS)" -v -o bin/converter ./cmd/converter

.PHONY: build-prefetch
build-prefetch:
GOOS=${GOOS} GOARCH=${GOARCH} ${PROXY} go build -ldflags "$(LDFLAGS)" -v -o bin/prefetchfiles-nri-plugin ./cmd/prefetchfiles-nri-plugin

.PHONY: clean
clean:
rm -f bin/*
Expand All @@ -85,6 +90,10 @@ clean-optimizer:
rm -rf bin/optimizer-nri-plugin bin/optimizer-server
make -C tools/optimizer-server clean

.PHONY: clean-prefetch
clean-prefetch:
rm -rf bin/prefetch-nri-plugin

.PHONY: install
install:
@echo "+ $@ bin/containerd-nydus-grpc"
Expand All @@ -109,6 +118,10 @@ install-optimizer:

@sudo mkdir -p /opt/nri/optimizer/results

install-prefetch:
sudo install -D -m 755 bin/prefetchfiles-nri-plugin /opt/nri/plugins/03-prefetchfiles-nri-plugin
sudo install -D -m 755 misc/example/prefetchfiles-nri-plugin.conf /etc/nri/conf.d/03-prefetchfiles-nri-plugin.conf

.PHONY: vet
vet:
go vet $(PACKAGES) ./tests
Expand Down

0 comments on commit 9d3ff61

Please sign in to comment.