2017-08-07 19:04:55 +00:00
|
|
|
.PHONY: all node-deps clean run
|
2017-07-19 02:13:27 +00:00
|
|
|
|
2018-04-02 14:17:49 +00:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
|
|
|
|
|
2017-08-07 19:04:55 +00:00
|
|
|
TARGET = js/riichi.js
|
|
|
|
SOURCE = src/Riichi.elm
|
|
|
|
CSS = css/riichi.css
|
|
|
|
CSS_SOURCE = src/Stylesheets.elm
|
|
|
|
|
|
|
|
ELM_FILES = $(shell find . -type f -name '*.elm')
|
2018-04-02 14:17:49 +00:00
|
|
|
NODE_PATH := $(abspath ./node_modules/.bin)
|
|
|
|
ELM-MAKE := $(NODE_PATH)/elm-make
|
|
|
|
ELM-REACTOR := $(NODE_PATH)/elm-reactor
|
|
|
|
ELM-TEST := $(NODE_PATH)/elm-test
|
|
|
|
ELM-CSS := $(NODE_PATH)/elm-css
|
2017-08-07 19:04:55 +00:00
|
|
|
|
|
|
|
ELMMAKE_FLAGS = --yes --warn
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
ELMMAKE_FLAGS += --debug
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: node-deps $(TARGET) $(CSS)
|
|
|
|
|
|
|
|
node-deps:
|
|
|
|
npm i
|
|
|
|
|
|
|
|
$(TARGET): $(ELM_FILES)
|
2018-04-02 14:17:49 +00:00
|
|
|
$(ELM-MAKE) $(ELMMAKE_FLAGS) src/Riichi.elm --output=$@
|
2017-08-07 19:04:55 +00:00
|
|
|
|
|
|
|
$(CSS): $(CSS_SOURCE)
|
2018-04-02 14:17:49 +00:00
|
|
|
@PATH=$(NODE_PATH):$(PATH) $(ELM-CSS) $(CSS_SOURCE) -o css
|
2017-08-07 19:04:55 +00:00
|
|
|
|
|
|
|
clean-deps:
|
|
|
|
rm -rf elm-stuff
|
|
|
|
rm -rf node_modules
|
2017-07-19 02:13:27 +00:00
|
|
|
|
2018-04-02 14:17:49 +00:00
|
|
|
test:
|
|
|
|
@PATH=$(NODE_PATH):$(PATH) $(ELM-TEST)
|
|
|
|
|
2017-07-19 02:13:27 +00:00
|
|
|
clean:
|
2017-08-07 19:04:55 +00:00
|
|
|
rm -f $(TARGET) $(CSS)
|
|
|
|
rm -rf elm-stuff/build-artifacts
|
|
|
|
|
|
|
|
run: all
|
2018-04-02 14:17:49 +00:00
|
|
|
$(ELM-REACTOR)
|
|
|
|
|