Skip to content

Commit

Permalink
[main] changed version string; [make] pkgrelease for easy cross-building
Browse files Browse the repository at this point in the history
  • Loading branch information
Unbewohnte committed Nov 16, 2021
1 parent 09e3c7b commit 502877c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
29 changes: 25 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,35 @@
SRC_DIR := src/
EXE_NAME := ftu
INSTALLATION_DIR := /usr/local/bin/
RELEASE_DIR := release
LICENSE_FILE := COPYING
INSTALLATION_SCRIPT := install.sh

all:
cd $(SRC_DIR) && go build && mv $(EXE_NAME) ..

cross:
cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ftu_linux_amd64 && mv ftu_linux_amd64 ..
cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ftu_darwin_amd64 && mv ftu_darwin_amd64 ..
cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ftu_windows_amd64.exe && mv ftu_windows_amd64.exe ..
pkgrelease:
rm -rf $(RELEASE_DIR)

mkdir $(RELEASE_DIR)
mkdir $(RELEASE_DIR)/linux_amd64
mkdir $(RELEASE_DIR)/darwin_amd64
mkdir $(RELEASE_DIR)/windows_amd64

cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ftu_linux_amd64 && mv ftu_linux_amd64 ../$(RELEASE_DIR)/linux_amd64
cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ftu_darwin_amd64 && mv ftu_darwin_amd64 ../$(RELEASE_DIR)/darwin_amd64
cd $(SRC_DIR) && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ftu_windows_amd64.exe && mv ftu_windows_amd64.exe ../$(RELEASE_DIR)/windows_amd64

cp $(LICENSE_FILE) $(RELEASE_DIR)/linux_amd64
cp $(INSTALLATION_SCRIPT) $(RELEASE_DIR)/linux_amd64

cp $(LICENSE_FILE) $(RELEASE_DIR)/darwin_amd64
cp $(LICENSE_FILE) $(RELEASE_DIR)/windows_amd64

cd $(RELEASE_DIR) && zip -r linux_amd64 linux_amd64/
cd $(RELEASE_DIR) && zip -r darwin_amd64 darwin_amd64/
cd $(RELEASE_DIR) && zip -r windows_amd64 windows_amd64/


race:
cd $(SRC_DIR) && go build -race && mv $(EXE_NAME) ..
Expand Down
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

var (
VERSION string = "v2.1.0"
VERSION string = "v2.1.1"

versionInformation string = fmt.Sprintf("ftu %s\n\nCopyright (C) 2021 Kasyanov Nikolay Alexeevich (Unbewohnte (https://unbewohnte.xyz/))\nThis program comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it under certain conditions; type \"ftu -l\" for details.\n", VERSION)

Expand Down

0 comments on commit 502877c

Please sign in to comment.