aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/5a/Makefile22
-rw-r--r--src/cmd/5c/Makefile21
-rw-r--r--src/cmd/5g/Makefile20
-rw-r--r--src/cmd/5l/Makefile19
-rw-r--r--src/cmd/6a/Makefile23
-rw-r--r--src/cmd/6c/Makefile21
-rw-r--r--src/cmd/6g/Makefile21
-rw-r--r--src/cmd/6l/Makefile19
-rw-r--r--src/cmd/8a/Makefile23
-rw-r--r--src/cmd/8c/Makefile21
-rw-r--r--src/cmd/8g/Makefile21
-rw-r--r--src/cmd/8l/Makefile19
-rw-r--r--src/cmd/cc/Makefile21
-rw-r--r--src/cmd/clean.bash4
-rw-r--r--src/cmd/cov/Makefile13
-rw-r--r--src/cmd/ebnflint/Makefile2
-rw-r--r--src/cmd/gc/Makefile23
-rwxr-xr-xsrc/cmd/gc/mkbuiltin6
-rw-r--r--src/cmd/godefs/Makefile14
-rwxr-xr-xsrc/cmd/gofmt/test.sh4
-rw-r--r--src/cmd/goinstall/main.go4
-rw-r--r--src/cmd/gopack/Makefile13
-rw-r--r--src/cmd/gotest/Makefile3
-rwxr-xr-xsrc/cmd/gotest/gotest2
-rwxr-xr-xsrc/cmd/make.bash8
-rw-r--r--src/cmd/nm/Makefile18
-rw-r--r--src/cmd/prof/Makefile17
27 files changed, 117 insertions, 285 deletions
diff --git a/src/cmd/5a/Makefile b/src/cmd/5a/Makefile
index f01b017dac..9485e5cf83 100644
--- a/src/cmd/5a/Makefile
+++ b/src/cmd/5a/Makefile
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
TARG=\
5a\
@@ -15,26 +16,11 @@ HFILES=\
OFILES=\
y.tab.$O\
lex.$O\
-# ../5l/enam.$O\
+ ../5l/enam.$O\
YFILES=\
a.y\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
lex.$O: ../cc/macbody ../cc/lexbody
-
-y.tab.h: $(YFILES)
- bison -y $(YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
- test -f y.tab.c && touch y.tab.c
-
-clean:
- rm -f *.$O $(TARG) *.5 enam.c 5.out a.out y.tab.h y.tab.c
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
diff --git a/src/cmd/5c/Makefile b/src/cmd/5c/Makefile
index b534206f35..70b614e8a5 100644
--- a/src/cmd/5c/Makefile
+++ b/src/cmd/5c/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 5c\
+TARG=5c
HFILES=\
gc.h\
@@ -26,18 +26,9 @@ OFILES=\
../5l/enam.$O\
LIB=\
- ../cc/cc.a$O
+ ../cc/cc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9
-
-$(OFILES): $(HFILES)
-
-clean:
- rm -f *.$O $(TARG) *.5 enam.c 5.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
%.$O: ../cc/%.c
- $(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
diff --git a/src/cmd/5g/Makefile b/src/cmd/5g/Makefile
index 123af19cda..762b7c5275 100644
--- a/src/cmd/5g/Makefile
+++ b/src/cmd/5g/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 5g
+TARG=5g
HFILES=\
../gc/go.h\
@@ -24,15 +24,9 @@ OFILES=\
cgen64.$O
LIB=\
- ../gc/gc.a$O
+ ../gc/gc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm
+include ../../Make.ccmd
-$(OFILES): $(HFILES)
-
-clean:
- rm -f *.o $(TARG) *.5 enam.c 5.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+%.$O: ../gc/%.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
diff --git a/src/cmd/5l/Makefile b/src/cmd/5l/Makefile
index b9780f098d..fd0406558e 100644
--- a/src/cmd/5l/Makefile
+++ b/src/cmd/5l/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 5l\
+TARG=5l
OFILES=\
asm.$O\
@@ -27,19 +27,12 @@ HFILES=\
../5l/5.out.h\
../ld/elf.h\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
enam.c: 5.out.h
sh mkenam
-clean:
- rm -f *.o $(TARG) *.5 enam.c 5.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+CLEANFILES+=enam.c
%.$O: ../ld/%.c
- $(CC) $(CFLAGS) -c -I. ../ld/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
diff --git a/src/cmd/6a/Makefile b/src/cmd/6a/Makefile
index 21d824708e..30180bd247 100644
--- a/src/cmd/6a/Makefile
+++ b/src/cmd/6a/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 6a\
+TARG=6a
HFILES=\
a.h\
@@ -20,21 +20,6 @@ OFILES=\
YFILES=\
a.y\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
lex.$O: ../cc/macbody ../cc/lexbody
-
-y.tab.h: $(YFILES)
- bison -y $(YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
- test -f y.tab.c && touch y.tab.c
-
-clean:
- rm -f *.$O $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
diff --git a/src/cmd/6c/Makefile b/src/cmd/6c/Makefile
index 53a8e80e65..484e16def1 100644
--- a/src/cmd/6c/Makefile
+++ b/src/cmd/6c/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 6c\
+TARG=6c
HFILES=\
gc.h\
@@ -28,18 +28,9 @@ OFILES=\
../6l/enam.$O\
LIB=\
- ../cc/cc.a$O
+ ../cc/cc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9
-
-$(OFILES): $(HFILES)
-
-clean:
- rm -f *.$O $(TARG) *.6 enam.c 6.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
%.$O: ../cc/%.c
- $(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
diff --git a/src/cmd/6g/Makefile b/src/cmd/6g/Makefile
index 712cfc60cb..023f5d111b 100644
--- a/src/cmd/6g/Makefile
+++ b/src/cmd/6g/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 6g
+TARG=6g
HFILES=\
../gc/go.h\
@@ -26,18 +26,9 @@ OFILES=\
../6l/enam.$O\
LIB=\
- ../gc/gc.a$O
+ ../gc/gc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm
-
-$(OFILES): $(HFILES)
-
-clean:
- rm -f $(TARG) enam.c 6.out a.out *.$O *.6
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
%.$O: ../gc/%.c
- $(CC) $(CFLAGS) -c -I. -o $@ ../gc/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
diff --git a/src/cmd/6l/Makefile b/src/cmd/6l/Makefile
index 0ee1a6130a..04d3fb0449 100644
--- a/src/cmd/6l/Makefile
+++ b/src/cmd/6l/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 6l\
+TARG=6l
OFILES=\
asm.$O\
@@ -29,19 +29,12 @@ HFILES=\
../ld/macho.h\
../ld/dwarf.h\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
enam.c: 6.out.h
sh mkenam
-clean:
- rm -f *.$O $(TARG) *.6 enam.c 6.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+CLEANFILES+=enam.c
%.$O: ../ld/%.c
- $(CC) $(CFLAGS) -c -I. ../ld/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
diff --git a/src/cmd/8a/Makefile b/src/cmd/8a/Makefile
index beb5755446..78d361dbd3 100644
--- a/src/cmd/8a/Makefile
+++ b/src/cmd/8a/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 8a\
+TARG=8a
HFILES=\
a.h\
@@ -20,21 +20,6 @@ OFILES=\
YFILES=\
a.y\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
lex.$O: ../cc/macbody ../cc/lexbody
-
-y.tab.h: $(YFILES)
- bison -y $(YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
- test -f y.tab.c && touch y.tab.c
-
-clean:
- rm -f *.$O $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
diff --git a/src/cmd/8c/Makefile b/src/cmd/8c/Makefile
index 85ea3013b7..60f46d3c98 100644
--- a/src/cmd/8c/Makefile
+++ b/src/cmd/8c/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 8c\
+TARG=8c
HFILES=\
gc.h\
@@ -29,18 +29,9 @@ OFILES=\
../8l/enam.$O\
LIB=\
- ../cc/cc.a$O
+ ../cc/cc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lm -lbio -l9
-
-$(OFILES): $(HFILES)
-
-clean:
- rm -f *.$O $(TARG) *.8 8.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
%.$O: ../cc/%.c
- $(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
diff --git a/src/cmd/8g/Makefile b/src/cmd/8g/Makefile
index d2431182f4..09cf8d4e30 100644
--- a/src/cmd/8g/Makefile
+++ b/src/cmd/8g/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 8g
+TARG=8g
HFILES=\
../gc/go.h\
@@ -27,18 +27,9 @@ OFILES=\
reg.$O\
LIB=\
- ../gc/gc.a$O
+ ../gc/gc.a\
-$(TARG): $(OFILES) $(LIB)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm
-
-$(OFILES): $(HFILES)
-
-clean:
- rm -f *.$O $(TARG) *.8 enam.c 8.out a.out
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
%.$O: ../gc/%.c
- $(CC) $(CFLAGS) -c -I. -o $@ ../gc/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
diff --git a/src/cmd/8l/Makefile b/src/cmd/8l/Makefile
index 88c7c512bb..2b509b3613 100644
--- a/src/cmd/8l/Makefile
+++ b/src/cmd/8l/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-TARG=\
- 8l\
+TARG=8l
OFILES=\
asm.$O\
@@ -28,20 +28,13 @@ HFILES=\
../ld/macho.h\
../ld/pe.h\
-
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
enam.c: 8.out.h
sh mkenam
-clean:
- rm -f *.$O $(TARG) *.8 enam.c 8.out a.out
+CLEANFILES+=enam.c
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
%.$O: ../ld/%.c
- $(CC) $(CFLAGS) -c -I. ../ld/$*.c
+ $(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
diff --git a/src/cmd/cc/Makefile b/src/cmd/cc/Makefile
index 98b89f0a28..71f23383d1 100644
--- a/src/cmd/cc/Makefile
+++ b/src/cmd/cc/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-LIB=\
- cc.a$O\
+LIB=cc.a
HFILES=\
cc.h\
@@ -30,18 +30,7 @@ OFILES=\
dpchk.$O\
omachcap.$O\
-$(LIB): $(OFILES)
- ar rsc $(LIB) $(OFILES)
-
-$(OFILES): $(HFILES)
-
-y.tab.h: $(YFILES)
- bison -y $(YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
- test -f y.tab.c && touch y.tab.c
-
-clean:
- rm -f *.$O *.6 enam.c 6.out a.out y.tab.h y.tab.c $(LIB)
+NOINSTALL=1
+include ../../Make.clib
install: $(LIB)
diff --git a/src/cmd/clean.bash b/src/cmd/clean.bash
index 9317b8ae5b..6349919a8a 100644
--- a/src/cmd/clean.bash
+++ b/src/cmd/clean.bash
@@ -3,11 +3,9 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-GOBIN="${GOBIN:-$HOME/bin}"
-
for i in cc 6l 6a 6c 8l 8a 8c 8g 5l 5a 5c 5g gc 6g gopack nm cgo cov ebnflint godefs godoc gofmt goinstall gotest goyacc hgpatch prof
do
cd $i
- "$GOBIN"/gomake clean
+ gomake clean
cd ..
done
diff --git a/src/cmd/cov/Makefile b/src/cmd/cov/Makefile
index 4017dba190..fdeb146365 100644
--- a/src/cmd/cov/Makefile
+++ b/src/cmd/cov/Makefile
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
# The directory is cov because the source is portable and general.
# We call the binary 6cov to avoid confusion and because this binary
@@ -16,11 +17,11 @@ OFILES=\
HFILES=\
tree.h\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lmach -lbio -l9
+LIB=\
+ ../../../lib/libmach.a\
-clean:
- rm -f *.$O $(TARG)
+NOINSTALL=1
+include ../../Make.ccmd
ifeq ($(GOOS),windows)
NAME=windows
@@ -39,5 +40,3 @@ install-darwin: $(TARG)
install-default: $(TARG)
cp $(TARG) "$(GOBIN)"/$(TARG)
-
-$(OFILES): $(HFILES)
diff --git a/src/cmd/ebnflint/Makefile b/src/cmd/ebnflint/Makefile
index 77279db245..8f030aaefa 100644
--- a/src/cmd/ebnflint/Makefile
+++ b/src/cmd/ebnflint/Makefile
@@ -11,5 +11,5 @@ GOFILES=\
include ../../Make.cmd
test: $(TARG)
- $(QUOTED_GOBIN)/$(TARG) -start="SourceFile" "$(GOROOT)"/doc/go_spec.html
+ $(TARG) -start="SourceFile" "$(GOROOT)"/doc/go_spec.html
diff --git a/src/cmd/gc/Makefile b/src/cmd/gc/Makefile
index 46dc6dfbc3..dbfd864744 100644
--- a/src/cmd/gc/Makefile
+++ b/src/cmd/gc/Makefile
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
-LIB=\
- gc.a$O\
+LIB=gc.a
HFILES=\
go.h\
@@ -43,16 +43,10 @@ OFILES=\
walk.$O\
y1.tab.$O\
-$(LIB): $(OFILES)
- ar rsc $(LIB) $(OFILES)
+NOINSTALL=1
+include ../../Make.clib
-$(OFILES): $(HFILES)
-
-y.tab.h: $(YFILES)
- LANG=C LANGUAGE="en_US.UTF8" bison -v -y $(YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
- test -f y.tab.c && touch y.tab.c
+install: $(LIB)
y1.tab.c: y.tab.c # make yystate global, yytname mutable
cat y.tab.c | sed '/ int yystate;/d; s/int yychar;/int yychar, yystate;/; s/static const char \*const yytname/const char *yytname/' >y1.tab.c
@@ -70,7 +64,4 @@ subr.$O: opnames.h
opnames.h: mkopnames go.h
./mkopnames go.h >opnames.h
-clean:
- rm -f *.[568o] enam.c [568].out a.out y.tab.h y.tab.c y1.tab.c y.output yerr.h $(LIB) mkbuiltin1 builtin.c _builtin.c opnames.h
-
-install: $(LIB)
+CLEANFILES+=*.[568] [568].out y1.tab.c yerr.h mkbuiltin1 builtin.c _builtin.c opnames.h
diff --git a/src/cmd/gc/mkbuiltin b/src/cmd/gc/mkbuiltin
index e29487e4bc..8da0da0499 100755
--- a/src/cmd/gc/mkbuiltin
+++ b/src/cmd/gc/mkbuiltin
@@ -10,11 +10,9 @@
set -e
-GOBIN="${GOBIN:-$HOME/bin}"
-
-eval $("$GOBIN"/gomake -f ../../Make.inc go-env)
+eval $(gomake -f ../../Make.inc go-env)
if [ -z "$GC" ]; then
- echo 'missing $GC - maybe no Make.$GOARCH?' 1>&2
+ echo 'missing $GC - gomake failed?' 1>&2
exit 1
fi
diff --git a/src/cmd/godefs/Makefile b/src/cmd/godefs/Makefile
index 49244f1521..b5c76fb0fe 100644
--- a/src/cmd/godefs/Makefile
+++ b/src/cmd/godefs/Makefile
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
TARG=godefs
OFILES=\
@@ -12,13 +13,4 @@ OFILES=\
HFILES=a.h
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
-
-clean:
- rm -f *.$O $(TARG)
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
diff --git a/src/cmd/gofmt/test.sh b/src/cmd/gofmt/test.sh
index 36f7d6e48e..00121ecb8d 100755
--- a/src/cmd/gofmt/test.sh
+++ b/src/cmd/gofmt/test.sh
@@ -3,9 +3,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-GOBIN="${GOBIN:-$HOME/bin}"
-
-eval $("$GOBIN"/gomake --no-print-directory -f ../../Make.inc go-env)
+eval $(gomake --no-print-directory -f ../../Make.inc go-env)
if [ -z "$O" ]; then
echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
exit 1
diff --git a/src/cmd/goinstall/main.go b/src/cmd/goinstall/main.go
index ffa6eb7afc..59eeb64bf4 100644
--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -51,10 +51,10 @@ func main() {
fmt.Fprintf(os.Stderr, "%s: no $GOROOT\n", argv0)
os.Exit(1)
}
- root += "/src/pkg/"
if gobin == "" {
- gobin = os.Getenv("HOME") + "/bin"
+ gobin = root + "/bin"
}
+ root += "/src/pkg/"
// special case - "unsafe" is already installed
visit["unsafe"] = done
diff --git a/src/cmd/gopack/Makefile b/src/cmd/gopack/Makefile
index c3c136f422..8598095624 100644
--- a/src/cmd/gopack/Makefile
+++ b/src/cmd/gopack/Makefile
@@ -2,17 +2,14 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
TARG=gopack
OFILES=\
ar.$O\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lmach -lbio -l9
+LIB=\
+ ../../../lib/libmach.a\
-clean:
- rm -f *.$O $(TARG)
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.ccmd
diff --git a/src/cmd/gotest/Makefile b/src/cmd/gotest/Makefile
index 8360fd1841..367c8ce640 100644
--- a/src/cmd/gotest/Makefile
+++ b/src/cmd/gotest/Makefile
@@ -2,10 +2,9 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
TARG=gotest
-GOROOT_FINAL?=$(GOROOT)
clean:
@true
diff --git a/src/cmd/gotest/gotest b/src/cmd/gotest/gotest
index 9995496ad6..fcebf044ed 100755
--- a/src/cmd/gotest/gotest
+++ b/src/cmd/gotest/gotest
@@ -24,7 +24,7 @@ if [ ! -f [Mm]akefile ]; then
fi
export GOROOT=${GOROOT:-"@@GOROOT@@"}
-eval $("$GOBIN"/gomake --no-print-directory -f "$GOROOT"/src/Make.inc go-env)
+eval $("$GOBIN"/gomake -j1 --no-print-directory -f "$GOROOT"/src/Make.inc go-env)
if [ -z "$O" ]; then
echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
exit 2
diff --git a/src/cmd/make.bash b/src/cmd/make.bash
index 4ee22776b3..18ca845edd 100755
--- a/src/cmd/make.bash
+++ b/src/cmd/make.bash
@@ -7,9 +7,7 @@ set -e
bash clean.bash
-GOBIN="${GOBIN:-$HOME/bin}"
-
-eval $("$GOBIN"/gomake --no-print-directory -f ../Make.inc go-env)
+eval $(gomake --no-print-directory -f ../Make.inc go-env)
if [ -z "$O" ]; then
echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
exit 1
@@ -17,7 +15,7 @@ fi
cd ${O}l
bash mkenam
-"$GOBIN"/gomake enam.o
+gomake enam.o
cd ..
# Note: commands written in Go are not listed here.
@@ -27,6 +25,6 @@ for i in cc ${O}l ${O}a ${O}c gc ${O}g cov godefs gopack gotest nm prof
do
echo; echo; echo %%%% making $i %%%%; echo
cd $i
- "$GOBIN"/gomake install
+ gomake install
cd ..
done
diff --git a/src/cmd/nm/Makefile b/src/cmd/nm/Makefile
index bb15451222..383dbd973c 100644
--- a/src/cmd/nm/Makefile
+++ b/src/cmd/nm/Makefile
@@ -2,23 +2,17 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
# The directory is nm because the source is portable and general.
-# We call the binary 6nm to avoid confusion and because this binary
-# is linked only with amd64 and x86 support.
+# We call the binary 6nm to avoid confusion with the host nm.
TARG=6nm
OFILES=\
nm.$O\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lmach -lbio -l9
+LIB=\
+ ../../../lib/libmach.a\
-clean:
- rm -f *.$O $(TARG)
-
-install: $(TARG)
- cp $(TARG) "$(GOBIN)"/$(TARG)
-
-$(OFILES): $(HFILES)
+include ../../Make.ccmd
diff --git a/src/cmd/prof/Makefile b/src/cmd/prof/Makefile
index 1d1094b5a0..e643f267cc 100644
--- a/src/cmd/prof/Makefile
+++ b/src/cmd/prof/Makefile
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.conf
+include ../../Make.inc
+O:=$(HOST_O)
# The directory is prof because the source is portable and general.
# We call the binary 6prof to avoid confusion and because this binary
@@ -12,15 +13,11 @@ TARG=6prof
OFILES=\
main.$O\
-#HFILES=\
-# defs.h\
-# fns.h\
+LIB=\
+ ../../../lib/libmach.a\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lmach -lbio -l9
-
-clean:
- rm -f *.$O $(TARG)
+NOINSTALL=1
+include ../../Make.ccmd
ifeq ($(GOOS),windows)
NAME=windows
@@ -40,7 +37,5 @@ install-darwin: $(TARG)
install-default: $(TARG)
cp $(TARG) "$(GOBIN)"/$(TARG)
-$(OFILES): $(HFILES)
-
install-pprof: gopprof
cp gopprof "$(GOBIN)"/gopprof