Commit 760b7784 authored by David Symonds's avatar David Symonds

Create dependencies automatically for top-level lib directory.

It caught a few missing dependencies (bufio/fmt -> utf8, fmt -> os, http -> strconv, etc.).

R=r,rsc
APPROVED=r
DELTA=126  (79 added, 45 deleted, 2 changed)
OCL=28983
CL=29014
parent 500f6b8e
bignum.install: fmt.install
bufio.install: io.install os.install utf8.install
container/vector.install:
crypto/aes.install: os.install
exec.install: os.install strings.install
exvar.install: fmt.install http.install io.install log.install strconv.install sync.install
flag.install: fmt.install os.install strconv.install
fmt.install: io.install os.install reflect.install strconv.install utf8.install
go/ast.install: go/token.install unicode.install utf8.install
go/doc.install: container/vector.install fmt.install go/ast.install go/token.install io.install once.install regexp.install sort.install strings.install
go/parser.install: container/vector.install fmt.install go/ast.install go/scanner.install go/token.install io.install os.install
go/scanner.install: go/token.install strconv.install unicode.install utf8.install
go/token.install: strconv.install
hash/adler32.install: os.install
hash/crc32.install: os.install
hash/md5.install: os.install
hash/sha1.install: os.install
hash/sum.install: flag.install fmt.install hash/adler32.install hash/crc32.install hash/md5.install hash/sha1.install io.install os.install
http.install: bufio.install fmt.install io.install log.install net.install os.install path.install strconv.install strings.install utf8.install
io.install: os.install sync.install
json.install: container/vector.install fmt.install io.install math.install reflect.install strconv.install strings.install utf8.install
log.install: fmt.install io.install os.install runtime.install time.install
malloc.install:
math.install:
net.install: fmt.install io.install once.install os.install reflect.install strconv.install strings.install sync.install syscall.install
once.install: sync.install
os.install: once.install syscall.install
path.install: io.install
rand.install:
reflect.install: strconv.install sync.install utf8.install
regexp.install: container/vector.install os.install runtime.install utf8.install
runtime.install:
sort.install:
strconv.install: math.install os.install utf8.install
strings.install: utf8.install
sync.install:
syscall.install: sync.install
tabwriter.install: container/vector.install io.install os.install utf8.install
template.install: container/vector.install fmt.install io.install os.install reflect.install runtime.install strings.install
testing.install: flag.install fmt.install os.install runtime.install
testing/iotest.install: io.install os.install
time.install: io.install once.install os.install syscall.install
unicode.install:
utf8.install:
...@@ -38,10 +38,12 @@ DIRS=\ ...@@ -38,10 +38,12 @@ DIRS=\
rand\ rand\
reflect\ reflect\
regexp\ regexp\
runtime\
sort\ sort\
strconv\ strconv\
strings\ strings\
sync\ sync\
syscall\
tabwriter\ tabwriter\
template\ template\
testing\ testing\
...@@ -112,47 +114,7 @@ test: test.dirs ...@@ -112,47 +114,7 @@ test: test.dirs
nuke: nuke.dirs nuke: nuke.dirs
rm -rf $(GOROOT)/pkg/* rm -rf $(GOROOT)/pkg/*
# TODO: dependencies - should auto-generate deps:
./deps.bash
bignum.install: fmt.install include Make.deps
bufio.install: io.install os.install
crypto/aes.install: os.install
exec.install: os.install strings.install
exvar.install: fmt.install http.install log.install strconv.install sync.install
flag.install: fmt.install os.install strconv.install
log.install: fmt.install io.install os.install runtime.install time.install
path.install: io.install
once.install: sync.install
strings.install: utf8.install
testing.install: flag.install fmt.install runtime.install
testing/iotest.install: io.install os.install
fmt.install: io.install reflect.install strconv.install
GODEPS=fmt.install io.install once.install regexp.install sort.install \
strconv.install strings.install unicode.install utf8.install container/vector.install
go/scanner.install: go/token.install $(GODEPS)
go/parser.install: go/ast.install go/scanner.install go/token.install $(GODEPS)
go/doc.install: go/ast.install go/token.install $(GODEPS)
go/ast.install: go/token.install $(GODEPS)
go/token.install: $(GODEPS)
hash/adler32.install: os.install
hash/crc32.install: os.install
hash/md5.install: os.install
hash/sha1.install: os.install
hash/sum.install: io.install os.install
http.install: bufio.install io.install net.install os.install path.install strings.install log.install
io.install: os.install sync.install
json.install: container/vector.install fmt.install io.install math.install \
strconv.install strings.install utf8.install
# TODO(rsc): net is not supposed to depend on fmt or strings or strconv
net.install: fmt.install once.install os.install strconv.install strings.install
os.install: syscall.install once.install
regexp.install: os.install runtime.install
reflect.install: strconv.install sync.install
strconv.install: math.install os.install utf8.install
sync.install:
syscall.install: sync.install
tabwriter.install: os.install io.install container/vector.install
template.install: container/vector.install fmt.install io.install os.install reflect.install runtime.install strings.install
time.install: once.install os.install io.install
once.install os.install sort.install strings.install sync.install template.install time.install \
#!/bin/bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
OUT="Make.deps"
TMP="Make.deps.tmp"
# Get list of directories from Makefile
dirs=$(sed '1,/^DIRS=/d; /^$/,$d; s/\\//g' Makefile)
dirpat=$(echo $dirs | sed 's/ /|/g; s/.*/^(&)$/')
for dir in $dirs; do (
cd $dir || exit 1
sources=$(sed -n 's/\.\$O\\/.go/p' Makefile | sort | uniq)
sources=$(ls $sources 2> /dev/null) # remove .s, .c, etc.
deps=$(
sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
cut -d '"' -f2 |
egrep "$dirpat" |
grep -v "^$dir\$" |
sed 's/$/.install/' |
sort -u
)
echo $dir.install: $deps
) done > $TMP
mv $TMP $OUT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment