go: add step7_quote
[jackhill/mal.git] / go / Makefile
index 076a7aa..ddf29f6 100644 (file)
@@ -2,13 +2,15 @@ export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
 
 #####################
 
-SOURCES_BASE = src/types/types.go src/reader/reader.go
-SOURCES_LISP = src/step1_read_print/step1_read_print.go
+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/step7_quote/step7_quote.go
 SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
 
 #####################
 
-SRCS = step0_repl.go step1_read_print.go
+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
 BINS = $(SRCS:%.go=%)
 
 #####################
@@ -18,8 +20,12 @@ all: $(BINS) mal
 mal: $(word $(words $(BINS)),$(BINS))
        cp $< $@
 
-$(BINS): $(SOURCES_BASE) $(SOURCES_LISP)
-       go build $@
+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