37 lines
612 B
Makefile
37 lines
612 B
Makefile
.PHONY: all node-deps clean run
|
|
|
|
TARGET=extension/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
|
|
ELM-TEST = $(NODE_BIN)/elm-test
|
|
|
|
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)
|
|
|
|
test:
|
|
$(ELM-TEST)
|