ba40a6ff6d53f65b4f5f6ef0413b09e05f144dad
[icn.git] / cmd / bpa-restapi-agent / Makefile
1
2 # The name of the executable (default is current directory name)
3 TARGET := $(shell echo $${PWD\#\#*/})
4 .DEFAULT_GOAL: $(TARGET)
5
6 # These will be provided to the target
7 VERSION := 1.0.0
8 BUILD := `git rev-parse HEAD`
9
10 # Use linker flags to provide version/build settings to the target
11 LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
12
13 # go source files, ignore vendor directory
14 SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
15
16 .PHONY: all build
17
18 all: build
19
20 $(TARGET): $(SRC)
21         @go build $(LDFLAGS) -o $(TARGET)
22
23 build: $(TARGET)
24         @true