Commit 32594bd4 authored by Russ Cox's avatar Russ Cox
parent 1c819cb1
...@@ -6,13 +6,17 @@ CFLAGS=-ggdb -I"$(GOROOT)"/include -O2 -fno-inline ...@@ -6,13 +6,17 @@ 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
endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN)) QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
else
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
endif
CC=$(QUOTED_GOBIN)/quietgcc CC=$(QUOTED_GOBIN)/quietgcc
LD=$(QUOTED_GOBIN)/quietgcc LD=$(QUOTED_GOBIN)/quietgcc
......
...@@ -6,13 +6,17 @@ all: package ...@@ -6,13 +6,17 @@ 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
endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN)) QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
else
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
endif
# 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)))
...@@ -26,6 +30,8 @@ dir=$(patsubst %/$(elem),%,$(TARG)) ...@@ -26,6 +30,8 @@ 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)
......
...@@ -9,14 +9,6 @@ ...@@ -9,14 +9,6 @@
# #
# 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=\
...@@ -143,16 +135,16 @@ nuke.dirs: $(addsuffix .nuke, $(DIRS)) ...@@ -143,16 +135,16 @@ nuke.dirs: $(addsuffix .nuke, $(DIRS))
test.dirs: $(addsuffix .test, $(TEST)) test.dirs: $(addsuffix .test, $(TEST))
%.clean: %.clean:
+cd $* && $(QUOTED_GOBIN)/gomake clean +cd $* && gomake clean
%.install: %.install:
+cd $* && $(QUOTED_GOBIN)/gomake install +cd $* && gomake install
%.nuke: %.nuke:
+cd $* && $(QUOTED_GOBIN)/gomake nuke +cd $* && gomake nuke
%.test: %.test:
+cd $* && $(QUOTED_GOBIN)/gomake test +cd $* && gomake test
clean: clean.dirs clean: clean.dirs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment