last_rev := $(wildcard */.bzr/branch/last-revision) html := $(patsubst %/.bzr/branch/last-revision,%/index.html,$(last_rev)) all: $(html) .PHONY: all %/index.html: %/.bzr/branch/last-revision %/Makefile flock -n "$*" $(MAKE) -C "$*" RST2HTML=rst2html %/Makefile: bzr2html/.bzr/branch/last-revision bzr export -d ./bzr2html --format=tar - | flock -n "$*" tar -x -C "$*"