]> Cypherpunks repositories - gostls13.git/commitdiff
build: let pkg/Makefile coordinate building of Go commands
authorRuss Cox <rsc@golang.org>
Wed, 25 Aug 2010 21:54:10 +0000 (17:54 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Aug 2010 21:54:10 +0000 (17:54 -0400)
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
https://golang.org/cl/1972046

src/cmd/make.bash
src/make.bash
src/pkg/Makefile
src/pkg/deps.bash

index 18ca845edd5ab26d5685d4a8a0b02405674ac09d..63da74625cabafa6d8ea9924bb99de4b42f132b1 100755 (executable)
@@ -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
index 99155bd0f9c5e45ed3024bf2a0011dd55c4b0619..ad5c5444b47a953ff75e1839911704366dbc34c6 100755 (executable)
@@ -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)
index 67b7724b362da33f57e36daab4d76aca91303b47..9d2d1224a79a1a5a8c0623b97e90c96205f0e773 100644 (file)
@@ -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
index c8406d39cf67785118d4c8cef194712c9cd8a2d4..0acaef678a95d92169ae6b8fc5c5e0446ec98db9 100755 (executable)
@@ -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 | 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
        )