generate-graphql: src/delivery/graphql/generated.go ui/lib/api/schema.graphql

src/delivery/graphql/generated.go: .gqlgen.yml cmd/generate-graphql/* $(shell find graphql -type f)
	go run cmd/generate-graphql/main.go

ui/lib/api/schema.graphql: src/delivery/graphql/* cmd/generate-graphql-schema/*
	go run cmd/generate-graphql-schema/main.go $@

bin/plugins/qittorrent-daemon.so:
	go build -o ./bin/plugins/qittorrent-daemon.so -buildmode=plugin git.kmsign.ru/royalcat/tstor/daemons/qbittorrent/plugin

bin/tstor:
	go build -o ./bin/tstor git.kmsign.ru/royalcat/tstor/cmd/tstor

run-debug: bin/tstor bin/plugins/qittorrent-daemon.so
	cd ./bin && ./tstor