Skip to content

Commit f15e8e5

Browse files
author
Dylan Trotter
committed
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.
1 parent 6ea25f2 commit f15e8e5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ BENCHMARK_BINS := $(patsubst %,build/%_benchmark,$(BENCHMARKS))
6363

6464
TOOL_BINS = $(patsubst %,build/bin/%,benchcmp coverparse diffrange)
6565

66+
GOLINT_BIN = build/bin/golint
67+
6668
all: $(COMPILER) $(RUNTIME) $(STDLIB) $(TOOL_BINS)
6769

6870
benchmarks: $(BENCHMARK_BINS)
@@ -72,7 +74,7 @@ clean:
7274

7375
# Convenient wrapper around grumprun that avoids having to set up PATH, etc.
7476
run: $(RUNNER)
75-
@grumprun
77+
@$(RUNNER_BIN)
7678

7779
test: $(ACCEPT_PASS_FILES) $(COMPILER_PASS_FILES) $(COMPILER_EXPR_VISITOR_PASS_FILES) $(COMPILER_STMT_PASS_FILES) $(RUNTIME_PASS_FILE) $(STDLIB_PASS_FILES)
7880

@@ -135,25 +137,25 @@ $(RUNTIME_COVER_FILE): $(RUNTIME) $(filter %_test.go,$(RUNTIME_SRCS))
135137
cover: $(RUNTIME_COVER_FILE) $(TOOL_BINS)
136138
@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
137139

138-
build/bin/golint:
140+
$(GOLINT_BIN):
139141
@go get -u github.com/golang/lint/golint
140142

141-
lint: build/bin/golint
142-
@golint runtime
143+
lint: $(GOLINT_BIN)
144+
@$(GOLINT_BIN) runtime
143145

144146
# ------------------------------------------------------------------------------
145147
# Standard library
146148
# ------------------------------------------------------------------------------
147149

148150
$(STDLIB_PASS_FILES): $(PKG_DIR)/grumpy/lib/%.pass: $(PKG_DIR)/grumpy/lib/%.a
149-
@grumprun -m `echo $* | tr / .`
151+
@$(RUNNER_BIN) -m `echo $* | tr / .`
150152
@touch $@
151153
@echo 'lib/$* PASS'
152154

153155
define GRUMPY_STDLIB
154156
build/src/grumpy/lib/$(2)/module.go: $(1) $(COMPILER)
155157
@mkdir -p build/src/grumpy/lib/$(2)
156-
@grumpc -modname=$(notdir $(2)) $(1) > $$@
158+
@$(COMPILER_BIN) -modname=$(notdir $(2)) $(1) > $$@
157159

158160
build/src/grumpy/lib/$(2)/module.d: $(1)
159161
@mkdir -p build/src/grumpy/lib/$(2)
@@ -175,7 +177,7 @@ $(eval $(foreach x,$(shell seq $(words $(STDLIB_SRCS))),$(call GRUMPY_STDLIB,$(w
175177

176178
$(patsubst %_test,build/%.go,$(ACCEPT_TESTS)): build/%.go: %_test.py $(COMPILER)
177179
@mkdir -p $(@D)
178-
@grumpc $< > $@
180+
@$(COMPILER_BIN) $< > $@
179181

180182
# TODO: These should not depend on stdlibs and should instead build a .d file.
181183
$(patsubst %,build/%,$(ACCEPT_TESTS)): build/%_test: build/%.go $(RUNTIME) $(STDLIB)
@@ -189,7 +191,7 @@ $(ACCEPT_PASS_FILES): build/%_test.pass: build/%_test
189191

190192
$(patsubst %,build/%.go,$(BENCHMARKS)): build/%.go: %.py $(COMPILER)
191193
@mkdir -p $(@D)
192-
@grumpc $< > $@
194+
@$(COMPILER_BIN) $< > $@
193195

194196
$(BENCHMARK_BINS): build/benchmarks/%_benchmark: build/benchmarks/%.go $(RUNTIME) $(STDLIB)
195197
@mkdir -p $(@D)

0 commit comments

Comments
 (0)