-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 785 Bytes
/
Makefile
File metadata and controls
33 lines (27 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
COMMIT_REVISION := $(shell git log --pretty=%h -1)
REVISION_FLAG := "-X github.com/kitko/commitizen-go/cmd.revision=${COMMIT_REVISION}"
TARGET := commitizen-go
GOFILES := $(wildcard *.go) $(wildcard cmd/*.go) $(wildcard git/*.go) $(wildcard commit/*.go)
ifeq ($(OS),Windows_NT)
GOOS := windows
COPY := copy
else
COPY := cp
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GOOS := linux
else ifeq ($(UNAME_S),Darwin)
GOOS := darwin
endif
endif
GIT_EXEC_PATH := $(shell git --exec-path)
all: ${TARGET}
install:
$(COPY) commitizen-go $(GIT_EXEC_PATH)/git-cz
install-hook:
commitizen-go install-hook
clean:
rm -rf ${TARGET}
commitizen-go: $(GOFILES)
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=amd64 go build -o $@ -ldflags ${REVISION_FLAG}
.PHONY: all install clean