dndmusicbot/Makefile

37 lines
795 B
Makefile
Raw Permalink Normal View History

2022-11-21 08:09:01 +00:00
.DEFAULT_GOAL := build
APPLICATION_NAME ?= dndmusicbot
CURRENT_UID := $(shell id -u)
2022-11-21 07:30:02 +00:00
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
2022-11-21 07:30:02 +00:00
image: .jsimage
.jsimage: Dockerfile
@docker build -t dndmusicbot-js-build .
@touch .jsimage
src/node_modules:
mkdir -p $@
public:
mkdir -p $@
src/yarn.lock: public src/node_modules src/package.json
$(YARN)
2022-11-21 07:30:02 +00:00
@touch -mr $(shell ls -Atd $? | head -1) $@
public/script.js: src/script.js src/yarn.lock
$(YARN) build
2022-11-21 07:30:02 +00:00
$(APPLICATION_NAME): *.go ffmpeg/*.go speaker/*.go go.mod go.sum
2022-11-21 07:30:02 +00:00
@go build
2022-11-21 08:09:01 +00:00
build: image js $(APPLICATION_NAME)
clean:
rm -r public/* src/node_modules .jsimage $(APPLICATION_NAME)