dndmusicbot/Makefile

27 lines
706 B
Makefile

APPLICATION_NAME ?= dndmusicbot
CURRENT_UID := $(shell id -u)
BIN := src/node_modules/.bin
default: build
PHONY: js image build
js: src/public/script.js
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)