1
0
mirror of https://github.com/golang/go synced 2024-11-25 12:57:58 -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:
Phil Pennock 2009-07-28 11:23:24 -07:00
parent eaa25ac16b
commit d6f89c69c4
26 changed files with 42 additions and 38 deletions

View File

@ -5,6 +5,9 @@
CC=quietgcc
LD=quietgcc
CFLAGS=-ggdb -I$(GOROOT)/include -O1
BIN=$(HOME)/bin
O=o
YFLAGS=-d
# GNU Make syntax:
ifndef GOBIN
GOBIN=$(HOME)/bin
endif

View File

@ -39,4 +39,4 @@ clean:
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out y.tab.h y.tab.c
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -37,8 +37,7 @@ clean:
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: ../cc/%.c
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c

View File

@ -34,4 +34,4 @@ clean:
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -37,4 +37,4 @@ clean:
rm -f $(OFILES) $(TARG) *.5 enam.c 5.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -11,12 +11,10 @@ HFILES=\
a.h\
y.tab.h\
../6l/6.out.h\
compat.h\
OFILES=\
y.tab.$O\
lex.$O\
compat.$O\
../6l/enam.$O\
YFILES=\
@ -39,4 +37,4 @@ clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -38,8 +38,7 @@ clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: ../cc/%.c
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c

View File

@ -36,4 +36,4 @@ clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -23,6 +23,7 @@ HFILES=\
l.h\
../6l/6.out.h\
../ld/elf64.h\
../6l/compat.h\
$(TARG): $(OFILES)
@ -37,7 +38,7 @@ clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
go.o: ../ld/go.c

View File

@ -39,4 +39,4 @@ clean:
rm -f $(OFILES) $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -40,8 +40,7 @@ clean:
rm -f $(OFILES) $(TARG) *.8 8.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: ../cc/%.c
$(CC) $(CFLAGS) -c -I. -o $@ ../cc/$*.c

View File

@ -37,4 +37,4 @@ clean:
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -35,7 +35,6 @@ clean:
rm -f $(OFILES) $(TARG) *.8 enam.c 8.out a.out
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
go.o: ../ld/go.c

View File

@ -19,4 +19,4 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -30,6 +30,6 @@ install-darwin: $(TARG)
@true
install-default: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
$(OFILES): $(HFILES)

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=ebnflint
@ -18,7 +19,7 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(HOME)/bin/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: %.go
$(GC) $<

View File

@ -4,6 +4,8 @@
# ironically, not auto-generated
include ../../Make.conf
O_arm=5
O_amd64=6
O_386=8
@ -71,8 +73,7 @@ gobuild: zzgobuild
main.$O: phases
nuke: clean
rm -f $(HOME)/bin/gobuild
rm -f $(GOBIN)/gobuild
install: zzgobuild
cp gobuild $(HOME)/bin/gobuild
cp gobuild $(GOBIN)/gobuild

View File

@ -19,6 +19,6 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
$(OFILES): $(HFILES)

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=godoc
@ -15,7 +16,7 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(HOME)/bin/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: %.go
$(GC) $<

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=gofmt
@ -21,7 +22,7 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(HOME)/bin/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
%.$O: %.go
$(GC) $<

View File

@ -10,5 +10,5 @@ clean:
@true
install: $(TARG)
! test -f $(BIN)/$(TARG) || chmod u+w $(BIN)/$(TARG)
cp $(TARG) $(BIN)/$(TARG)
! test -f $(GOBIN)/$(TARG) || chmod u+w $(GOBIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)

View File

@ -19,6 +19,6 @@ clean:
rm -f $(OFILES) $(TARG)
install: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
$(OFILES): $(HFILES)

View File

@ -30,6 +30,6 @@ install-darwin: $(TARG)
@true
install-default: $(TARG)
cp $(TARG) $(BIN)/$(TARG)
cp $(TARG) $(GOBIN)/$(TARG)
$(OFILES): $(HFILES)

View File

@ -4,6 +4,7 @@
# license that can be found in the LICENSE file.
set -e
GOBIN="${GOBIN:-$HOME/bin}"
export MAKEFLAGS=-j4
if ! test -f $GOROOT/include/u.h
@ -14,9 +15,9 @@ fi
bash clean.bash
rm -f $HOME/bin/quietgcc
cp quietgcc.bash $HOME/bin/quietgcc
chmod +x $HOME/bin/quietgcc
rm -f $GOBIN/quietgcc
cp quietgcc.bash $GOBIN/quietgcc
chmod +x $GOBIN/quietgcc
for i in lib9 libbio libmach_amd64 libregexp cmd pkg cmd/ebnflint cmd/gobuild cmd/godoc cmd/gofmt
do

View File

@ -24,7 +24,7 @@ export GOTRACEBACK=0
failed=0
PATH=/bin:/usr/bin:$HOME/bin:`pwd`
PATH=/bin:/usr/bin:${GOBIN:-$HOME/bin}:`pwd`
RUNFILE=/tmp/gorun-$$-$USER
TMP1FILE=/tmp/gotest1-$$-$USER

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
all: godoc gofmt
@ -19,8 +20,8 @@ smoketest: gofmt
./test.sh $(GOROOT)/src/pkg/go/printer/printer.go
install: pretty godoc untab
cp godoc $(HOME)/bin/godoc
cp gofmt $(HOME)/bin/gofmt
cp godoc $(GOBIN)/godoc
cp gofmt $(GOBIN)/gofmt
clean:
rm -f godoc gofmt *.$O *.a 6.out *~