2 # The name of the executable (default is current directory name)
3 TARGET := $(shell echo $${PWD\#\#*/})
4 .DEFAULT_GOAL: $(TARGET)
6 # These will be provided to the target
8 BUILD := `git rev-parse HEAD`
10 # Use linker flags to provide version/build settings to the target
11 LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
13 # go source files, ignore vendor directory
14 SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
21 @go build $(LDFLAGS) -o $(TARGET)