diff --git a/build/ab.mk b/build/ab.mk index 7dae06d7..2e15af18 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -48,7 +48,10 @@ endif EXT ?= ifeq ($(PROGRESSINFO),) -rulecount := $(strip $(shell $(MAKE) --no-print-directory -q $(OBJ)/build.mk PROGRESSINFO=1 && $(MAKE) --no-print-directory -n $(MAKECMDGOALS) PROGRESSINFO=XXXPROGRESSINFOXXX | grep XXXPROGRESSINFOXXX | wc -l)) +# The first make invocation here has to have its output discarded or else it +# produces spurious 'Leaving directory' messages... don't know why. +rulecount := $(shell $(MAKE) --no-print-directory -q $(OBJ)/build.mk PROGRESSINFO=1 > /dev/null \ + && $(MAKE) --no-print-directory -n $(MAKECMDGOALS) PROGRESSINFO=XXXPROGRESSINFOXXX | grep XXXPROGRESSINFOXXX | wc -l) ruleindex := 1 PROGRESSINFO = "[$(ruleindex)/$(rulecount)]$(eval ruleindex := $(shell expr $(ruleindex) + 1))" endif diff --git a/build/ab.py b/build/ab.py index 31db9857..9afd62b5 100644 --- a/build/ab.py +++ b/build/ab.py @@ -423,7 +423,7 @@ def emit_rule(name, ins, outs, cmds=[], label=None): emit(*fouts, "&:" if len(fouts) > 1 else ":", *fins, "\x01", into=lines) if label: - emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO) ", label, into=lines) + emit("\t$(hide)", "$(ECHO) $(PROGRESSINFO)", label, into=lines) for c in cmds: emit("\t$(hide)", c, into=lines) else: diff --git a/build/protobuf.py b/build/protobuf.py index 3ce4a659..d5e02cb3 100644 --- a/build/protobuf.py +++ b/build/protobuf.py @@ -144,7 +144,7 @@ def protojava(self, name, srcs: Targets = [], deps: Targets = []): cwd=self.cwd, ins=protos, outs=[f"={self.localname}.srcjar"], - deps=deps, + deps=srcs + deps, commands=[ "mkdir -p {dir}/srcs", "cd {dir} && "