34 lines
550 B
Makefile
34 lines
550 B
Makefile
|
.PHONY: all node-deps clean run
|
||
|
|
||
|
TARGET=elm.js
|
||
|
SOURCE=src/App.elm
|
||
|
|
||
|
ELM_FILES = $(shell find . -type f -name '*.elm')
|
||
|
NODE_BIN = ./node_modules/.bin
|
||
|
ELM-MAKE = $(NODE_BIN)/elm-make
|
||
|
ELM-REACTOR = $(NODE_BIN)/elm-reactor
|
||
|
|
||
|
ELMMAKE_FLAGS = --yes
|
||
|
ifeq ($(DEBUG),1)
|
||
|
ELMMAKE_FLAGS += --debug
|
||
|
endif
|
||
|
|
||
|
all: node-deps $(TARGET)
|
||
|
|
||
|
node-deps:
|
||
|
npm i
|
||
|
|
||
|
$(TARGET): $(ELM_FILES)
|
||
|
$(ELM-MAKE) $(ELMMAKE_FLAGS) $(SOURCE) --output $@
|
||
|
|
||
|
clean-deps:
|
||
|
rm -rf elm-stuff
|
||
|
rm -rf node_modules
|
||
|
|
||
|
clean:
|
||
|
rm -f $(TARGET)
|
||
|
rm -rf elm-stuff/build-artifacts
|
||
|
|
||
|
run: all
|
||
|
$(ELM-REACTOR)
|