Skip to content

Commit

Permalink
Merge branch 'patch-makefile' of https://github.com/AkiaCode/yorkie i…
Browse files Browse the repository at this point in the history
…nto AkiaCode-patch-makefile
  • Loading branch information
hackerwins committed Jan 24, 2022
2 parents 9cebac7 + 2dc413a commit 9f80b53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
YORKIE_VERSION := 0.2.2

GIT_COMMIT := $(shell git rev-parse --short HEAD)
BUILD_DATE := $(shell date "+%Y-%m-%d")
GO_PROJECT = github.com/yorkie-team/yorkie
GO_SRC := $(shell find . -path ./vendor -prune -o -type f -name '*.go' -print)

ifeq ($(OS),Windows_NT)
BUILD_DATE := $(shell echo %date:~6,4%-%date:~0,2%-%date:~3,2%)
GO_SRC := $(shell dir /s /b *.go | findstr /v "vendor")
EXECUTABLE = ./bin/yorkie.exe
else
BUILD_DATE := $(shell date "+%Y-%m-%d")
GO_SRC := $(shell find . -path ./vendor -prune -o -type f -name '*.go' -print)
EXECUTABLE = ./bin/yorkie
endif

# inject the version number into the golang version package using the -X linker flag
GO_LDFLAGS ?=
GO_LDFLAGS += -X ${GO_PROJECT}/internal/version.GitCommit=${GIT_COMMIT}
GO_LDFLAGS += -X ${GO_PROJECT}/internal/version.Version=${YORKIE_VERSION}
GO_LDFLAGS += -X ${GO_PROJECT}/internal/version.BuildDate=${BUILD_DATE}

EXECUTABLE = ./bin/yorkie

tools:
go generate -tags tools tools/tools.go

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Next, clone this repository into some local directory and then just type `make b
```
$ make build
...
$ bin/yorkie
$ bin/yorkie # (If you are a Windows user, run .\bin\yorkie.exe)
```

> We need to install Golang packages to build Yorkie locally. You can run `make tools` to install the required packages.
Expand Down

0 comments on commit 9f80b53

Please sign in to comment.