commit 9c559d9658cb363e5b4bb9a50ee21591490545ff parent 160f6e9cf0aa799004fad0599b36c5cae31843be Author: Sean Enck <sean@ttypty.com> Date: Mon, 19 Jul 2021 18:50:06 -0400 cleaning up make a little Diffstat:
| M | Makefile | | | 13 | +++++++------ |
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,11 +1,12 @@ -BIN := bin/ -FLG := -ldflags '-linkmode external -extldflags $(LDFLAGS) -w' -trimpath -buildmode=pie -mod=readonly -modcacherw -CMD := $(shell ls cmd | sed "s|^|$(BIN)lb-|g") +BIN := bin/ +FLAGS := -ldflags '-linkmode external -extldflags $(LDFLAGS) -w' -trimpath -buildmode=pie -mod=readonly -modcacherw +FILES := lb lb-bash lb-diff lb-rekey lb-stats lb-pwgen lb-rw lb-totp +TARGET := $(addprefix $(BIN),$(FILES)) -all: $(CMD) +all: $(TARGET) -$(CMD): $(shell find . -type f -name "*.go") go.* - go build -o $@ $(FLG) cmd/$(shell basename $@ | sed 's/lb-//g')/main.go +$(TARGET) : $(shell find . -type f -name "*.go") go.* + go build -o $@ $(FLAGS) cmd/$(shell basename $@ | sed 's/lb-//g')/main.go clean: rm -rf $(BIN)