OCaml: put macro flag in metadata rather than special type field
[jackhill/mal.git] / go / Makefile
CommitLineData
45e1db6a
JM
1export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2
69b4abd6
JM
3#####################
4
ad7e866e
JM
5SOURCES_BASE = src/types/types.go src/readline/readline.go \
6 src/reader/reader.go src/printer/printer.go \
af8fdff4 7 src/env/env.go src/core/core.go
fb5c1658
JM
8SOURCES_LISP = src/env/env.go src/core/core.go \
9 src/stepA_interop/stepA_interop.go
10SOURCES = $(SOURCES_BASE) $(word $(words $(SOURCES_LISP)),${SOURCES_LISP})
69b4abd6 11
69b4abd6
JM
12#####################
13
17e1c5f9 14SRCS = step0_repl.go step1_read_print.go step2_eval.go step3_env.go \
82efc357 15 step4_if_fn_do.go step5_tco.go step6_file.go step7_quote.go \
01c97316 16 step8_macros.go step9_try.go stepA_interop.go
69b4abd6
JM
17BINS = $(SRCS:%.go=%)
18
19#####################
20
21all: $(BINS) mal
22
23mal: $(word $(words $(BINS)),$(BINS))
24 cp $< $@
25
ad95503c
JM
26define dep_template
27$(1): $(SOURCES_BASE) src/$(1)/$(1).go
28 go build $$@
29endef
30
31$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
69b4abd6
JM
32
33clean:
34 rm -f $(BINS) mal
35
36.PHONY: stats stats-lisp
37
38stats: $(SOURCES)
39 @wc $^
40stats-lisp: $(SOURCES_LISP)
41 @wc $^