1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/elm/Makefile

51 lines
1.4 KiB
Makefile
Raw Normal View History

2017-07-22 22:59:59 +03:00
SOURCES = step0_repl.elm step1_read_print.elm step2_eval.elm \
2017-06-25 11:59:09 +03:00
step3_env.elm step4_if_fn_do.elm step5_tco.elm step6_file.elm \
step7_quote.elm step8_macros.elm step9_try.elm stepA_mal.elm
2017-06-04 12:54:24 +03:00
2017-07-22 22:59:59 +03:00
SOURCES_LISP = Env.elm Core.elm Eval.elm stepA_mal.elm
2017-06-04 12:54:24 +03:00
BINS = $(SOURCES:%.elm=%.js)
2017-07-25 10:55:52 +03:00
ELM_MAKE = node_modules/.bin/elm-make
ELM_PACKAGE = node_modules/.bin/elm-package
2017-06-04 12:54:24 +03:00
all: node_modules elm_packages $(BINS)
2017-06-04 12:54:24 +03:00
node_modules:
npm install
2017-06-05 00:41:21 +03:00
elm_packages:
2017-07-25 10:55:52 +03:00
$(ELM_PACKAGE) install -y
2017-06-05 00:41:21 +03:00
%.js: %.elm node_modules elm_packages
2017-07-25 10:55:52 +03:00
$(ELM_MAKE) $(@:%.js=%.elm) --output $@
2017-06-04 12:54:24 +03:00
2017-06-20 18:23:00 +03:00
STEP0_SOURCES = IO.elm
STEP1_SOURCES = $(STEP0_SOURCES) Reader.elm Printer.elm Utils.elm Types.elm Env.elm
STEP2_SOURCES = $(STEP1_SOURCES)
STEP3_SOURCES = $(STEP2_SOURCES)
STEP4_SOURCES = $(STEP3_SOURCES) Core.elm Eval.elm
2017-06-25 11:59:09 +03:00
step0_repl.js: $(STEP0_SOURCES)
2017-06-20 18:23:00 +03:00
step1_read_print.js: $(STEP1_SOURCES)
2017-06-25 11:59:09 +03:00
step2_eval.js: $(STEP2_SOURCES)
step3_env.js: $(STEP3_SOURCES)
2017-06-20 18:23:00 +03:00
step4_if_fn_do.js: $(STEP4_SOURCES)
step5_tco.js: $(STEP4_SOURCES)
step6_file.js: $(STEP4_SOURCES)
step7_quote.js: $(STEP4_SOURCES)
step8_macros.js: $(STEP4_SOURCES)
step9_try.js: $(STEP4_SOURCES)
2017-06-23 17:56:04 +03:00
stepA_mal.js: $(STEP4_SOURCES)
2017-06-04 12:54:24 +03:00
clean:
rm -f $(BINS)
2017-07-22 22:59:59 +03:00
stats: $(STEP4_SOURCES) stepA_mal.elm
@wc $^
@printf "%5s %5s %5s %s\n" `egrep "^\w*(--|\{-|-\})|^\w*$$" $^ | wc` "[comments/blanks]"
2017-06-04 12:54:24 +03:00
2017-07-22 22:59:59 +03:00
stats-lisp: $(SOURCES_LISP)
@wc $^
@printf "%5s %5s %5s %s\n" `egrep "^\w*(--|\{-|-\})|^\w*$$" $^ | wc` "[comments/blanks]"