.DEFAULT_GOAL := build APPLICATION_NAME ?= dndmusicbot CURRENT_UID := $(shell id -u) BIN := src/node_modules/.bin YARN = docker run --rm --user $(CURRENT_UID) -v $(CURDIR)/src:/app -v $(CURDIR)/public:/public dndmusicbot-js-build PHONY: js image build clean js: image public/script.js image: .jsimage .jsimage: Dockerfile @docker build -t dndmusicbot-js-build . @touch .jsimage src/node_modules: mkdir -p $@ src/yarn.lock: src/node_modules src/package.json $(YARN) @touch -mr $(shell ls -Atd $? | head -1) $@ public/script.js: src/script.js src/yarn.lock $(YARN) build $(APPLICATION_NAME): *.go ffmpeg/*.go speaker/*.go @go build build: image js $(APPLICATION_NAME) clean: rm -r public/* src/node_modules .jsimage $(APPLICATION_NAME)