summaryrefslogtreecommitdiff
path: root/src/libcgo/Makefile
diff options
context:
space:
mode:
authorSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-23 17:32:51 -0800
committerSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-23 17:32:51 -0800
commit4d33b8a8cd75101d60aeef4bd38fca472943b3dd (patch)
treeb739091738e77c3d0fdbd27f77d22ed0e281dc32 /src/libcgo/Makefile
parent60c09d05acbb176013a749977f7b047930822a07 (diff)
downloadgolang-4d33b8a8cd75101d60aeef4bd38fca472943b3dd.tar.gz
go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/libcgo/Makefile')
-rw-r--r--src/libcgo/Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libcgo/Makefile b/src/libcgo/Makefile
index 254e4622d..b5ac6e33f 100644
--- a/src/libcgo/Makefile
+++ b/src/libcgo/Makefile
@@ -2,9 +2,14 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+# ugly hack to deal with whitespaces in $GOROOT
+nullstring :=
+space := $(nullstring) # a space at the end
+QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT))
+
all: libcgo.so
-install: $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so
+install: $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so
OFILES=\
$(GOOS)_$(GOARCH).o\
@@ -27,8 +32,8 @@ LDFLAGS_freebsd=-pthread -shared -lm
libcgo.so: $(OFILES)
gcc $(CFLAGS_$(GOARCH)) -o libcgo.so $(OFILES) $(LDFLAGS_$(GOOS))
-$(GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so: libcgo.so
- cp libcgo.so $@
+$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so: libcgo.so
+ cp libcgo.so $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)
clean:
rm -f *.o *.so