1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

remove ts-debug

This commit is contained in:
Harvey Tindall 2021-04-01 14:33:57 +01:00
parent e16f05b130
commit dbe7e2e659
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -18,22 +18,26 @@ else ifneq ($(UPDATER), off)
LDFLAGS := $(LDFLAGS) -X main.updater=$(UPDATER) LDFLAGS := $(LDFLAGS) -X main.updater=$(UPDATER)
endif endif
DEBUG ?= off
ifeq ($(DEBUG), on)
LDFLAGS := -s -w $(LDFLAGS)
endif
INTERNAL ?= on INTERNAL ?= on
ifeq ($(INTERNAL), on) ifeq ($(INTERNAL), on)
# GOFILES := $(addprefix ../,$(filter-out external.go, $(wildcard *.go)))
TAGS := TAGS :=
DATA := data DATA := data
else else
# GOFILES := $(addprefix ../,$(filter-out internal.go, $(wildcard *.go)))
DATA := build/data DATA := build/data
TAGS := -tags external TAGS := -tags external
endif endif
DEBUG ?= off
ifeq ($(DEBUG), on)
LDFLAGS := -s -w $(LDFLAGS)
SOURCEMAP := --sourcemap
# jank
COPYTS := rm -r $(DATA)/web/js/ts; cp -r ts $(DATA)/web/js
else
SOURCEMAP :=
COPYTS :=
endif
npm: npm:
$(info installing npm dependencies) $(info installing npm dependencies)
npm install npm install
@ -57,21 +61,11 @@ email:
typescript: typescript:
$(info compiling typescript) $(info compiling typescript)
-mkdir -p $(DATA)/web/js -mkdir -p $(DATA)/web/js
-$(ESBUILD) --bundle ts/admin.ts --outfile=./$(DATA)/web/js/admin.js --minify -$(ESBUILD) --bundle ts/admin.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/admin.js --minify
-$(ESBUILD) --bundle ts/pwr.ts --outfile=./$(DATA)/web/js/pwr.js --minify -$(ESBUILD) --bundle ts/pwr.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/pwr.js --minify
-$(ESBUILD) --bundle ts/form.ts --outfile=./$(DATA)/web/js/form.js --minify -$(ESBUILD) --bundle ts/form.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/form.js --minify
-$(ESBUILD) --bundle ts/setup.ts --outfile=./$(DATA)/web/js/setup.js --minify -$(ESBUILD) --bundle ts/setup.ts $(SOURCEMAP) --outfile=./$(DATA)/web/js/setup.js --minify
$(COPYTS)
ts-debug:
$(info compiling typescript w/ sourcemaps)
-mkdir -p $(DATA)/web/js
-$(ESBUILD) --bundle ts/admin.ts --sourcemap --outfile=./$(DATA)/web/js/admin.js
-$(ESBUILD) --bundle ts/pwr.ts --sourcemap --outfile=./$(DATA)/web/js/pwr.js
-$(ESBUILD) --bundle ts/form.ts --sourcemap --outfile=./$(DATA)/web/js/form.js
-$(ESBUILD) --bundle ts/setup.ts --sourcemap --outfile=./$(DATA)/web/js/setup.js
-rm -r $(DATA)/web/js/ts
$(info copying typescript)
cp -r ts $(DATA)/web/js
swagger: swagger:
$(GOBINARY) get github.com/swaggo/swag/cmd/swag $(GOBINARY) get github.com/swaggo/swag/cmd/swag
@ -82,7 +76,6 @@ compile:
$(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 $(LDFLAGS)" -o ./jfa-go ../*.go
CGO_ENABLED=0 $(GOBINARY) build -ldflags="-s -w $(LDFLAGS)" $(TAGS) -o build/jfa-go CGO_ENABLED=0 $(GOBINARY) build -ldflags="-s -w $(LDFLAGS)" $(TAGS) -o build/jfa-go
compress: compress: