aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorDevon H. O'Dell <devon.odell@gmail.com>2009-11-14 15:29:09 -0800
committerRuss Cox <rsc@golang.org>2009-11-14 15:29:09 -0800
commit553be8427ed619cff7f4e58e4a0dd8d858b49d26 (patch)
tree941ec3d9eb7c810cae198cd58a03ce92d828c763 /src/make.bash
parent96bcdff6622d49174465e4102bd07c49cc5cc169 (diff)
downloadgo-553be8427ed619cff7f4e58e4a0dd8d858b49d26.tar.xz
Build changes to support work on the BSDs.
This does still contain some FreeBSD-specific bits, but it's a pain to do partial diffs. R=rsc https://golang.org/cl/152138
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/make.bash b/src/make.bash
index 06c1f128cd..2038fe2394 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env 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.
@@ -29,7 +29,7 @@ amd64 | 386 | arm)
esac
case "$GOOS" in
-darwin | linux | nacl)
+darwin | linux | nacl | freebsd)
;;
*)
echo '$GOOS is set to <'$GOOS'>, must be darwin, linux, or nacl' 1>&2
@@ -41,6 +41,14 @@ CC=${CC:-gcc}
sed -e "s|@CC@|$CC|" < quietgcc.bash > $GOBIN/quietgcc
chmod +x $GOBIN/quietgcc
+rm -f $GOBIN/gomake
+MAKE=make
+if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then
+ MAKE=gmake
+fi
+(echo '#!/bin/sh'; echo 'exec '$MAKE' "$@"') >$GOBIN/gomake
+chmod +x $GOBIN/gomake
+
if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then
echo "installed quietgcc as $GOBIN/quietgcc but 'which quietgcc' fails" 1>&2
echo "double-check that $GOBIN is in your "'$PATH' 1>&2
@@ -83,7 +91,7 @@ do
bash make.bash
;;
*)
- make install
+ gomake install
esac
) || exit 1
esac