Make Makefile more generic

This commit is contained in:
Alex 2020-02-10 11:54:36 +01:00
parent 8e819b7d5c
commit 938311a48e

View file

@ -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 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 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: $(BIN).static
docker build -t lxpz/bottin_amd64:$(TAG) . docker build -t $(DOCKER):$(TAG) .
docker push lxpz/bottin_amd64:$(TAG) docker push $(DOCKER):$(TAG)
docker tag lxpz/bottin_amd64:$(TAG) lxpz/bottin_amd64:latest docker tag $(DOCKER):$(TAG) $(DOCKER):latest
docker push lxpz/bottin_amd64:latest docker push $(DOCKER):latest