diff --git a/algs4/Makefile b/algs4/Makefile index abd2c63..928651e 100644 --- a/algs4/Makefile +++ b/algs4/Makefile @@ -1,23 +1,24 @@ -CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":") -GOPATH := $(PWD):$(CLEAN_GOPATH) -PACKAGES := $(foreach pkg,\ - $(shell ls src/meatballhat.com),\ - $(patsubst %,meatballhat.com/%,$(pkg))\ - ) +REPO_BASE := github.com/meatballhat/box-o-sand/algs4/go +TARGETS := \ + $(REPO_BASE)/algs4 \ + $(REPO_BASE)/algs4-binarysearch \ + $(REPO_BASE)/algs4-flips \ + $(REPO_BASE)/algs4-gcd \ + $(REPO_BASE)/algs4-rolls test: build - go test $(PACKAGES) + go test -x $(TARGETS) build: deps - go install $(PACKAGES) + go install -x $(TARGETS) fmt: - go fmt $(PACKAGES) + go fmt -x $(TARGETS) deps: - go get $(PACKAGES) + go get -x -n $(TARGETS) clean: - rm -v bin/* + go clean -x -x $(TARGETS) .PHONY: test build clean fmt diff --git a/algs4/src/meatballhat.com/algs4-binarysearch/main.go b/algs4/go/algs4-binarysearch/main.go similarity index 93% rename from algs4/src/meatballhat.com/algs4-binarysearch/main.go rename to algs4/go/algs4-binarysearch/main.go index e0e48aa..c661bde 100644 --- a/algs4/src/meatballhat.com/algs4-binarysearch/main.go +++ b/algs4/go/algs4-binarysearch/main.go @@ -8,7 +8,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) const USAGE string = `Usage: algs4-binarysearch diff --git a/algs4/src/meatballhat.com/algs4-flips/main.go b/algs4/go/algs4-flips/main.go similarity index 93% rename from algs4/src/meatballhat.com/algs4-flips/main.go rename to algs4/go/algs4-flips/main.go index 47557a7..9e77505 100644 --- a/algs4/src/meatballhat.com/algs4-flips/main.go +++ b/algs4/go/algs4-flips/main.go @@ -10,7 +10,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) const USAGE string = "Usage: algs4-flips " diff --git a/algs4/src/meatballhat.com/algs4-gcd/main.go b/algs4/go/algs4-gcd/main.go similarity index 89% rename from algs4/src/meatballhat.com/algs4-gcd/main.go rename to algs4/go/algs4-gcd/main.go index a2a7223..c9d0b12 100644 --- a/algs4/src/meatballhat.com/algs4-gcd/main.go +++ b/algs4/go/algs4-gcd/main.go @@ -7,7 +7,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) const USAGE string = `Usage: algs4-gcd ` diff --git a/algs4/src/meatballhat.com/algs4-rolls/main.go b/algs4/go/algs4-rolls/main.go similarity index 89% rename from algs4/src/meatballhat.com/algs4-rolls/main.go rename to algs4/go/algs4-rolls/main.go index f150084..2d6a284 100644 --- a/algs4/src/meatballhat.com/algs4-rolls/main.go +++ b/algs4/go/algs4-rolls/main.go @@ -7,7 +7,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) const ( diff --git a/algs4/src/meatballhat.com/algs4/binarysearch.go b/algs4/go/algs4/binarysearch.go similarity index 100% rename from algs4/src/meatballhat.com/algs4/binarysearch.go rename to algs4/go/algs4/binarysearch.go diff --git a/algs4/src/meatballhat.com/algs4/binarysearch_test.go b/algs4/go/algs4/binarysearch_test.go similarity index 85% rename from algs4/src/meatballhat.com/algs4/binarysearch_test.go rename to algs4/go/algs4/binarysearch_test.go index 92412eb..1d16436 100644 --- a/algs4/src/meatballhat.com/algs4/binarysearch_test.go +++ b/algs4/go/algs4/binarysearch_test.go @@ -5,7 +5,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) func TestBinarySearchRank(t *testing.T) { diff --git a/algs4/src/meatballhat.com/algs4/counter.go b/algs4/go/algs4/counter.go similarity index 100% rename from algs4/src/meatballhat.com/algs4/counter.go rename to algs4/go/algs4/counter.go diff --git a/algs4/src/meatballhat.com/algs4/gcd.go b/algs4/go/algs4/gcd.go similarity index 100% rename from algs4/src/meatballhat.com/algs4/gcd.go rename to algs4/go/algs4/gcd.go diff --git a/algs4/src/meatballhat.com/algs4/gcd_test.go b/algs4/go/algs4/gcd_test.go similarity index 75% rename from algs4/src/meatballhat.com/algs4/gcd_test.go rename to algs4/go/algs4/gcd_test.go index 0ae6c38..887a9da 100644 --- a/algs4/src/meatballhat.com/algs4/gcd_test.go +++ b/algs4/go/algs4/gcd_test.go @@ -5,7 +5,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) func TestGcd(t *testing.T) { diff --git a/algs4/src/meatballhat.com/algs4/io.go b/algs4/go/algs4/io.go similarity index 100% rename from algs4/src/meatballhat.com/algs4/io.go rename to algs4/go/algs4/io.go diff --git a/algs4/src/meatballhat.com/algs4/io_test.go b/algs4/go/algs4/io_test.go similarity index 91% rename from algs4/src/meatballhat.com/algs4/io_test.go rename to algs4/go/algs4/io_test.go index 307a5dc..d89e2ab 100644 --- a/algs4/src/meatballhat.com/algs4/io_test.go +++ b/algs4/go/algs4/io_test.go @@ -7,7 +7,7 @@ import ( ) import ( - "meatballhat.com/algs4" + "github.com/meatballhat/box-o-sand/algs4/go/algs4" ) const INTS_STRING = ` diff --git a/algs4/src/meatballhat.com/algs4/rolls.go b/algs4/go/algs4/rolls.go similarity index 100% rename from algs4/src/meatballhat.com/algs4/rolls.go rename to algs4/go/algs4/rolls.go