From 04b0e5b061a5c31689d793f282a900ffc8d182ea Mon Sep 17 00:00:00 2001 From: Lucas Costa Date: Wed, 15 Dec 2021 12:03:54 -0300 Subject: [PATCH] Improve Makefile Add dependencies on targets --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6d10884..e493740 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,14 @@ IMAGE=gosubst-image build_image: docker build -t ${IMAGE} . -build: +build: build_image docker run -it -v $(shell pwd):/go/src/github.com/luizbafilho/gosubst -w /go/src/github.com/luizbafilho/gosubst ${IMAGE} go build -o _bin/gosubst -cross_build: +cross_build: build_image docker run -it -v $(shell pwd):/go/src/github.com/luizbafilho/gosubst -w /go/src/github.com/luizbafilho/gosubst -e CGO_ENABLED=0 ${IMAGE} gox -output="_dist/gosubst_{{.OS}}_{{.Arch}}" -test: +test: build_image docker run -it -v $(shell pwd):/go/src/github.com/luizbafilho/gosubst -w /go/src/github.com/luizbafilho/gosubst/gosubst ${IMAGE} go test -run: +run: build_image docker run -it -v $(shell pwd):/go/src/github.com/luizbafilho/gosubst -w /go/src/github.com/luizbafilho/gosubst ${IMAGE} bash