mirror of
https://github.com/golang/go
synced 2024-11-25 15:47:56 -07:00
Support use of $GOBINDIR to override $HOME/bin
R=r,gri,rsc APPROVED=rsc DELTA=53 (12 added, 6 deleted, 35 changed) OCL=31822 CL=32282
This commit is contained in:
parent
eaa25ac16b
commit
d6f89c69c4
@ -5,6 +5,9 @@
|
|||||||
CC=quietgcc
|
CC=quietgcc
|
||||||
LD=quietgcc
|
LD=quietgcc
|
||||||
CFLAGS=-ggdb -I$(GOROOT)/include -O1
|
CFLAGS=-ggdb -I$(GOROOT)/include -O1
|
||||||
BIN=$(HOME)/bin
|
|
||||||
O=o
|
O=o
|
||||||
YFLAGS=-d
|
YFLAGS=-d
|
||||||
|
# GNU Make syntax:
|
||||||
|
ifndef GOBIN
|
||||||
|
GOBIN=$(HOME)/bin
|
||||||
|
endif
|
||||||
|
@ -39,4 +39,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out y.tab.h y.tab.c
|
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out y.tab.h y.tab.c
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -37,8 +37,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: ../cc/%.c
|
%.$O: ../cc/%.c
|
||||||
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
||||||
|
|
||||||
|
@ -34,4 +34,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -37,4 +37,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -11,12 +11,10 @@ HFILES=\
|
|||||||
a.h\
|
a.h\
|
||||||
y.tab.h\
|
y.tab.h\
|
||||||
../6l/6.out.h\
|
../6l/6.out.h\
|
||||||
compat.h\
|
|
||||||
|
|
||||||
OFILES=\
|
OFILES=\
|
||||||
y.tab.$O\
|
y.tab.$O\
|
||||||
lex.$O\
|
lex.$O\
|
||||||
compat.$O\
|
|
||||||
../6l/enam.$O\
|
../6l/enam.$O\
|
||||||
|
|
||||||
YFILES=\
|
YFILES=\
|
||||||
@ -39,4 +37,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
|
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -38,8 +38,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: ../cc/%.c
|
%.$O: ../cc/%.c
|
||||||
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
||||||
|
|
||||||
|
@ -36,4 +36,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -23,6 +23,7 @@ HFILES=\
|
|||||||
l.h\
|
l.h\
|
||||||
../6l/6.out.h\
|
../6l/6.out.h\
|
||||||
../ld/elf64.h\
|
../ld/elf64.h\
|
||||||
|
../6l/compat.h\
|
||||||
|
|
||||||
|
|
||||||
$(TARG): $(OFILES)
|
$(TARG): $(OFILES)
|
||||||
@ -37,7 +38,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
go.o: ../ld/go.c
|
go.o: ../ld/go.c
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
|
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -40,8 +40,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.8 8.out a.out
|
rm -f $(OFILES) $(TARG) *.8 8.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: ../cc/%.c
|
%.$O: ../cc/%.c
|
||||||
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c
|
||||||
|
|
||||||
|
@ -37,4 +37,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
|
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -35,7 +35,6 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
|
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
go.o: ../ld/go.c
|
go.o: ../ld/go.c
|
||||||
|
|
||||||
|
@ -19,4 +19,4 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -30,6 +30,6 @@ install-darwin: $(TARG)
|
|||||||
@true
|
@true
|
||||||
|
|
||||||
install-default: $(TARG)
|
install-default: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
$(OFILES): $(HFILES)
|
$(OFILES): $(HFILES)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
include $(GOROOT)/src/Make.conf
|
||||||
include $(GOROOT)/src/Make.$(GOARCH)
|
include $(GOROOT)/src/Make.$(GOARCH)
|
||||||
|
|
||||||
TARG=ebnflint
|
TARG=ebnflint
|
||||||
@ -18,7 +19,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(HOME)/bin/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: %.go
|
%.$O: %.go
|
||||||
$(GC) $<
|
$(GC) $<
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
# ironically, not auto-generated
|
# ironically, not auto-generated
|
||||||
|
|
||||||
|
include ../../Make.conf
|
||||||
|
|
||||||
O_arm=5
|
O_arm=5
|
||||||
O_amd64=6
|
O_amd64=6
|
||||||
O_386=8
|
O_386=8
|
||||||
@ -71,8 +73,7 @@ gobuild: zzgobuild
|
|||||||
main.$O: phases
|
main.$O: phases
|
||||||
|
|
||||||
nuke: clean
|
nuke: clean
|
||||||
rm -f $(HOME)/bin/gobuild
|
rm -f $(GOBIN)/gobuild
|
||||||
|
|
||||||
install: zzgobuild
|
install: zzgobuild
|
||||||
cp gobuild $(HOME)/bin/gobuild
|
cp gobuild $(GOBIN)/gobuild
|
||||||
|
|
||||||
|
@ -19,6 +19,6 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
$(OFILES): $(HFILES)
|
$(OFILES): $(HFILES)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
include $(GOROOT)/src/Make.conf
|
||||||
include $(GOROOT)/src/Make.$(GOARCH)
|
include $(GOROOT)/src/Make.$(GOARCH)
|
||||||
|
|
||||||
TARG=godoc
|
TARG=godoc
|
||||||
@ -15,7 +16,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(HOME)/bin/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: %.go
|
%.$O: %.go
|
||||||
$(GC) $<
|
$(GC) $<
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
include $(GOROOT)/src/Make.conf
|
||||||
include $(GOROOT)/src/Make.$(GOARCH)
|
include $(GOROOT)/src/Make.$(GOARCH)
|
||||||
|
|
||||||
TARG=gofmt
|
TARG=gofmt
|
||||||
@ -21,7 +22,7 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(HOME)/bin/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
%.$O: %.go
|
%.$O: %.go
|
||||||
$(GC) $<
|
$(GC) $<
|
||||||
|
@ -10,5 +10,5 @@ clean:
|
|||||||
@true
|
@true
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
! test -f $(BIN)/$(TARG) || chmod u+w $(BIN)/$(TARG)
|
! test -f $(GOBIN)/$(TARG) || chmod u+w $(GOBIN)/$(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
@ -19,6 +19,6 @@ clean:
|
|||||||
rm -f $(OFILES) $(TARG)
|
rm -f $(OFILES) $(TARG)
|
||||||
|
|
||||||
install: $(TARG)
|
install: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
$(OFILES): $(HFILES)
|
$(OFILES): $(HFILES)
|
||||||
|
@ -30,6 +30,6 @@ install-darwin: $(TARG)
|
|||||||
@true
|
@true
|
||||||
|
|
||||||
install-default: $(TARG)
|
install-default: $(TARG)
|
||||||
cp $(TARG) $(BIN)/$(TARG)
|
cp $(TARG) $(GOBIN)/$(TARG)
|
||||||
|
|
||||||
$(OFILES): $(HFILES)
|
$(OFILES): $(HFILES)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
GOBIN="${GOBIN:-$HOME/bin}"
|
||||||
export MAKEFLAGS=-j4
|
export MAKEFLAGS=-j4
|
||||||
|
|
||||||
if ! test -f $GOROOT/include/u.h
|
if ! test -f $GOROOT/include/u.h
|
||||||
@ -14,9 +15,9 @@ fi
|
|||||||
|
|
||||||
bash clean.bash
|
bash clean.bash
|
||||||
|
|
||||||
rm -f $HOME/bin/quietgcc
|
rm -f $GOBIN/quietgcc
|
||||||
cp quietgcc.bash $HOME/bin/quietgcc
|
cp quietgcc.bash $GOBIN/quietgcc
|
||||||
chmod +x $HOME/bin/quietgcc
|
chmod +x $GOBIN/quietgcc
|
||||||
|
|
||||||
for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/ebnflint cmd/gobuild cmd/godoc cmd/gofmt
|
for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/ebnflint cmd/gobuild cmd/godoc cmd/gofmt
|
||||||
do
|
do
|
||||||
|
2
test/run
2
test/run
@ -24,7 +24,7 @@ export GOTRACEBACK=0
|
|||||||
|
|
||||||
failed=0
|
failed=0
|
||||||
|
|
||||||
PATH=/bin:/usr/bin:$HOME/bin:`pwd`
|
PATH=/bin:/usr/bin:${GOBIN:-$HOME/bin}:`pwd`
|
||||||
|
|
||||||
RUNFILE=/tmp/gorun-$$-$USER
|
RUNFILE=/tmp/gorun-$$-$USER
|
||||||
TMP1FILE=/tmp/gotest1-$$-$USER
|
TMP1FILE=/tmp/gotest1-$$-$USER
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style
|
# Use of this source code is governed by a BSD-style
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
include $(GOROOT)/src/Make.conf
|
||||||
include $(GOROOT)/src/Make.$(GOARCH)
|
include $(GOROOT)/src/Make.$(GOARCH)
|
||||||
|
|
||||||
all: godoc gofmt
|
all: godoc gofmt
|
||||||
@ -19,8 +20,8 @@ smoketest: gofmt
|
|||||||
./test.sh $(GOROOT)/src/pkg/go/printer/printer.go
|
./test.sh $(GOROOT)/src/pkg/go/printer/printer.go
|
||||||
|
|
||||||
install: pretty godoc untab
|
install: pretty godoc untab
|
||||||
cp godoc $(HOME)/bin/godoc
|
cp godoc $(GOBIN)/godoc
|
||||||
cp gofmt $(HOME)/bin/gofmt
|
cp gofmt $(GOBIN)/gofmt
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f godoc gofmt *.$O *.a 6.out *~
|
rm -f godoc gofmt *.$O *.a 6.out *~
|
||||||
|
Loading…
Reference in New Issue
Block a user