Haxe: add C++, JS, Neko targets. Make neko default.
[jackhill/mal.git] / haxe / Makefile
1 STEP1_DEPS = Compat.hx types/Types.hx reader/Reader.hx printer/Printer.hx
2 STEP3_DEPS = $(STEP1_DEPS) env/Env.hx
3 STEP4_DEPS = $(STEP3_DEPS) core/Core.hx
4
5
6 # Neko target (neko)
7
8 s%.n: S%.hx
9 haxe -main $(patsubst %.hx,%,$<) -neko $@
10
11 step1_read_print.n step2_eval.n: $(STEP1_DEPS)
12 step3_env.n: $(STEP3_DEPS)
13 step4_if_fn_do.n step5_tco.n step6_file.n step7_quote.n step8_macros.n step9_try.n stepA_mal.n: $(STEP4_DEPS)
14
15
16 # Python 3 target (python)
17
18 s%.py: S%.hx
19 haxe -main $(patsubst %.hx,%,$<) -python $@
20
21 step1_read_print.py step2_eval.py: $(STEP1_DEPS)
22 step3_env.py: $(STEP3_DEPS)
23 step4_if_fn_do.py step5_tco.py step6_file.py step7_quote.py step8_macros.py step9_try.py stepA_mal.py: $(STEP4_DEPS)
24
25
26 # C++ target (cpp)
27
28 cpp/s%: S%.hx
29 haxe -main $(patsubst %.hx,%,$<) -cpp cpp
30 cp $(patsubst cpp/s%,cpp/S%,$@) $@
31
32 cpp/Step1_read_print cpp/Step2_eval: $(STEP1_DEPS)
33 cpp/Step3_env: $(STEP3_DEPS)
34 cpp/Step4_if_fn_do cpp/Step5_tco cpp/Step6_file cpp/Step7_quote cpp/Step8_macros cpp/Step9_try cpp/StepA_mal: $(STEP4_DEPS)
35
36
37 # JavaScript target (js)
38
39 s%.js: S%.hx
40 haxe -main $(patsubst %.hx,%,$<) -js $@
41
42 JS_DEPS = node_readline.js node_modules
43 step0_repl.js: $(JS_DEPS)
44 step1_read_print.js step2_eval.js: $(STEP1_DEPS) $(JS_DEPS)
45 step3_env.js: $(STEP3_DEPS) $(JS_DEPS)
46 step4_if_fn_do.js step5_tco.js step6_file.js step7_quote.js step8_macros.js step9_try.js stepA_mal.js: $(STEP4_DEPS) $(JS_DEPS)
47
48 node_modules:
49 npm install
50
51 ###
52
53 clean:
54 rm -r step*.py cpp/ step*.js step*.n