drasl/Makefile
IkyMax 09c9192cca
Authlib-Injector Skin API Support (#144)
* Initial support for Authlib-Injector Upload API

   - Support for HMCL

* Added Skin endpoint

* Support for capes

* Support for DELETE

* Explicitly route authlib-injector URLs, don't rewrite

* Test authlib-injector texture upload/delete

---------

Co-authored-by: Evan Goode <mail@evangoo.de>
2025-03-09 16:15:29 -04:00

35 lines
778 B
Makefile

prefix ?= /usr
.DEFAULT_GOAL := build
# TODO probably use `go tool` for this eventually
SWAG := $(shell command -v swag || echo 'go run github.com/swaggo/swag/cmd/swag@v1.16.4')
npm-install:
npm install
swag:
$(SWAG) init --generalInfo api.go --output . --outputTypes json
prebuild: npm-install swag
node esbuild.config.js
build: prebuild
export GOFLAGS='-buildmode=pie'
export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=3"
export CGO_LDFLAGS="-Wl,-z,relro,-z,now"
go build
install: build
install -Dm 755 drasl "$(prefix)/bin/drasl"
install -Dm 644 LICENSE "$(prefix)/share/licenses/drasl/LICENSE"
mkdir -p "$(prefix)/share/drasl/"
cp -R assets view public "$(prefix)/share/drasl/"
clean:
rm -f drasl
rm -f swagger.json
rm -f public/bundle.js
test: prebuild
go test