From 384932589d1a8257c191a329e50509039bd052ef Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 11 Nov 2009 12:00:50 -0800 Subject: [PATCH] work with GNU Make 3.80 Fixes #30. R=r1, r https://golang.org/cl/154061 --- src/Make.pkg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Make.pkg b/src/Make.pkg index 50e1d8d72b6..fd8e5bdb612 100644 --- a/src/Make.pkg +++ b/src/Make.pkg @@ -6,7 +6,11 @@ all: package package: _obj/$(TARG).a testpackage: _test/$(TARG).a -elem=$(lastword $(subst /, ,$(TARG))) +# GNU Make 3.80 has a bug in lastword +# elem=$(lastword $(subst /, ,$(TARG))) +TARG_words=$(subst /, ,$(TARG)) +elem=$(word $(words $(TARG_words)),$(TARG_words)) + dir=$(patsubst %/$(elem),%,./$(TARG)) pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH)