aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-10 11:54:36 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-10 11:54:36 +0100
commit938311a48e8f71188c489fc0ec9dbe414f1eb3e7 (patch)
tree56d1b3c3c64abadb02bac769ba8bf190f633d62d
parent8e819b7d5c1b749590ea791c25f85b7e95914e67 (diff)
downloadbottin-938311a48e8f71188c489fc0ec9dbe414f1eb3e7.tar.gz
bottin-938311a48e8f71188c489fc0ec9dbe414f1eb3e7.zip
Make Makefile more generic
-rw-r--r--Makefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 13fed94..2956c7f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
-all: bottin
+BIN=bottin
+SRC=main.go ssha.go util.go acl.go read.go write.go
+DOCKER=lxpz/bottin_amd64
-bottin: main.go ssha.go util.go acl.go read.go write.go
+all: $(BIN)
+
+$(BIN): $(SRC)
go get -d -v
- go build -v -o bottin
+ go build -v -o $(BIN)
-bottin.static: main.go ssha.go util.go acl.go read.go write.go
+$(BIN).static: $(SRC)
go get -d -v
- CGO_ENABLED=0 GOOS=linux go build -a -v -o bottin.static
+ CGO_ENABLED=0 GOOS=linux go build -a -v -o $(BIN).static
-docker: bottin.static
- docker build -t lxpz/bottin_amd64:$(TAG) .
- docker push lxpz/bottin_amd64:$(TAG)
- docker tag lxpz/bottin_amd64:$(TAG) lxpz/bottin_amd64:latest
- docker push lxpz/bottin_amd64:latest
+docker: $(BIN).static
+ docker build -t $(DOCKER):$(TAG) .
+ docker push $(DOCKER):$(TAG)
+ docker tag $(DOCKER):$(TAG) $(DOCKER):latest
+ docker push $(DOCKER):latest