Commit 58f62497 authored by Dmitry Mozzherin's avatar Dmitry Mozzherin
Browse files

fix Makefile

parent 74b95f5b
......@@ -6,3 +6,5 @@ version.go
200k-lines.txt
test_data.new.txt
.idea
assets_vfsdata.go
gnparser.pb.go
GOCMD=go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOGET=$(GOCMD) get -u
FLAG_MODULE=GO111MODULE=on
FLAGS_SHARED=${FLAG_MODULE} CGO_ENABLED=0 GOARCH=amd64
FLAGS_LINUX=${FLAGS_SHARED} GOOS=linux
FLAGS_MAC=${FLAGS_SHARED} GOOS=darwin
FLAGS_WIN=${FLAGS_SHARED} GOOS=windows
GOCMD = go
GOBUILD = $(GOCMD) build
GOINSTALL = $(GOCMD) install
GOCLEAN = $(GOCMD) clean
GOGET = $(GOCMD) get -u
FLAG_MODULE = GO111MODULE=on
FLAGS_SHARED = $(FLAG_MODULE) CGO_ENABLED=0 GOARCH=amd64
FLAGS_LINUX = $(FLAGS_SHARED) GOOS=linux
FLAGS_MAC = $(FLAGS_SHARED) GOOS=darwin
FLAGS_WIN = $(FLAGS_SHARED) GOOS=windows
VERSION=`git describe --tags`
VER=`git describe --tags --abbrev=0`
DATE=`date -u '+%Y-%m-%d_%H:%M:%S%Z'`
VERSION = $(shell git describe --tags)
VER = $(shell git describe --tags --abbrev=0)
DATE = $(shell date -u '+%Y-%m-%d_%H:%M:%S%Z')
all: install
test:
${FLAG_MODULE} go test ./...
$(FLAG_MODULE) go test ./...
init:
${FLAG_MODULE} $(GOGET) github.com/pointlander/peg@fa48cc2; \
${FLAG_MODULE} $(GOGET) github.com/shurcooL/vfsgen@6a9ea43; \
${FLAG_MODULE} $(GOGET) github.com/spf13/cobra/cobra@7547e83; \
${FLAG_MODULE} $(GOGET) github.com/onsi/ginkgo/ginkgo@505cc35; \
${FLAG_MODULE} $(GOGET) github.com/onsi/gomega@ce690c5; \
${FLAG_MODULE} $(GOGET) golang.org/x/tools/cmd/goimports
deps:
$(FLAG_MODULE) $(GOGET) github.com/pointlander/peg@fa48cc2; \
$(FLAG_MODULE) $(GOGET) github.com/shurcooL/vfsgen@6a9ea43; \
$(FLAG_MODULE) $(GOGET) github.com/spf13/cobra/cobra@7547e83; \
$(FLAG_MODULE) $(GOGET) github.com/onsi/ginkgo/ginkgo@505cc35; \
$(FLAG_MODULE) $(GOGET) github.com/onsi/gomega@ce690c5; \
$(FLAG_MODULE) $(GOGET) golang.org/x/tools/cmd/goimports
version:
echo "package output\n\nconst Version = \"$(VERSION)\"\nconst Build = \"$(DATE)\"\n" \
......@@ -37,33 +37,32 @@ peg:
asset:
cd dict; \
go run -tags=dev assets_gen.go
$(FLAGS_SHARED) go run -tags=dev assets_gen.go
build: version peg grpc
build: version peg grpc asset
cd gnparser; \
$(GOCLEAN); \
${FLAGS_SHARED} $(GOBUILD)
$(FLAGS_SHARED) $(GOBUILD)
install: version peg grpc
install: version peg grpc asset
cd gnparser; \
$(GOCLEAN); \
${FLAGS_SHARED} $(GOINSTALL)
$(FLAGS_SHARED) $(GOINSTALL)
release: version peg grpc asset
cd gnparser; \
$(GOCLEAN); \
${FLAGS_LINUX} $(GOBUILD) ${LDFLAGS}; \
tar zcvf /tmp/parser-${VER}-linux.tar.gz gnparser; \
$(FLAGS_LINUX) $(GOBUILD); \
tar zcf /tmp/gnparser-$(VER)-linux.tar.gz gnparser; \
$(GOCLEAN); \
${FLAGS_WIN} $(GOBUILD) ${LDFLAGS}; \
tar zcvf /tmp/gnparser-${VER}-mac.tar.gz gnparser; \
$(FLAGS_MAC) $(GOBUILD); \
tar zcf /tmp/gnparser-$(VER)-mac.tar.gz gnparser; \
$(GOCLEAN); \
${FLAGS_WIN} $(GOBUILD) ${LDFLAGS}; \
zip -9 /tmp/gnparser-${VER}-win-64.zip gnparser; \
$(FLAGS_WIN) $(GOBUILD); \
zip -9 /tmp/gnparser-$(VER)-win-64.zip gnparser.exe; \
$(GOCLEAN);
.PHONY:grpc
grpc:
cd grpc; \
protoc -I . ./gnparser.proto --go_out=plugins=grpc:.;
.PHONY: grpc
This diff is collapsed.
......@@ -3,6 +3,7 @@ module gitlab.com/gogna/gnparser
require (
github.com/gnames/uuid5 v0.1.1
github.com/golang/protobuf v1.2.0
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.5
github.com/mitchellh/go-homedir v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
......@@ -19,9 +20,9 @@ require (
github.com/spf13/viper v1.3.1 // indirect
golang.org/x/net v0.0.0-20190110200230-915654e7eabc
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
golang.org/x/sys v0.0.0-20190114130336-2be517255631 // indirect
golang.org/x/sys v0.0.0-20190115152922-a457fd036447 // indirect
golang.org/x/text v0.3.0
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b // indirect
golang.org/x/tools v0.0.0-20190116002428-2e4132e53b93 // indirect
google.golang.org/grpc v1.17.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
......@@ -19,6 +19,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
......@@ -95,12 +97,16 @@ golang.org/x/sys v0.0.0-20190109145017-48ac38b7c8cb h1:1w588/yEchbPNpa9sEvOcMZYb
golang.org/x/sys v0.0.0-20190109145017-48ac38b7c8cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190114130336-2be517255631 h1:g/5trXm6f9Tm+ochb21RlFNnF63lt+elB9hVBqtPu5Y=
golang.org/x/sys v0.0.0-20190114130336-2be517255631/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190115152922-a457fd036447 h1:YvSRfc0ZOWA3mVMyiDFA+p3qibhSiJeRqjvuO15WQJw=
golang.org/x/sys v0.0.0-20190115152922-a457fd036447/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114164648-36f37f8f5c81/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b h1:qMK98NmNCRVDIYFycQ5yVRkvgDUFfdP8Ip4KqmDEB7g=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190116002428-2e4132e53b93 h1:SYiIcPVdcmdmy24ci5s8I4kx1h+vPqnTDvbu3iG9seI=
golang.org/x/tools v0.0.0-20190116002428-2e4132e53b93/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment