diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca8d09f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.bin diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..031fcc4 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +AVAIL_CMDS:=$(shell find . -mindepth 1 -name 'main.go' | cut -d '/' -f 2) + +default: clean $(patsubst %,.bin/%,$(AVAIL_CMDS)) + +clean: + rm -rf .bin + +.bin/%: export CGO_ENABLED=0 +.bin/%: + cd $* && go build \ + -trimpath \ + -ldflags "-s -w -X main.version=$(shell git describe --tags --always || echo dev)" \ + -o $(CURDIR)/.bin/$*