blob: dbdfeafdd426664a46e62f81c356c8c5936471be (
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
37
38
39
|
export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
#####################
SOURCES_BASE = src/types/types.go src/reader/reader.go src/printer/printer.go \
src/env/env.go src/core/core.go
SOURCES_LISP = src/step8_macros/step8_macros.go
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
#####################
SRCS = step0_repl.go step1_read_print.go step2_eval.go step3_env.go \
step4_if_fn_do.go step5_tco.go step6_file.go step7_quote.go \
step8_macros.go
BINS = $(SRCS:%.go=%)
#####################
all: $(BINS) mal
mal: $(word $(words $(BINS)),$(BINS))
cp $< $@
define dep_template
$(1): $(SOURCES_BASE) src/$(1)/$(1).go
go build $$@
endef
$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
clean:
rm -f $(BINS) mal
.PHONY: stats stats-lisp
stats: $(SOURCES)
@wc $^
stats-lisp: $(SOURCES_LISP)
@wc $^
|