Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 0def2c2

Browse files
authored
Fix .d file generation on OS X (#292)
The awk script that was processing modulefinder output to produce .d files was not working because it was using \> to match a word ending, but that is only supported in GNU awk: https://www.math.utah.edu/docs/info/gawk_5.html#SEC29 Switched that for a more portable equivalent.
1 parent 65b2ec8 commit 0def2c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ $(COMPILER_PASS_FILES): %.pass: %.py $(COMPILER) $(COMPILER_TEST_SRCS)
157157
@touch $@
158158
@echo compiler/`basename $*` PASS
159159

160+
# NOTE: In the regex below we use (\.|$) instead of \> because the latter is
161+
# not available in the awk available on OS X.
160162
$(COMPILER_D_FILES): $(PY_DIR)/%.d: $(PY_DIR)/%.py $(COMPILER_SRCS) $(PYTHONPARSER_SRCS)
161-
@$(PYTHON) -m modulefinder $< | awk '{if (match($$2, /^grumpy\>/)) { print "$(PY_DIR)/$*.pass: " substr($$3, length("$(ROOT_DIR)/") + 1) }}' > $@
163+
@$(PYTHON) -m modulefinder $< | awk '{if (match($$2, /^grumpy(\.|$$)/)) { print "$(PY_DIR)/$*.pass: " substr($$3, length("$(ROOT_DIR)/") + 1) }}' > $@
162164

163165
-include $(COMPILER_D_FILES)
164166

0 commit comments

Comments
 (0)