Make the Makefile functional
parent
27032d75a5
commit
87b76ecd8a
28
Makefile
28
Makefile
|
@ -1,15 +1,27 @@
|
||||||
APPLICATION_NAME ?= dndmusicbot
|
APPLICATION_NAME ?= dndmusicbot
|
||||||
CURRENT_UID := $(shell id -u)
|
CURRENT_UID := $(shell id -u)
|
||||||
|
BIN := src/node_modules/.bin
|
||||||
|
|
||||||
default: build
|
default: build
|
||||||
|
|
||||||
image: Dockerfile
|
PHONY: js image build
|
||||||
docker build -t dndmusicbot-js-build .
|
|
||||||
touch .jsimage
|
|
||||||
|
|
||||||
web: src/script.js
|
js: src/public/script.js
|
||||||
docker run --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build install
|
|
||||||
docker run --user $(CURRENT_UID) -v $(CURDIR)/src:/app dndmusicbot-js-build build
|
|
||||||
|
|
||||||
build: *.go
|
image: .jsimage
|
||||||
go build
|
|
||||||
|
.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)
|
Loading…
Reference in New Issue