30 lines
		
	
	
		
			490 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			490 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 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 ./...
 |