summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-08-25 17:54:10 -0400
committerRuss Cox <rsc@golang.org>2010-08-25 17:54:10 -0400
commitc4a2145daa6a54ac34ad2d3ebcbcec92e02902c8 (patch)
treee1823f37f4f4a09a0f98a6b4f052b6cc25a64d60 /src
parentf252c5f8107d6461dbc5efb4c273fef6a8d52839 (diff)
downloadgo-c4a2145daa6a54ac34ad2d3ebcbcec92e02902c8.tar.gz
build: let pkg/Makefile coordinate building of Go commands
Commands written in Go depend on Go packages, so they cannot be built by src/cmd/make.bash. They have been built by src/make.bash after all the packages are done, but we want to be able to use cgo (written in Go) during the build of package net. To make this possible, build the commands from src/pkg/Makefile instead of src/make.bash, so that they are included in the package dependency analysis. R=r CC=golang-dev http://codereview.appspot.com/1972046
Diffstat (limited to 'src')
-rwxr-xr-xsrc/cmd/make.bash2
-rwxr-xr-xsrc/make.bash3
-rw-r--r--src/pkg/Makefile18
-rwxr-xr-xsrc/pkg/deps.bash3
4 files changed, 23 insertions, 3 deletions
diff --git a/src/cmd/make.bash b/src/cmd/make.bash
index 18ca845ed..63da74625 100755
--- a/src/cmd/make.bash
+++ b/src/cmd/make.bash
@@ -19,7 +19,7 @@ gomake enam.o
cd ..
# Note: commands written in Go are not listed here.
-# They are in ../make.bash so that they can be built
+# They are in ../pkg/Makefile so that they can be built
# after the Go libraries on which they depend.
for i in cc ${O}l ${O}a ${O}c gc ${O}g cov godefs gopack gotest nm prof
do
diff --git a/src/make.bash b/src/make.bash
index 99155bd0f..ad5c5444b 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -52,7 +52,8 @@ fi
)
bash "$GOROOT"/src/clean.bash
-for i in lib9 libbio libmach cmd pkg libcgo cmd/cgo cmd/ebnflint cmd/godoc cmd/gofmt cmd/goinstall cmd/goyacc cmd/hgpatch
+# pkg builds libcgo and the Go programs in cmd.
+for i in lib9 libbio libmach cmd pkg
do
case "$i-$GOOS-$GOARCH" in
libcgo-nacl-* | cmd/*-nacl-* | libcgo-linux-arm)
diff --git a/src/pkg/Makefile b/src/pkg/Makefile
index 67b7724b3..9d2d1224a 100644
--- a/src/pkg/Makefile
+++ b/src/pkg/Makefile
@@ -123,6 +123,14 @@ DIRS=\
utf8\
websocket\
xml\
+ ../libcgo\
+ ../cmd/cgo\
+ ../cmd/ebnflint\
+ ../cmd/godoc\
+ ../cmd/gofmt\
+ ../cmd/goinstall\
+ ../cmd/goyacc\
+ ../cmd/hgpatch\
NOTEST=\
debug/proc\
@@ -140,6 +148,14 @@ NOTEST=\
runtime/pprof\
syscall\
testing/iotest\
+ ../libcgo\
+ ../cmd/cgo\
+ ../cmd/ebnflint\
+ ../cmd/godoc\
+ ../cmd/gofmt\
+ ../cmd/goinstall\
+ ../cmd/goyacc\
+ ../cmd/hgpatch\
NOBENCH=\
container/vector\
@@ -211,3 +227,5 @@ deps:
./deps.bash
-include Make.deps
+
+../cmd/cgo.install: ../libcgo.install
diff --git a/src/pkg/deps.bash b/src/pkg/deps.bash
index c8406d39c..0acaef678 100755
--- a/src/pkg/deps.bash
+++ b/src/pkg/deps.bash
@@ -13,7 +13,7 @@ fi
# Get list of directories from Makefile
dirs=$(sed '1,/^DIRS=/d; /^$/,$d; s/\\//g' Makefile)
-dirpat=$(echo $dirs | sed 's/ /|/g; s/.*/^(&)$/')
+dirpat=$(echo $dirs C | sed 's/ /|/g; s/.*/^(&)$/')
for dir in $dirs; do (
cd $dir || exit 1
@@ -31,6 +31,7 @@ for dir in $dirs; do (
egrep "$dirpat" |
grep -v "^$dir\$" |
sed 's/$/.install/' |
+ sed 's;^C\.install;../cmd/cgo.install;' |
sort -u
)