mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Added make-controlled version, gitCommit (thanks to https://preslav.me/2019/07/09/adding-version-information-to-go-binaries/
This commit is contained in:
parent
2087aab2d5
commit
06854f7a03
7 changed files with 31 additions and 15 deletions
15
Makefile
15
Makefile
|
@ -4,8 +4,10 @@
|
|||
MAKEOPTS = $(MAKEOPTS)
|
||||
#endif
|
||||
|
||||
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
||||
VERSION := 0.8.4
|
||||
#ifeq ($(BUILDOPTS),)
|
||||
BUILDOPTS = $(BUILDOPTS)
|
||||
BUILDOPTS :=$(BUILDOPTS)" -ldflags \"-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)\""
|
||||
#endif
|
||||
|
||||
SUBPKGS = logger spinsult hkexnet
|
||||
|
@ -24,27 +26,28 @@ clean:
|
|||
|
||||
subpkgs:
|
||||
for d in $(SUBPKGS); do\
|
||||
$(MAKE) -C $$d all;\
|
||||
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C $$d all;\
|
||||
done
|
||||
|
||||
tools:
|
||||
for d in $(TOOLS); do\
|
||||
$(MAKE) -C $$d all;\
|
||||
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C $$d all;\
|
||||
done
|
||||
|
||||
|
||||
common:
|
||||
go build .
|
||||
go install .
|
||||
|
||||
|
||||
client: common
|
||||
$(MAKE) -C hkexsh
|
||||
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C hkexsh
|
||||
|
||||
|
||||
ifeq ($(MSYSTEM),)
|
||||
ifneq ($(GOOS),windows)
|
||||
server: common
|
||||
$(MAKE) -C hkexshd
|
||||
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C hkexshd
|
||||
else
|
||||
echo "Cross-build of hkexshd server for Windows not yet supported"
|
||||
endif
|
||||
|
@ -55,7 +58,7 @@ endif
|
|||
|
||||
|
||||
passwd: common
|
||||
$(MAKE) -C hkexpasswd
|
||||
$(MAKE) BUILDOPTS=$(BUILDOPTS) -C hkexpasswd
|
||||
|
||||
vis:
|
||||
@which go-callvis >/dev/null 2>&1; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue