Commit f15e8e58 authored by Dylan Trotter's avatar Dylan Trotter

Use full bin path names when executing grumpy tools. Otherwise some...

Use full bin path names when executing grumpy tools. Otherwise some invocations fail with "no such file or directory" on Make 3.81 on OS X.
parent 6ea25f2b
......@@ -63,6 +63,8 @@ BENCHMARK_BINS := $(patsubst %,build/%_benchmark,$(BENCHMARKS))
TOOL_BINS = $(patsubst %,build/bin/%,benchcmp coverparse diffrange)
GOLINT_BIN = build/bin/golint
all: $(COMPILER) $(RUNTIME) $(STDLIB) $(TOOL_BINS)
benchmarks: $(BENCHMARK_BINS)
......@@ -72,7 +74,7 @@ clean:
# Convenient wrapper around grumprun that avoids having to set up PATH, etc.
run: $(RUNNER)
@grumprun
@$(RUNNER_BIN)
test: $(ACCEPT_PASS_FILES) $(COMPILER_PASS_FILES) $(COMPILER_EXPR_VISITOR_PASS_FILES) $(COMPILER_STMT_PASS_FILES) $(RUNTIME_PASS_FILE) $(STDLIB_PASS_FILES)
......@@ -135,25 +137,25 @@ $(RUNTIME_COVER_FILE): $(RUNTIME) $(filter %_test.go,$(RUNTIME_SRCS))
cover: $(RUNTIME_COVER_FILE) $(TOOL_BINS)
@bash -c 'comm -12 <(coverparse $< | sed "s/^grumpy/runtime/" | sort) <(git diff --dst-prefix= $(DIFF_COMMIT) | diffrange | sort)' | sort -t':' -k1,1 -k2n,2 | sed 's/$$/: missing coverage/' | tee errors.err
build/bin/golint:
$(GOLINT_BIN):
@go get -u github.com/golang/lint/golint
lint: build/bin/golint
@golint runtime
lint: $(GOLINT_BIN)
@$(GOLINT_BIN) runtime
# ------------------------------------------------------------------------------
# Standard library
# ------------------------------------------------------------------------------
$(STDLIB_PASS_FILES): $(PKG_DIR)/grumpy/lib/%.pass: $(PKG_DIR)/grumpy/lib/%.a
@grumprun -m `echo $* | tr / .`
@$(RUNNER_BIN) -m `echo $* | tr / .`
@touch $@
@echo 'lib/$* PASS'
define GRUMPY_STDLIB
build/src/grumpy/lib/$(2)/module.go: $(1) $(COMPILER)
@mkdir -p build/src/grumpy/lib/$(2)
@grumpc -modname=$(notdir $(2)) $(1) > $$@
@$(COMPILER_BIN) -modname=$(notdir $(2)) $(1) > $$@
build/src/grumpy/lib/$(2)/module.d: $(1)
@mkdir -p build/src/grumpy/lib/$(2)
......@@ -175,7 +177,7 @@ $(eval $(foreach x,$(shell seq $(words $(STDLIB_SRCS))),$(call GRUMPY_STDLIB,$(w
$(patsubst %_test,build/%.go,$(ACCEPT_TESTS)): build/%.go: %_test.py $(COMPILER)
@mkdir -p $(@D)
@grumpc $< > $@
@$(COMPILER_BIN) $< > $@
# TODO: These should not depend on stdlibs and should instead build a .d file.
$(patsubst %,build/%,$(ACCEPT_TESTS)): build/%_test: build/%.go $(RUNTIME) $(STDLIB)
......@@ -189,7 +191,7 @@ $(ACCEPT_PASS_FILES): build/%_test.pass: build/%_test
$(patsubst %,build/%.go,$(BENCHMARKS)): build/%.go: %.py $(COMPILER)
@mkdir -p $(@D)
@grumpc $< > $@
@$(COMPILER_BIN) $< > $@
$(BENCHMARK_BINS): build/benchmarks/%_benchmark: build/benchmarks/%.go $(RUNTIME) $(STDLIB)
@mkdir -p $(@D)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment