Skip to content
Snippets Groups Projects
Makefile 695 B
Newer Older
  • Learn to ignore specific revisions
  • Viktor Popov's avatar
    Viktor Popov committed
    SERVER_OUT := "bin/server"
    PKG := "code.vereign.com/code/key-storage-agent"
    SERVER_PKG_BUILD := "${PKG}"
    PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
    
    Olgun Cengiz's avatar
    Olgun Cengiz committed
    VER := $(CI_COMMIT_REF_NAME).$(CI_COMMIT_SHA)
    
    Viktor Popov's avatar
    Viktor Popov committed
    
    .PHONY: all api server
    
    all: server
    
    dep: ## Get the dependencies
    
    Gospodin Bodurov's avatar
    Gospodin Bodurov committed
    	dep ensure
    
    Viktor Popov's avatar
    Viktor Popov committed
    server: dep ## Build the binary file for server
    
    Olgun Cengiz's avatar
    Olgun Cengiz committed
    	@go build -ldflags="-X code.vereign.com/code/key-storage-agent/handler.version=$(VER)" -i -v -o $(SERVER_OUT) $(SERVER_PKG_BUILD)
    
    Viktor Popov's avatar
    Viktor Popov committed
    
    clean: ## Remove previous builds
    	@rm $(SERVER_OUT)
    
    help: ## Display this help screen
    	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'