summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-12 14:40:29 -0700
committerRuss Cox <rsc@golang.org>2009-08-12 14:40:29 -0700
commitd695ea26aec6eb89f41d09346d4a029ffac633f4 (patch)
tree50d12283b5381dc30b8f31afe60fb21e112ed387
parenta62fc6db78bf5cc56de8fd77b13d841afcd28808 (diff)
downloadgolang-d695ea26aec6eb89f41d09346d4a029ffac633f4.tar.gz
avoid unnecessary installs
R=r DELTA=6 (4 added, 0 deleted, 2 changed) OCL=33107 CL=33110
-rw-r--r--src/Make.pkg8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Make.pkg b/src/Make.pkg
index a79626024..2098e2ed9 100644
--- a/src/Make.pkg
+++ b/src/Make.pkg
@@ -5,7 +5,9 @@
package: _obj/$(TARG).a
testpackage: _test/$(TARG).a
-dir=$(shell echo $(TARG) | sed 's|[^/]*$$||')
+elem=$(lastword $(subst /, ,$(TARG)))
+dir=$(patsubst %/$(elem),%,$(TARG))
+
pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH)
coverage:
@@ -24,7 +26,9 @@ nuke: clean
testpackage-clean:
rm -f _test/$(TARG).a _gotest_.$O
-install: package
+install: $(pkgdir)/$(TARG).a
+
+$(pkgdir)/$(TARG).a: package
test -d $(GOROOT)/pkg && mkdir -p $(pkgdir)/$(dir)
cp _obj/$(TARG).a $(pkgdir)/$(TARG).a