emojinput/Makefile

41 lines
1.0 KiB
Makefile

ifeq ("$(ELM)","")
ELM=elm
endif
ifeq ("$(ELMLIVE)", "")
ELMLIVE=elm-live
endif
ifeq ("$(UGLIFYJS)", "")
UGLIFYJS=uglifyjs
endif
BUILD_DIR=js
dev: target/debug/elmojinput
release: target/release/elmojinput
js/main.js: elm/** elm/Emoji.elm
$(ELM) make elm/Main.elm --output $(BUILD_DIR)/main.js
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
js/main.tmp.js: elm/** elm/Emoji.elm
@$(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
js/emoji.txt:
@curl https://unicode.org/Public/emoji/14.0/emoji-test.txt -o $(BUILD_DIR)/emoji.txt
elm/Emoji.elm: js/emoji.txt extract.js
@node extract.js > elm/Emoji.elm
clean:
@rm -rf $(BUILD_DIR)/{main.js,main.min.js,emoji.txt} elm/Emoji.elm