Browse Source

build.go: chdir to json dir, BUILD utils: go get util deps under third_party, .gitignore: ignore third_party stuff

Change-Id: I2b09f223b9695b5fa160b87c327b2f1f3bfa2b49
Aki Nyrhinen 8 years ago
parent
commit
caac283795
3 changed files with 14 additions and 5 deletions
  1. 5 0
      .gitignore
  2. 4 3
      BUILD
  3. 5 2
      util/build.go

+ 5 - 0
.gitignore

@@ -51,3 +51,8 @@ tools/mpfr-3.1.2-p9
 tools/mpfr-3.1.2.tar.bz2
 tools/share
 /tmp
+
+cfg/pxe/tftpboot
+util/third_party/bin
+util/third_party/src/golang.org
+

+ 4 - 3
BUILD

@@ -47,17 +47,18 @@ build_kernel()
 build_go_utils()
 {
 	cd "${UTIL_DIR}"
+	GOPATH="$UTIL_DIR/third_party" go get
+	GOPATH="$UTIL_DIR/third_party" go install github.com/rminnich/go9p/ufs
+	cp $UTIL_DIR/third_party/bin/* $UTIL_DIR/
 	for i in `ls *.go`
 	do
-		go build $i
+		GOPATH="$UTIL_DIR/third_party" go build $i
 		if [ $? -ne 0 ]
 		then
 			printf "\nERROR compiling $i \n"
 			exit 1
 		fi
 	done
-	GOPATH="$UTIL_DIR/third_party" go install github.com/rminnich/go9p/ufs
-	cp $UTIL_DIR/third_party/bin/* $UTIL_DIR/
 	cd - > /dev/null
 }
 

+ 5 - 2
util/build.go

@@ -349,6 +349,9 @@ func main() {
 	if badsetup {
 		os.Exit(1)
 	}
-	f := path.Join(cwd, os.Args[1])
-	project(f)
+	dir := path.Dir(os.Args[1])
+	file := path.Base(os.Args[1])
+	err = os.Chdir(dir)
+	fail(err)
+	project(file)
 }