2015-03-15 17:13:47 +03:00
|
|
|
#####################
|
|
|
|
|
2015-03-22 04:01:42 +03:00
|
|
|
SOURCES_BASE = src/step0_repl.erl src/step1_read_print.erl src/step2_eval.erl src/step3_env.erl \
|
|
|
|
src/step4_if_fn_do.erl
|
|
|
|
SOURCES_LISP = src/core.erl src/env.erl src/printer.erl src/reader.erl src/types.erl
|
2015-03-15 17:13:47 +03:00
|
|
|
SOURCES = $(SOURCES_BASE) $(word $(words $(SOURCES_LISP)),${SOURCES_LISP})
|
|
|
|
|
|
|
|
#####################
|
|
|
|
|
2015-03-22 04:01:42 +03:00
|
|
|
SRCS = step0_repl.erl step1_read_print.erl step2_eval.erl step3_env.erl step4_if_fn_do.erl
|
2015-03-15 17:13:47 +03:00
|
|
|
BINS = $(SRCS:%.erl=%)
|
|
|
|
|
|
|
|
#####################
|
|
|
|
|
2015-03-19 05:37:00 +03:00
|
|
|
.PHONY: all mal clean stats stats-lisp
|
|
|
|
|
2015-03-15 17:13:47 +03:00
|
|
|
all: $(BINS) mal
|
|
|
|
|
|
|
|
mal: $(word $(words $(BINS)),$(BINS))
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
define dep_template
|
2015-03-19 05:37:00 +03:00
|
|
|
.PHONY: $(1)
|
2015-03-15 17:13:47 +03:00
|
|
|
$(1): $(SOURCES_BASE) src/$(1).erl
|
|
|
|
MAL_STEP=$(1) rebar compile escriptize
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
|
|
|
|
|
|
|
|
clean:
|
2015-03-19 05:37:00 +03:00
|
|
|
rebar clean
|
2015-03-15 17:13:47 +03:00
|
|
|
|
|
|
|
stats: $(SOURCES)
|
|
|
|
@wc $^
|
|
|
|
stats-lisp: $(SOURCES_LISP)
|
|
|
|
@wc $^
|