Merge "Adding Initial ICN API Service" into dev/icn-v0.1.0
[icn.git] / cmd / bpa-restapi-agent / Makefile
diff --git a/cmd/bpa-restapi-agent/Makefile b/cmd/bpa-restapi-agent/Makefile
new file mode 100644 (file)
index 0000000..ba40a6f
--- /dev/null
@@ -0,0 +1,24 @@
+
+# The name of the executable (default is current directory name)
+TARGET := $(shell echo $${PWD\#\#*/})
+.DEFAULT_GOAL: $(TARGET)
+
+# These will be provided to the target
+VERSION := 1.0.0
+BUILD := `git rev-parse HEAD`
+
+# Use linker flags to provide version/build settings to the target
+LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
+
+# go source files, ignore vendor directory
+SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
+
+.PHONY: all build
+
+all: build
+
+$(TARGET): $(SRC)
+       @go build $(LDFLAGS) -o $(TARGET)
+
+build: $(TARGET)
+       @true