2022-11-20 23:37:49 +00:00
|
|
|
APPLICATION_NAME ?= dndmusicbot
|
|
|
|
CURRENT_UID := $(shell id -u)
|
2022-11-21 07:30:02 +00:00
|
|
|
BIN := src/node_modules/.bin
|
2022-11-20 23:37:49 +00:00
|
|
|
|
|
|
|
default: build
|
|
|
|
|
2022-11-21 07:30:02 +00:00
|
|
|
PHONY: js image build
|
2022-11-20 23:37:49 +00:00
|
|
|
|
2022-11-21 07:30:02 +00:00
|
|
|
js: src/public/script.js
|
2022-11-20 23:37:49 +00:00
|
|
|
|
2022-11-21 07:30:02 +00:00
|
|
|
image: .jsimage
|
|
|
|
|
|
|
|
.jsimage: Dockerfile
|
|
|
|
@docker build -t dndmusicbot-js-build .
|
|
|
|
@touch .jsimage
|
|
|
|
|
|
|
|
src/yarn.lock: src/node_modules src/package.json
|
|
|
|
@docker run --rm --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build install --production=false --check-files
|
|
|
|
@touch -mr $(shell ls -Atd $? | head -1) $@
|
|
|
|
|
|
|
|
src/public/script.js: src/script.js src/yarn.lock
|
|
|
|
@docker run --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build build
|
|
|
|
|
|
|
|
$(APPLICATION_NAME): *.go ffmpeg/*.go speaker/*.go
|
|
|
|
@go build
|
|
|
|
|
|
|
|
build: image js $(APPLICATION_NAME)
|