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:
parent
eaa25ac16b
commit
d6f89c69c4
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -19,4 +19,4 @@ clean:
|
||||
rm -f $(OFILES) $(TARG)
|
||||
|
||||
install: $(TARG)
|
||||
cp $(TARG) $(BIN)/$(TARG)
|
||||
cp $(TARG) $(GOBIN)/$(TARG)
|
||||
|
@ -30,6 +30,6 @@ install-darwin: $(TARG)
|
||||
@true
|
||||
|
||||
install-default: $(TARG)
|
||||
cp $(TARG) $(BIN)/$(TARG)
|
||||
cp $(TARG) $(GOBIN)/$(TARG)
|
||||
|
||||
$(OFILES): $(HFILES)
|
||||
|
@ -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) $<
|
||||
|
@ -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
|
||||
|
@ -19,6 +19,6 @@ clean:
|
||||
rm -f $(OFILES) $(TARG)
|
||||
|
||||
install: $(TARG)
|
||||
cp $(TARG) $(BIN)/$(TARG)
|
||||
cp $(TARG) $(GOBIN)/$(TARG)
|
||||
|
||||
$(OFILES): $(HFILES)
|
||||
|
@ -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) $<
|
||||
|
@ -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) $<
|
||||
|
@ -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)
|
||||
|
@ -19,6 +19,6 @@ clean:
|
||||
rm -f $(OFILES) $(TARG)
|
||||
|
||||
install: $(TARG)
|
||||
cp $(TARG) $(BIN)/$(TARG)
|
||||
cp $(TARG) $(GOBIN)/$(TARG)
|
||||
|
||||
$(OFILES): $(HFILES)
|
||||
|
@ -30,6 +30,6 @@ install-darwin: $(TARG)
|
||||
@true
|
||||
|
||||
install-default: $(TARG)
|
||||
cp $(TARG) $(BIN)/$(TARG)
|
||||
cp $(TARG) $(GOBIN)/$(TARG)
|
||||
|
||||
$(OFILES): $(HFILES)
|
||||
|
@ -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
|
||||
|
2
test/run
2
test/run
@ -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
|
||||
|
@ -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 *~
|
||||
|
Loading…
Reference in New Issue
Block a user