Skip to content

Commit

Permalink
Make must test Go by default, not rebuild world.
Browse files Browse the repository at this point in the history
``lib/go/Makefile.am`` made erroneous assumptions that it should
forcibly rebuild all of thrift4go dependencies.  This seemed like a
good idea at the time for sanity checking reasons, but it requires
in reality extra permissions, which the user building thrift4go may
not have.

The same rationale applies for why the make rules ought to build and
test Go instead of installing them by default.
  • Loading branch information
matttproud committed Aug 12, 2012
1 parent ddadc8a commit 8e1d43f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/go/Makefile.am
Expand Up @@ -17,33 +17,34 @@
# under the License.
#

# N.B.(matttproud): The flag assumptions of this makefile could be improved to
# potentially be more cross-platform compatible. For
# instance, I think the »-t« flag for »cp« may be invalid on
# BSD and Darwin systems.

all: install

all: test

export GOPATH = $(PWD)
SOURCE = $(GOPATH)/{pkg,src}
DESTINATION = $(DESTDIR)/$(GOROOT)


clean-local:
go clean thrift

nuke-local:
go clean -i -r -x thrift
$(RM) -rf bin pkg

# N.B.(matttproud): This step may fail to run with sudo due to sudo clearing
# environment variables before changing permissions for
# security reasons. This can be avoided by using the
# DESTDIR construct described above to provide emissions to
# an intermediate directory for subsequent manual merging.

install-exec-local: test
go install -a -v -x thrift
mkdir -vp "$(DESTINATION)"
cp -av $(SOURCE) -t "$(DESTINATION)"
go install -v -x thrift
install -d "$(GOPATH)/pkg"
install -d "$(GOPATH)/src"
cp -av "$(GOPATH)/pkg/" "$(DESTINATION)/pkg/"
cp -av "$(GOPATH)/src/" "$(DESTINATION)/src/"

test: check
go test -a -v -x thrift
go test -v -x thrift

check-local:
go build -a -v -x thrift
go build -v -x thrift

0 comments on commit 8e1d43f

Please sign in to comment.