Merge branch 'Haxe'
[jackhill/mal.git] / erlang / Makefile
CommitLineData
2cc3804b
NF
1#####################
2
fc4c7889
JM
3SOURCES_BASE = src/atom.erl src/printer.erl src/reader.erl
4SOURCES_LISP = src/core.erl src/env.erl src/types.erl src/stepA_mal.erl
5SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
2cc3804b
NF
6
7#####################
8
77db07c9 9SRCS = step0_repl.erl step1_read_print.erl step2_eval.erl step3_env.erl step4_if_fn_do.erl \
78c05994 10 step5_tco.erl step6_file.erl step7_quote.erl step8_macros.erl step9_try.erl stepA_mal.erl
2cc3804b
NF
11BINS = $(SRCS:%.erl=%)
12
13#####################
14
583a62df
NF
15.PHONY: all mal clean stats stats-lisp
16
2cc3804b
NF
17all: $(BINS) mal
18
19mal: $(word $(words $(BINS)),$(BINS))
20 cp $< $@
21
22define dep_template
583a62df 23.PHONY: $(1)
fc4c7889 24$(1): src/$(1).erl
2cc3804b
NF
25 MAL_STEP=$(1) rebar compile escriptize
26endef
27
28$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
29
30clean:
583a62df 31 rebar clean
2cc3804b
NF
32
33stats: $(SOURCES)
34 @wc $^
f15b4021 35 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*%|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
2cc3804b
NF
36stats-lisp: $(SOURCES_LISP)
37 @wc $^
f15b4021 38 @printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*%|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"