mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-25 13:48:49 +08:00
make Makefile visible
This commit is contained in:
parent
7d3c407aa7
commit
8316f3b917
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,5 @@ gomu
|
||||
music/
|
||||
message.log
|
||||
race.txt
|
||||
Makefile
|
||||
dist/
|
||||
bin/
|
||||
|
32
Makefile
Normal file
32
Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
.PHONY: test build
|
||||
|
||||
GIT_PATH=github.com/issadarkthing
|
||||
BIN_NAME=gomu
|
||||
REPO_NAME=gomu
|
||||
BIN_DIR := $(CURDIR)/bin
|
||||
INSTALL_DIR := $${HOME}/.local/bin
|
||||
VERSION := $(shell git describe --abbrev=0 --tags)
|
||||
GIT_COMMIT= $(shell git rev-parse HEAD)
|
||||
BUILD_DATE= $(shell date '+%Y-%m-%d-%H:%M:%S')
|
||||
GO = go
|
||||
|
||||
default: test build release
|
||||
|
||||
test:
|
||||
go test
|
||||
|
||||
$(BIN_DIR):
|
||||
@mkdir -p $@
|
||||
|
||||
$(INSTALL_DIR):
|
||||
@mkdir -p $@
|
||||
|
||||
build: $(BIN_DIR)
|
||||
${GO} build -v -o $(BIN_DIR)/$(BIN_NAME)
|
||||
|
||||
install: build $(INSTALL_DIR)
|
||||
cp ${BIN_DIR}/${BIN_NAME} ${INSTALL_DIR}/${BIN_NAME}
|
||||
|
||||
release: build
|
||||
mkdir -p dist
|
||||
tar czf dist/gomu-${VERSION}-amd64.tar.gz bin/${BIN_NAME}
|
Loading…
x
Reference in New Issue
Block a user