1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-14 00:09:01 +03:00
mal/go/Makefile

41 lines
915 B
Makefile
Raw Normal View History

2014-10-05 05:06:42 +04:00
export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2014-10-05 03:34:26 +04:00
#####################
SOURCES_BASE = src/types/types.go src/readline/readline.go \
src/reader/reader.go src/printer/printer.go \
2014-10-07 05:36:23 +04:00
src/env/env.go src/core/core.go
SOURCES_LISP = src/stepA_interop/stepA_interop.go
2014-10-05 03:34:26 +04:00
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
#####################
SRCS = step0_repl.go step1_read_print.go step2_eval.go step3_env.go \
2014-10-07 08:53:51 +04:00
step4_if_fn_do.go step5_tco.go step6_file.go step7_quote.go \
step8_macros.go step9_try.go stepA_interop.go
2014-10-05 03:34:26 +04:00
BINS = $(SRCS:%.go=%)
#####################
all: $(BINS) mal
mal: $(word $(words $(BINS)),$(BINS))
cp $< $@
2014-10-07 07:27:28 +04:00
define dep_template
$(1): $(SOURCES_BASE) src/$(1)/$(1).go
go build $$@
endef
$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
2014-10-05 03:34:26 +04:00
clean:
rm -f $(BINS) mal
.PHONY: stats stats-lisp
stats: $(SOURCES)
@wc $^
stats-lisp: $(SOURCES_LISP)
@wc $^