DISABLE FDs (REMOVE ME).
[jackhill/mal.git] / erlang / Makefile
1 #####################
2
3 SOURCES_BASE = src/atom.erl src/printer.erl src/reader.erl
4 SOURCES_LISP = src/core.erl src/env.erl src/types.erl src/stepA_mal.erl
5 SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
6
7 #####################
8
9 SRCS = step0_repl.erl step1_read_print.erl step2_eval.erl step3_env.erl step4_if_fn_do.erl \
10 step5_tco.erl step6_file.erl step7_quote.erl step8_macros.erl step9_try.erl stepA_mal.erl
11 BINS = $(SRCS:%.erl=%)
12
13 #####################
14
15 .PHONY: all dist clean
16
17 all: $(BINS)
18
19 dist: mal
20
21 mal: $(SOURCES)
22 sed 's/stepA_mal/mal/' src/stepA_mal.erl > src/mal.erl
23 MAL_STEP=mal rebar compile escriptize
24 rm src/mal.erl
25
26
27 define dep_template
28 .PHONY: $(1)
29 $(1): src/$(1).erl
30 MAL_STEP=$(1) rebar compile escriptize
31 endef
32
33 $(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
34
35 clean:
36 rebar clean
37 rm -f mal