Skip to content

Commit

Permalink
Improve Makefile
Browse files Browse the repository at this point in the history
Add dependencies on targets
  • Loading branch information
lucasrodcosta committed Dec 15, 2021
1 parent 2ab4987 commit 04b0e5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 04b0e5b

Please # to comment.