Permalink
Browse files

Update Makefile to work with Go1

  • Loading branch information...
1 parent f4eaf93 commit bf9b482c36bda7c78d7187f811ee71090b77e125 @pomack committed Mar 28, 2012
Showing with 16 additions and 86 deletions.
  1. +16 −45 Makefile
  2. +0 −41 deps.bash
View
@@ -1,53 +1,24 @@
+# Copyright 2012 Aalok Shah. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
-include $(GOROOT)/src/Make.inc
+all: install
-all: Make.deps install
+GOPATH:=$(GOPATH):`pwd`
+PACKAGE_NAME=github.com/pomack/jsonhelper.go/jsonhelper
-DIRS=\
- jsonhelper\
+clean:
+ GOPATH=$(GOPATH) go clean $(PACKAGE_NAME)
-TEST=\
- $(filter-out $(NOTEST),$(DIRS))
+install:
+ GOPATH=$(GOPATH) go install $(PACKAGE_NAME)
+nuke:
+ GOPATH=$(GOPATH) go clean -i $(PACKAGE_NAME)
-clean.dirs: $(addsuffix .clean, $(DIRS))
-install.dirs: $(addsuffix .install, $(DIRS))
-nuke.dirs: $(addsuffix .nuke, $(DIRS))
-test.dirs: $(addsuffix .test, $(TEST))
+test:
+ GOPATH=$(GOPATH) go test $(PACKAGE_NAME)
-%.clean:
- +cd $* && gomake clean
+check:
+ GOPATH=$(GOPATH) go build $(PACKAGE_NAME)
-%.install:
- +cd $* && gomake install
-
-%.nuke:
- +cd $* && gomake nuke
-
-%.test:
- +cd $* && gomake test
-
-%.check:
- +cd $* && gomake check
-
-clean: clean.dirs
-
-install: install.dirs
-
-test: test.dirs
-
-check: check.dirs
-
-#nuke: nuke.dirs
-# rm -rf "$(GOROOT)"/pkg/*
-
-echo-dirs:
- @echo $(DIRS)
-
-Make.deps:
- ./deps.bash
-
-deps:
- ./deps.bash
-
-#-include Make.deps
View
@@ -1,41 +0,0 @@
-#!/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.
-
-OUT="Make.deps"
-TMP="Make.deps.tmp"
-
-if [ -f $OUT ] && ! [ -w $OUT ]; then
- echo "$0: $OUT is read-only; aborting." 1>&2
- exit 1
-fi
-
-# Get list of directories from Makefile
-dirs=$(sed '1,/^DIRS=/d; /^$/,$d; s/\\//g' Makefile)
-dirs2=$(sed '1,/^DIRS=/d; /^$/,$d; s/\\//g' ${GOROOT}/src/pkg/Makefile)
-dirpat=$(echo $dirs $dirs2 | sed 's/ /|/g; s/.*/^(&)$/')
-
-for dir in $dirs; do (
- cd $dir || exit 1
-
- sources=$(sed -n 's/\.go\\/.go/p' Makefile)
- 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
-
-for dir in $dirs2; do (
- echo $dir.install: \${GOROOT}/pkg/\${GOOS}_\${GOARCH}/${dir}.a
-) done >> $TMP
-
-mv $TMP $OUT

0 comments on commit bf9b482

Please sign in to comment.