2012-11-10 18:41:02 +00:00
|
|
|
CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":")
|
|
|
|
GOPATH := $(PWD):$(CLEAN_GOPATH)
|
2012-11-06 01:36:27 +00:00
|
|
|
PACKAGES := $(foreach pkg,\
|
2012-11-06 01:59:42 +00:00
|
|
|
$(shell ls src/meatballhat.com/gotour-artifacts),\
|
|
|
|
$(patsubst %,meatballhat.com/gotour-artifacts/%,$(pkg))\
|
2012-11-06 01:36:27 +00:00
|
|
|
)
|
2012-11-11 01:27:23 +00:00
|
|
|
PACKAGES += $(foreach pkg,\
|
|
|
|
$(shell ls src/meatballhat.com/junkdrawer),\
|
|
|
|
$(patsubst %,meatballhat.com/junkdrawer/%,$(pkg))\
|
|
|
|
)
|
2012-11-10 23:47:32 +00:00
|
|
|
PACKAGES += meatballhat.com/amqpfun-runner
|
2012-08-26 01:08:08 +00:00
|
|
|
|
2012-11-10 18:41:02 +00:00
|
|
|
test: build
|
|
|
|
go test $(PACKAGES)
|
|
|
|
|
2012-11-10 23:47:32 +00:00
|
|
|
build: deps
|
2012-11-06 01:36:27 +00:00
|
|
|
go install $(PACKAGES)
|
2012-08-26 01:08:08 +00:00
|
|
|
|
2012-11-06 01:59:42 +00:00
|
|
|
fmt:
|
|
|
|
go fmt $(PACKAGES)
|
|
|
|
|
2012-11-10 18:41:02 +00:00
|
|
|
deps:
|
|
|
|
go list -f '{{range .Imports}}{{.}} {{end}}' $(PACKAGES) | xargs go get
|
|
|
|
|
2012-08-26 01:08:08 +00:00
|
|
|
clean:
|
|
|
|
rm -v bin/*
|
|
|
|
|
2012-11-06 01:59:42 +00:00
|
|
|
publish:
|
|
|
|
rsync -avz src/meatballhat.com/gotour-artifacts mbh:meatballhat.com/docroot/
|
|
|
|
ssh mbh "find meatballhat.com/docroot/gotour-artifacts -type d -exec chmod 755 {} \; && find meatballhat.com/docroot/gotour-artifacts/ -type f -exec chmod 644 {} \;"
|
|
|
|
|
2012-11-06 01:36:27 +00:00
|
|
|
env:
|
|
|
|
@echo GOPATH=$(GOPATH)
|
|
|
|
@echo PACKAGES=$(PACKAGES)
|
|
|
|
|
2012-11-10 18:41:02 +00:00
|
|
|
.PHONY: test build clean publish env fmt
|