Skip to content

Commit

Permalink
Add rules to generate a thrift-gen release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Dijk committed Dec 30, 2015
1 parent dc07810 commit e766dac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.DS_Store
build
Godeps/_workspace
release/
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ EXAMPLES=./examples/bench/server ./examples/bench/client ./examples/ping ./examp
PKGS := . ./json ./hyperbahn ./thrift ./typed ./trace $(EXAMPLES)
TEST_ARG ?= -race
BUILD := ./build
RELEASE := ./release
RELEASE_LINUX := $(RELEASE)/linux-x86_64
RELEASE_DARWIN := $(RELEASE)/darwin-x86_64
SRCS := $(foreach pkg,$(PKGS),$(wildcard $(pkg)/*.go))
export GOPATH = $(GODEPS):$(OLDGOPATH)

Expand Down Expand Up @@ -32,6 +35,8 @@ packages_test:
setup:
mkdir -p $(BUILD)
mkdir -p $(BUILD)/examples
mkdir -p $(RELEASE_LINUX)
mkdir -p $(RELEASE_DARWIN)

get_thrift:
scripts/travis/get-thrift.sh
Expand All @@ -49,6 +54,7 @@ clean:
echo Cleaning build artifacts...
go clean
rm -rf $(BUILD)
rm -rf $(RELEASE)
echo

fmt format:
Expand Down Expand Up @@ -108,5 +114,11 @@ thrift_gen:
$(BUILD)/thrift-gen --generateThrift --inputFile hyperbahn/hyperbahn.thrift --outputDir hyperbahn/gen-go
rm -rf trace/thrift/gen-go/tcollector && $(BUILD)/thrift-gen --generateThrift --inputFile trace/tcollector.thrift --outputDir trace/thrift/gen-go/

release_thrift_gen: clean setup
GOOS=linux GOARCH=amd64 godep go build -o $(RELEASE_LINUX)/thrift-gen ./thrift/thrift-gen
GOOS=darwin GOARCH=amd64 godep go build -o $(RELEASE_DARWIN)/thrift-gen ./thrift/thrift-gen
tar -czf thrift-gen.tar.gz $(RELEASE)
mv thrift-gen.tar.gz $(RELEASE)/

.PHONY: all help clean fmt format get_thrift install install_ci packages_test test test_ci vet
.SILENT: all help clean fmt format test vet

0 comments on commit e766dac

Please sign in to comment.