mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-11-04 10:45:06 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			993 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			993 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
APP = cc-metric-collector
 | 
						|
GOSRC_APP        := metric-collector.go
 | 
						|
GOSRC_COLLECTORS := $(wildcard collectors/*.go)
 | 
						|
GOSRC_SINKS      := $(wildcard sinks/*.go)
 | 
						|
GOSRC_RECEIVERS  := $(wildcard receivers/*.go)
 | 
						|
GOSRC            := $(GOSRC_APP) $(GOSRC_COLLECTORS) $(GOSRC_SINKS) $(GOSRC_RECEIVERS)
 | 
						|
 | 
						|
.PHONY: all
 | 
						|
all: $(APP)
 | 
						|
 | 
						|
$(APP): $(GOSRC)
 | 
						|
	make -C collectors
 | 
						|
	go get
 | 
						|
	go build -o $(APP) $(GOSRC_APP)
 | 
						|
 | 
						|
.PHONY: clean
 | 
						|
clean:
 | 
						|
	make -C collectors clean
 | 
						|
	rm -f $(APP)
 | 
						|
 | 
						|
.PHONY: fmt
 | 
						|
fmt:
 | 
						|
	go fmt $(GOSRC_COLLECTORS)
 | 
						|
	go fmt $(GOSRC_SINKS)
 | 
						|
	go fmt $(GOSRC_RECEIVERS)
 | 
						|
	go fmt $(GOSRC_APP)
 | 
						|
	find . -name "*.go" -exec go fmt {} \;
 | 
						|
 | 
						|
# Examine Go source code and reports suspicious constructs
 | 
						|
.PHONY: vet
 | 
						|
vet:
 | 
						|
	go vet ./...
 | 
						|
 | 
						|
 | 
						|
# Run linter for the Go programming language.
 | 
						|
# Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules
 | 
						|
.PHONY: staticcheck
 | 
						|
staticcheck:
 | 
						|
	go install honnef.co/go/tools/cmd/staticcheck@latest
 | 
						|
	$$(go env GOPATH)/bin/staticcheck ./...
 |