]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgo/godeps.sh
i386: Add clear_ratio to processor_costs
[thirdparty/gcc.git] / libgo / godeps.sh
CommitLineData
4180345a 1#!/bin/sh
2
3# Copyright 2011 The Go Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6
7# The godeps.sh script outputs a dependency file for a package. The
8# dependency file is then included in the libgo Makefile. This is
9# automatic dependency generation, Go style.
10
11# The first parameter is the name of the file being generated. The
12# remaining parameters are the names of Go files which are scanned for
13# imports.
14
15set -e
16
17if test $# = 0; then
18 echo 1>&2 "Usage: godeps.sh OUTPUT INPUTS..."
19 exit 1
20fi
21
22output=$1
23shift
24
1a5b255c 25files=$*
26deps=`for f in $files; do cat $f; done |
4180345a 27 sed -n -e '/^import.*"/p; /^import[ ]*(/,/^)/p' |
33d1d391 28 sed -e 's/^import //' -e 's/^[^"]*"/"/' |
e104cab8 29 grep '^[ ]*"' |
4180345a 30 grep -v '"unsafe"' |
33d1d391 31 grep -v '%' |
4180345a 32 sed -e 's/^.*"\([^"]*\)".*$/\1/' -e 's/$/.gox/' |
33 sort -u`
34
1a5b255c 35echo $output: $files $deps