]> Cypherpunks repositories - gostls13.git/commitdiff
avoid unnecessary installs
authorRuss Cox <rsc@golang.org>
Wed, 12 Aug 2009 21:40:29 +0000 (14:40 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 12 Aug 2009 21:40:29 +0000 (14:40 -0700)
R=r
DELTA=6  (4 added, 0 deleted, 2 changed)
OCL=33107
CL=33110

src/Make.pkg

index a796260240f784532ff1106b1f805a26a1f67a48..2098e2ed9c6275ef229935d4a54d55591f8e3ef2 100644 (file)
@@ -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