aboutsummaryrefslogtreecommitdiff
path: root/rust/Makefile
blob: da8a6c610617d002f6f6203b59206240ba1a9a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#####################

SOURCES_BASE = src/types.rs src/readline.rs \
	       src/reader.rs src/printer.rs \
	       src/env.rs src/core.rs
SOURCES_LISP = src/env.rs src/core.rs src/stepA_mal.rs
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)

#####################

SRCS = step1_read_print.rs step2_eval.rs step3_env.rs \
       step4_if_fn_do.rs step5_tco.rs step6_file.rs step7_quote.rs \
       step8_macros.rs step9_try.rs stepA_mal.rs
BINS = $(SRCS:%.rs=target/%)

#####################

all: mal

mal: ${SOURCES_BASE} $(word $(words ${SOURCES_LISP}),${SOURCES_LISP})
	cargo build
	cp $(word $(words ${BINS}),${BINS})  $@

#$(BINS): target/%: src/%.rs
#	cargo build $*

clean:
	cargo clean
	rm -f mal

.PHONY: stats stats-lisp

stats: $(SOURCES)
	@wc $^
stats-lisp: $(SOURCES_LISP)
	@wc $^