2014-10-05 05:06:42 +04:00
|
|
|
export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
2014-10-05 03:34:26 +04:00
|
|
|
#####################
|
|
|
|
|
2014-10-10 03:27:47 +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
|
2014-10-10 08:48:47 +04:00
|
|
|
SOURCES_LISP = src/stepA_interop/stepA_interop.go
|
2014-10-05 03:34:26 +04:00
|
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
|
|
|
|
|
|
|
#####################
|
|
|
|
|
2014-10-07 06:03:03 +04:00
|
|
|
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 \
|
2014-10-10 08:48:47 +04:00
|
|
|
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 $^
|