From 87b76ecd8a43c41e43a741f1a19eac50c666a946 Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Mon, 21 Nov 2022 08:30:02 +0100 Subject: [PATCH] Make the Makefile functional --- Makefile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1bc2f29..14cd55f 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,27 @@ APPLICATION_NAME ?= dndmusicbot CURRENT_UID := $(shell id -u) +BIN := src/node_modules/.bin default: build -image: Dockerfile - docker build -t dndmusicbot-js-build . - touch .jsimage +PHONY: js image build -web: src/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 +js: src/public/script.js -build: *.go - go build \ No newline at end of file +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) \ No newline at end of file