31 lines
542 B
Makefile
31 lines
542 B
Makefile
PLUGIN_NAME = mycelium-cni
|
|
CNI_PLUGINS_DIR = /opt/cni/bin
|
|
CNI_CONFIG_DIR = /etc/cni/net.d
|
|
|
|
.PHONY: build install clean test deps
|
|
|
|
deps:
|
|
go mod tidy
|
|
|
|
build: deps
|
|
go build -o $(PLUGIN_NAME) .
|
|
|
|
install: build
|
|
sudo mkdir -p $(CNI_PLUGINS_DIR) $(CNI_CONFIG_DIR)
|
|
sudo cp $(PLUGIN_NAME) $(CNI_PLUGINS_DIR)/
|
|
sudo cp 10-mycelium.conflist $(CNI_CONFIG_DIR)/
|
|
|
|
clean:
|
|
rm -f $(PLUGIN_NAME)
|
|
sudo rm -f $(CNI_PLUGINS_DIR)/$(PLUGIN_NAME)
|
|
sudo rm -f $(CNI_CONFIG_DIR)/10-mycelium.conflist
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
vet:
|
|
go vet ./...
|