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

38 lines
815 B
Makefile
Raw Normal View History

#####################
SOURCES_BASE = src/atom.erl src/printer.erl src/reader.erl
SOURCES_LISP = src/core.erl src/env.erl src/types.erl src/stepA_mal.erl
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
#####################
SRCS = step0_repl.erl step1_read_print.erl step2_eval.erl step3_env.erl step4_if_fn_do.erl \
step5_tco.erl step6_file.erl step7_quote.erl step8_macros.erl step9_try.erl stepA_mal.erl
BINS = $(SRCS:%.erl=%)
#####################
.PHONY: all dist clean
2016-02-15 05:57:31 +03:00
all: $(BINS)
dist: mal
mal: $(SOURCES)
sed 's/stepA_mal/mal/' src/stepA_mal.erl > src/mal.erl
MAL_STEP=mal rebar compile escriptize
rm src/mal.erl
define dep_template
.PHONY: $(1)
$(1): src/$(1).erl
MAL_STEP=$(1) rebar compile escriptize
endef
$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
clean:
rebar clean
rm -f mal