Comment

Comment by jgrahamc

I agree. This Makefile would be clearer with something like:

    BINARY_NAME := mybinary
    BINARY_UNIX := $(BINARY_NAME)_unix
    
    .PHONY: all test build clean run deps
    all: test build
    build: ; go build -o $(BINARY_NAME) -v
    test:  ; go test -v ./...
    clean: ; go clean && rm -f $(BINARY_NAME) $(BINARY_UNIX)
    run:   ; go run $(BINARY_NAME) -v ./...

    deps: DEPS := $(addprefix github.com/markbates/,goth pop)
    deps:  ; go get $(DEPS)

    build-linux: ; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINARY_UNIX) -v

    docker-build: ; docker run --rm -it -v "$(GOPATH)":/go -w /go/src/bitbucket.org/rsohlich/makepost golang:latest go build -o "$(BINARY_UNIX)" -v
Caveat. I haven't tested that, but something close to that would be much clearer.
parent jgrahamc 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton