summaryrefslogtreecommitdiff
path: root/src/Make.common
blob: 42bb64e84fc4ccd7a3719d02b6180e3b99e41be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# GNU Make syntax:
ifndef GOBIN
GOBIN=$(HOME)/bin
endif

# ugly hack to deal with whitespaces in $GOBIN
nullstring :=
space := $(nullstring) # a space at the end
ifndef GOBIN
QUOTED_HOME=$(subst $(space),\ ,$(HOME))
GOBIN=$(QUOTED_HOME)/bin
endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))

# ugly hack to deal with whitespaces in $GOROOT
QUOTED_GOROOT:=$(subst $(space),\ ,$(GOROOT))

clean:
	rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)

%.make:
	(cd $* && $(QUOTED_GOBIN)/gomake install)