1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:14:42 -07:00

Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of QUOTED_GOBIN

Fixes #468

R=rsc
CC=golang-dev
https://golang.org/cl/181077
This commit is contained in:
Devon H. O'Dell 2010-01-05 16:22:40 -08:00 committed by Russ Cox
parent 10cdec9262
commit e032ab9dc8
3 changed files with 16 additions and 18 deletions

View File

@ -6,17 +6,13 @@ CFLAGS=-ggdb -I"$(GOROOT)"/include -O2 -fno-inline
O=o O=o
YFLAGS=-d YFLAGS=-d
# GNU Make syntax: # GNU Make syntax:
ifndef GOBIN
nullstring := nullstring :=
space := $(nullstring) # a space at the end space := $(nullstring) # a space at the end
ifndef GOBIN
QUOTED_HOME=$(subst $(space),\ ,$(HOME)) QUOTED_HOME=$(subst $(space),\ ,$(HOME))
GOBIN=$(QUOTED_HOME)/bin GOBIN=$(QUOTED_HOME)/bin
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
else
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
endif endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
CC=$(QUOTED_GOBIN)/quietgcc CC=$(QUOTED_GOBIN)/quietgcc
LD=$(QUOTED_GOBIN)/quietgcc LD=$(QUOTED_GOBIN)/quietgcc

View File

@ -6,17 +6,13 @@ all: package
package: _obj/$(TARG).a package: _obj/$(TARG).a
testpackage: _test/$(TARG).a testpackage: _test/$(TARG).a
ifndef GOBIN
nullstring := nullstring :=
space := $(nullstring) # a space at the end space := $(nullstring) # a space at the end
ifndef GOBIN
QUOTED_HOME=$(subst $(space),\ ,$(HOME)) QUOTED_HOME=$(subst $(space),\ ,$(HOME))
GOBIN=$(QUOTED_HOME)/bin GOBIN=$(QUOTED_HOME)/bin
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
else
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
endif endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
# GNU Make 3.80 has a bug in lastword # GNU Make 3.80 has a bug in lastword
# elem=$(lastword $(subst /, ,$(TARG))) # elem=$(lastword $(subst /, ,$(TARG)))
@ -30,8 +26,6 @@ dir=$(patsubst %/$(elem),%,$(TARG))
endif endif
# ugly hack to deal with whitespaces in $GOROOT # ugly hack to deal with whitespaces in $GOROOT
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT)) QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT))
pkgdir=$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH) pkgdir=$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)

View File

@ -9,6 +9,14 @@
# #
# to rebuild the dependency information in Make.deps. # to rebuild the dependency information in Make.deps.
nullstring :=
space := $(nullstring)
ifndef GOBIN
QUOTED_HOME=$(subst $(space),\ ,$(HOME))
GOBIN=$(QUOTED_HOME)/bin
endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
all: install all: install
DIRS=\ DIRS=\
@ -135,16 +143,16 @@ nuke.dirs: $(addsuffix .nuke, $(DIRS))
test.dirs: $(addsuffix .test, $(TEST)) test.dirs: $(addsuffix .test, $(TEST))
%.clean: %.clean:
+cd $* && gomake clean +cd $* && $(QUOTED_GOBIN)/gomake clean
%.install: %.install:
+cd $* && gomake install +cd $* && $(QUOTED_GOBIN)/gomake install
%.nuke: %.nuke:
+cd $* && gomake nuke +cd $* && $(QUOTED_GOBIN)/gomake nuke
%.test: %.test:
+cd $* && gomake test +cd $* && $(QUOTED_GOBIN)/gomake test
clean: clean.dirs clean: clean.dirs