|
|
@ -6,6 +6,10 @@ else
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
GOBINARY ?= go
|
|
|
|
GOBINARY ?= go
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VERSION ?= $(shell git describe --exact-match HEAD &> /dev/null || echo vgit)
|
|
|
|
|
|
|
|
VERSION := $(shell echo $(VERSION) | sed 's/v//g')
|
|
|
|
|
|
|
|
COMMIT ?= $(shell git rev-parse --short HEAD || echo unknown)
|
|
|
|
|
|
|
|
|
|
|
|
npm:
|
|
|
|
npm:
|
|
|
|
$(info installing npm dependencies)
|
|
|
|
$(info installing npm dependencies)
|
|
|
|
npm install
|
|
|
|
npm install
|
|
|
@ -47,22 +51,19 @@ swagger:
|
|
|
|
$(GOBINARY) get github.com/swaggo/swag/cmd/swag
|
|
|
|
$(GOBINARY) get github.com/swaggo/swag/cmd/swag
|
|
|
|
swag init -g main.go
|
|
|
|
swag init -g main.go
|
|
|
|
|
|
|
|
|
|
|
|
version:
|
|
|
|
|
|
|
|
python3 scripts/version.py auto
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
compile:
|
|
|
|
compile:
|
|
|
|
$(info Downloading deps)
|
|
|
|
$(info Downloading deps)
|
|
|
|
$(GOBINARY) mod download
|
|
|
|
$(GOBINARY) mod download
|
|
|
|
$(info Building)
|
|
|
|
$(info Building)
|
|
|
|
mkdir -p build
|
|
|
|
mkdir -p build
|
|
|
|
cd build && CGO_ENABLED=0 $(GOBINARY) build -ldflags="-s -w" -o ./jfa-go ../*.go
|
|
|
|
cd build && CGO_ENABLED=0 $(GOBINARY) build -ldflags="-s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT)" -o ./jfa-go ../*.go
|
|
|
|
|
|
|
|
|
|
|
|
compile-debug:
|
|
|
|
compile-debug:
|
|
|
|
$(info Downloading deps)
|
|
|
|
$(info Downloading deps)
|
|
|
|
$(GOBINARY) mod download
|
|
|
|
$(GOBINARY) mod download
|
|
|
|
$(info Building)
|
|
|
|
$(info Building)
|
|
|
|
mkdir -p build
|
|
|
|
mkdir -p build
|
|
|
|
cd build && CGO_ENABLED=0 $(GOBINARY) build -o ./jfa-go ../*.go
|
|
|
|
cd build && CGO_ENABLED=0 $(GOBINARY) build -o ./jfa-go ../*.go -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT)"
|
|
|
|
|
|
|
|
|
|
|
|
compress:
|
|
|
|
compress:
|
|
|
|
upx --lzma build/jfa-go
|
|
|
|
upx --lzma build/jfa-go
|
|
|
@ -95,6 +96,6 @@ external-files:
|
|
|
|
install:
|
|
|
|
install:
|
|
|
|
cp -r build $(DESTDIR)/jfa-go
|
|
|
|
cp -r build $(DESTDIR)/jfa-go
|
|
|
|
|
|
|
|
|
|
|
|
all: configuration npm email version typescript bundle-css swagger copy internal-files compile
|
|
|
|
all: configuration npm email typescript bundle-css swagger copy internal-files compile
|
|
|
|
all-external: configuration npm email version typescript bundle-css swagger copy external-files compile
|
|
|
|
all-external: configuration npm email typescript bundle-css swagger copy external-files compile
|
|
|
|
debug: configuration npm email version ts-debug bundle-css swagger copy external-files compile-debug
|
|
|
|
debug: configuration npm email ts-debug bundle-css swagger copy external-files compile-debug
|
|
|
|