diff --git a/ui/app/Makefile b/ui/app/Makefile index ca8e45e3..4fb8cd09 100644 --- a/ui/app/Makefile +++ b/ui/app/Makefile @@ -1,7 +1,10 @@ ELM_FILES := $(shell find src -iname *.elm) DOCKER_IMG :=elm-env DOCKER_CMD := docker run --rm -t -v $(PWD):/app -w /app $(DOCKER_IMG) -TEMPFILE := $(shell mktemp ./elm-XXXXXXXXXX.js) +# macOS requires mktemp template to be at the end of the filename. +TEMPFILE := $(shell mktemp ./elm-XXXXXXXXXX) +# --output flag for elm make must end in .js or .html. +TEMPFILE_JS := "$(TEMPFILE).js" ifeq ($(NO_DOCKER), true) DOCKER_CMD= @@ -28,9 +31,9 @@ dev-server: script.js: elm-env format $(ELM_FILES) @echo ">> building script.js" - @$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE) - @$(DOCKER_CMD) uglifyjs $(TEMPFILE) --compress unused --mangle --output $(@) - @rm $(TEMPFILE) + @$(DOCKER_CMD) elm make src/Main.elm --yes --output $(TEMPFILE_JS) + @$(DOCKER_CMD) uglifyjs $(TEMPFILE_JS) --compress unused --mangle --output $(@) + @rm -rf $(TEMPFILE_JS) $(TEMPFILE) clean: - @rm script.js