elm-twitch/Makefile

37 lines
782 B
Makefile
Raw Normal View History

2020-10-03 18:44:16 +02:00
ifeq ("$(ELM)","")
ELM=elm
endif
ifeq ("$(ELMLIVE)", "")
ELMLIVE=elm-live
endif
ifeq ("$(UGLIFYJS)", "")
UGLIFYJS=uglifyjs
endif
BUILD_DIR=js
2020-10-04 21:48:37 +02:00
all: dev
2020-10-03 18:44:16 +02:00
2020-10-04 22:00:36 +02:00
dev: js/main.js
release: js/main.min.js
2021-06-21 16:07:55 +02:00
js/main.js: src/** elm-video/src/**
2020-10-03 18:44:16 +02:00
$(ELM) make src/Main.elm --output $(BUILD_DIR)/main.js
2020-10-04 22:00:36 +02:00
js/main.min.js: js/main.tmp.js
2020-10-04 21:48:37 +02:00
@$(UGLIFYJS) $(BUILD_DIR)/main.tmp.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle > $(BUILD_DIR)/main.min.js
2020-10-03 18:44:16 +02:00
2021-07-02 10:23:30 +02:00
js/main.tmp.js: src/** elm-video/src/**
2020-10-04 22:00:36 +02:00
@$(ELM) make src/Main.elm --optimize --output $(BUILD_DIR)/main.tmp.js
2020-10-04 21:48:37 +02:00
watch:
2020-10-03 18:44:16 +02:00
@$(ELMLIVE) src/Main.elm -p 7000 -d . -- --output $(BUILD_DIR)/main.js
2020-10-04 21:48:37 +02:00
clean:
2020-10-04 22:00:36 +02:00
@rm -rf $(BUILD_DIR)/{main.js,main.min.js}
2020-10-03 18:44:16 +02:00