From 0d7806fba4865ad99264d23125ddc3cf63bd4ae8 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 5 Nov 2012 20:36:27 -0500 Subject: [PATCH] Re-namespacing things and adjusting how stuff gets built based on some recent practical experience with Go. --- gotime/.example-autoenv.env | 4 ++++ gotime/Makefile | 16 ++++++++++------ .../channels/main.go} | 0 .../exercise-fibonacci-closure/main.go} | 0 .../exercise-http-handlers/main.go} | 0 .../exercise-maps/main.go} | 0 .../exercise-slices/main.go} | 0 .../exercise-sqrt/main.go} | 0 .../goroutines/main.go} | 0 .../hello-web/main.go} | 0 .../maps/main.go} | 0 .../ranges/main.go} | 0 12 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 gotime/.example-autoenv.env rename gotime/src/{channels.go => gotour.meatballhat.com/channels/main.go} (100%) rename gotime/src/{exercise-fibonacci-closure.go => gotour.meatballhat.com/exercise-fibonacci-closure/main.go} (100%) rename gotime/src/{exercise-http-handlers.go => gotour.meatballhat.com/exercise-http-handlers/main.go} (100%) rename gotime/src/{exercise-maps.go => gotour.meatballhat.com/exercise-maps/main.go} (100%) rename gotime/src/{exercise-slices.go => gotour.meatballhat.com/exercise-slices/main.go} (100%) rename gotime/src/{exercise-sqrt.go => gotour.meatballhat.com/exercise-sqrt/main.go} (100%) rename gotime/src/{goroutines.go => gotour.meatballhat.com/goroutines/main.go} (100%) rename gotime/src/{hello-web.go => gotour.meatballhat.com/hello-web/main.go} (100%) rename gotime/src/{maps.go => gotour.meatballhat.com/maps/main.go} (100%) rename gotime/src/{ranges.go => gotour.meatballhat.com/ranges/main.go} (100%) diff --git a/gotime/.example-autoenv.env b/gotime/.example-autoenv.env new file mode 100644 index 0000000..cf54d12 --- /dev/null +++ b/gotime/.example-autoenv.env @@ -0,0 +1,4 @@ +export PATH="$HOME/src/box-o-sand/src/gotime/.installation/go/bin:$PATH" +export GOROOT="$HOME/src/box-o-sand/src/gotime/.installation/go" +export GOPATH="$GOROOT:$HOME/src/box-o-sand/src/gotime" +source "$GOROOT/misc/bash/go" diff --git a/gotime/Makefile b/gotime/Makefile index 1517eda..fb8cdfd 100644 --- a/gotime/Makefile +++ b/gotime/Makefile @@ -1,12 +1,16 @@ -SOURCES := $(shell find src -name '*.go') -TARGETS := $(patsubst src/%.go,bin/%,$(SOURCES)) +PACKAGES := $(foreach pkg,\ + $(shell ls src/gotour.meatballhat.com),\ + $(patsubst %,gotour.meatballhat.com/%,$(pkg))\ + ) -bin/%: src/%.go - go build -x -o $@ $^ - -all: $(TARGETS) +all: + go install $(PACKAGES) clean: rm -v bin/* +env: + @echo GOPATH=$(GOPATH) + @echo PACKAGES=$(PACKAGES) + .PHONY: all clean diff --git a/gotime/src/channels.go b/gotime/src/gotour.meatballhat.com/channels/main.go similarity index 100% rename from gotime/src/channels.go rename to gotime/src/gotour.meatballhat.com/channels/main.go diff --git a/gotime/src/exercise-fibonacci-closure.go b/gotime/src/gotour.meatballhat.com/exercise-fibonacci-closure/main.go similarity index 100% rename from gotime/src/exercise-fibonacci-closure.go rename to gotime/src/gotour.meatballhat.com/exercise-fibonacci-closure/main.go diff --git a/gotime/src/exercise-http-handlers.go b/gotime/src/gotour.meatballhat.com/exercise-http-handlers/main.go similarity index 100% rename from gotime/src/exercise-http-handlers.go rename to gotime/src/gotour.meatballhat.com/exercise-http-handlers/main.go diff --git a/gotime/src/exercise-maps.go b/gotime/src/gotour.meatballhat.com/exercise-maps/main.go similarity index 100% rename from gotime/src/exercise-maps.go rename to gotime/src/gotour.meatballhat.com/exercise-maps/main.go diff --git a/gotime/src/exercise-slices.go b/gotime/src/gotour.meatballhat.com/exercise-slices/main.go similarity index 100% rename from gotime/src/exercise-slices.go rename to gotime/src/gotour.meatballhat.com/exercise-slices/main.go diff --git a/gotime/src/exercise-sqrt.go b/gotime/src/gotour.meatballhat.com/exercise-sqrt/main.go similarity index 100% rename from gotime/src/exercise-sqrt.go rename to gotime/src/gotour.meatballhat.com/exercise-sqrt/main.go diff --git a/gotime/src/goroutines.go b/gotime/src/gotour.meatballhat.com/goroutines/main.go similarity index 100% rename from gotime/src/goroutines.go rename to gotime/src/gotour.meatballhat.com/goroutines/main.go diff --git a/gotime/src/hello-web.go b/gotime/src/gotour.meatballhat.com/hello-web/main.go similarity index 100% rename from gotime/src/hello-web.go rename to gotime/src/gotour.meatballhat.com/hello-web/main.go diff --git a/gotime/src/maps.go b/gotime/src/gotour.meatballhat.com/maps/main.go similarity index 100% rename from gotime/src/maps.go rename to gotime/src/gotour.meatballhat.com/maps/main.go diff --git a/gotime/src/ranges.go b/gotime/src/gotour.meatballhat.com/ranges/main.go similarity index 100% rename from gotime/src/ranges.go rename to gotime/src/gotour.meatballhat.com/ranges/main.go