2022-02-04 17:01:04 +00:00
|
|
|
ifeq ("$(ELM)","")
|
|
|
|
ELM=elm
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ("$(ELMLIVE)", "")
|
|
|
|
ELMLIVE=elm-live
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ("$(UGLIFYJS)", "")
|
|
|
|
UGLIFYJS=uglifyjs
|
|
|
|
endif
|
|
|
|
|
|
|
|
BUILD_DIR=js
|
|
|
|
|
2022-02-05 20:05:41 +00:00
|
|
|
dev: target/debug/elmojinput
|
|
|
|
release: target/release/elmojinput
|
2022-02-04 17:01:04 +00:00
|
|
|
|
2022-02-19 12:59:43 +00:00
|
|
|
js/main.js: elm/** elm/Emoji.elm
|
2022-02-05 20:05:41 +00:00
|
|
|
$(ELM) make elm/Main.elm --output $(BUILD_DIR)/main.js
|
2022-02-04 17:01:04 +00:00
|
|
|
|
|
|
|
js/main.min.js: js/main.tmp.js
|
|
|
|
@$(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
|
|
|
|
|
2022-02-19 12:59:43 +00:00
|
|
|
js/main.tmp.js: elm/** elm/Emoji.elm
|
2022-02-05 20:05:41 +00:00
|
|
|
@$(ELM) make elm/Main.elm --optimize --output $(BUILD_DIR)/main.tmp.js
|
|
|
|
|
|
|
|
target/debug/elmojinput: js/main.js src/**
|
|
|
|
cargo build
|
|
|
|
|
|
|
|
target/release/elmojinput: js/main.min.js src/**
|
|
|
|
cargo build --release
|
2022-02-04 17:01:04 +00:00
|
|
|
|
2022-02-21 20:11:31 +00:00
|
|
|
js/emoji.html:
|
|
|
|
@curl https://unicode.org/emoji/charts/emoji-list.html -o $(BUILD_DIR)/emoji.html
|
2022-02-19 12:59:43 +00:00
|
|
|
|
2022-02-21 20:11:31 +00:00
|
|
|
elm/Emoji.elm: js/emoji.html extract.js
|
2022-02-19 12:59:43 +00:00
|
|
|
@node extract.js > elm/Emoji.elm
|
|
|
|
|
2022-02-04 17:01:04 +00:00
|
|
|
clean:
|
2022-02-21 20:11:31 +00:00
|
|
|
@rm -rf $(BUILD_DIR)/{main.js,main.min.js,emoji.html} elm/Emoji.elm
|